#kanonhian
1 messages · Page 1 of 1 (latest)
hi
If you have a payment method already saved for future payments, you can see how to use that here, for example:
https://stripe.com/docs/payments/save-and-reuse?platform=web#charge-saved-payment-method
You can also set the payment method up as the default payment method for invoice payment for a customer, or specify it for subscription payments:
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method
What have you tried alreayd? WHat isn't working for you?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I mostly use checkouts, but having to do it all by myself is a little complicated
so, having the payment method I can do all the other stuff?
Then I'd suggest sticking with Checkout if that works for you!
Well for supported payment methods properly set up for future payments you could charge later with your own code, but yes you'll need to build that
think I get so. So basically I create an incomplete subscription attached to my payment method.
But then how do I actually bill the customer? Through a Charge object?
or perhaps a Payment Intent?
If you need to collect the payment info, you do that using the payment intent of the initial invoice on the incomplete subscription:
1/ https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription
2/ https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#collect-payment
Oh I see. The miissing piece was the PaymentIntent. Basically, create a paymentintent and returning its hash or whatever, so client-side we perform confirmPayment() and cycle closes
But in case paymentintent fails, what happnens with the incomplete subscription?
Hi there! Stepping in for my colleague and catching up
I think you might find this helpful: https://stripe.com/docs/billing/subscriptions/overview#subscription-lifecycle
If the payment fails, the subscription will remain incomplete
so, I would have to invalidate/wipe it off by myself?
I'm not sure I follow. Invalidate what exactly? The subscription remains incomplete (not active) and the invoice remains open (still awaiting payment)
yes sorry, I was talkin about my webhooks. never mind
Thank you both guys
may I ask you one last thing?
sure!
what is the server side equivalent of this stripe.confirmPayment()?
this perhaps ? https://stripe.com/docs/api/payment_intents/confirm
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yep, that's it!