#fkaib
1 messages ยท Page 1 of 1 (latest)
Yes, the payment_behavior parameter helps with this. I'd reccommend reading the full doc section but basically if you pass in allow_incomplete or default_incomplete the subscription will be created with an incomplete status where it will wait for up to 24 hours for the first payment https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You may also find this guide helpful, it shows how to build a page where you create the subscription on your backend and confirm its first payment intent with a custom frontend https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
I see. And do I just use the client secret to confirm the payment?
I'll take a look a that
Correct, you pass the payment intent's client secret to the frontend and confirm it with Stripe Elements just like how you would if you created the payment intent directly.
how do I specify the payment method in the confirm function?
here is the request ID:
req_SV2Mra6o6hGWNe
Hi there ๐ taking over, as my colleague needs to step away
how do I specify the payment method in the confirm function?
I don't understand this question. Do you mean:
"I have a Payment Method already created. How do I use it?"
Or are you asking something different?
So I have a billing page where users can add a payment method. I have another page where users can purchase a subscription. If the user has a payment method on file si there a way to use that in the stripe
.confirmPayment()?
I was able to add a payment method in the backend when calling stripe.Subscription.create(). However I'd like to do it in the stripe.confirmPayment function in the frontend instead.
On your payment page, are you creating a Payment Method and setting it up for future usage?
I do that in the Billing page. In the Payment page I create a subscription where users can purchase.
So you don't need to call confirm in that case. You can just pass the Payment Method into the Subscription when it gets created as the default_payment_method: https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method
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 see. That's what I had originally but I was looking for a way to make it into two steps. I guess I can just stick to the old implementation. Thanks for all the help!