#bhanu365

1 messages · Page 1 of 1 (latest)

sterile questBOT
jagged kraken
#

Hi there!

#

If you already have a payment method saved (for example with a SetupIntent), yes you can use it to start a subscription.

woven walrus
#

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

jagged kraken
#

Thanks! Give me a few minutes to look into this.

woven walrus
#

ok

jagged kraken
#

If the customer already has a default payment method, you should set payment_behavior: "allow_incomplete"

woven walrus
#

I already set this payment behaviour to the subscription

jagged kraken
#

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_secret from the subscription
  • And use that on the frontend to collect the payment details
    This is the recommended implementation