#bhanu365
1 messages · Page 1 of 1 (latest)
Hi there!
If you already have a payment method saved (for example with a SetupIntent), yes you can use it to start a subscription.
I have render the payment element of setupintent and do the payment then I got the payment method from the setupIntent and I set the default payment method to the customer and after that I create a subscription but when i see in the log the subscription still incomplete and the invoice is still open.
sub_1M5T7DFmM52WOkSoBe38V59e
Thanks! Give me a few minutes to look into this.
ok
If the customer already has a default payment method, you should set payment_behavior: "allow_incomplete"
I already set this payment behaviour to the subscription
But note that you don't need to collect a payment method with a SetupIntent before. You could:
- Create a subscription with
payment_behavior: "default_incomplete" - Retrieve the
latest_invoice.payment_intent.client_secretfrom the subscription - And use that on the frontend to collect the payment details
This is the recommended implementation