#skoshkarli-subs-payments
1 messages ยท Page 1 of 1 (latest)
Yes, that's correct - when using Subscriptions you don't need to separately create a Payment Intent because we'll create one for you.
Have you looked through this guide? https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
It shows how you'd use Subscriptions + the Payment Element
That's what we recommend
what if the customer doesn't complete the payment?
Then the subscription will expire in 23 hours automatically
but it stays inactive, correct?
Yes, expiration is the same as cancellation
so if someone goes through my checkout flow multiple times, without completing payment, they could end up with multiple subscriptions that are inactive?
Also, i have choices on my payment page for subscription product, annual vs monthly. How will i create a subscription without a product since i don't yet know which product the user will select?
You would create the subscription AFTER they select the product, not behfore
but thats not how our product team wants it implemented
the product selection happens on the payment page
how can i do that using your api?
Hi there ๐ taking over for karbi
You can have a product selection on the payment page, you just wouldn't create the Subscription until the product was selected.
but the paymentElements requires the secret
If you want your flow to work like that, I'd recommend not using the Payment Element - the Payment Element relies heavily on the payment intent being available BEFORE you display the element
In comparison, with the card element you don't need the client secret until confirmation, and that would allow you to delay creating the Subscription until later
oh interesting
so if I used card element, what would i do for apple pay/google pay ?
That's one of the cons of card element - you'd need to integration with the payment request button separately (https://stripe.com/docs/stripe-js/elements/payment-request-button)
it looks like payment request button also requires paymentIntent ?
Hi there ๐ taking over for Karbi
Give me a few minutes to get caught up.
Yes. You would have to create a Payment Intent as part of the integration flow
so how can i avoid creating a paymentIntent when doing apple pay on the page that also has product selection?
I don't think you can. You have to have a Payment Intent in order for payment to occur.
When you say product selection, I didn't think the Apple Pay modal gave the option for that
no, the way we have it designed is that the product selection will be on the payment page, where the apple pay button will also be present as well as the card element.
Once the user clicks on the product they want, they then either fill the card info or click apple pay and we want the subscription to be created at that point and payment completed
thats what i am trying to achieve
we figured out that we can render CardElement without paymentIntent, so i am trying to figure out how we do apple pay as well
As far as I can tell, you would have to update the paymentRequest instance (see: https://stripe.com/docs/js/payment_request/update), so when they select a product, you would update the instance and re-mount the payment button).
my concern is specifically around PaymentIntent
and having to create that or a subscription prior to displaying the PaymentRequestButton
The paymentRequest button can't be used with Subscriptions as far as I can tell, so you would have to build out a separate flow for Subscriptions. You could create a Payment Intent at any point and just replace step 4 in this guide (https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-create-payment) with an update Payment Intent call, instead of a create Payment Intent call: https://stripe.com/docs/api/payment_intents/update
So you are saying create a paymentIntent with some default product, then on the Payment/Product Selection page, update the paymentIntent with the appropriate product/price and create the subscription?
Also, how do i pass the paymentIntent to the subscription?
Let's back up a little here. The Subscription creates an Invoice, which creates a Payment Intent. This whole process has nothing to do with the payment request button or creating a Payment Intent.
That's why I'm suggesting you not display a payment window/div until the customer selects what they want, because the payment modal you choose to display is going to be entirely different depending on the selection when you mix one-off payments and Subscriptions
so if i create a Subscription for the customer before they land on the payment page and use the PaymentElement (using the client_secret from the subscription created beforehand), would there be any issue with potential Subscriptions that never get activated? Are there any notifications that go out to the user as part of creating a subscription before collecting a payment?
Hello ๐
Taking over here as two-shoes needs to step away soon
Give me a moment to catch up here ๐ Thanks
So if the user never pays the subscription invoice, its status would be past_due.
You can specify subscription's default behavior when the payment fails or is incomplete
A subscription creation is different than a subscription that's active ๐
does subscription creation cause any communication to go out to the customer?