#faz-Subscription
1 messages · Page 1 of 1 (latest)
Thanks!
Can I have the subscription ID?
I have a payment intent creation, then i confirm card payment, then i make a new customer/product/subscription
pi_3KiX4oD7lOuiuDEB14yIMT7r is the subscription id
pi_3KiX4kD7lOuiuDEB1jqmDRt5 is the single payment made at the same time
I only want a subscription, not also a single payment
OK, usually we just need to confirm the latest_invoice.payment_intent on the subscription. May I know why do you create another payment intent? is it collect the payment method?
I'm confused...Another payment intent? Per payment, I'm only creating one
There's another paymentIntent from subscription's latest_invoice, which was created implicitly if the subscription's first invoice requires payment.
Maybe can you tell what you want to achieve? and I'll give you some suggetions.
I'd just like to create a subscription payment flow that uses apple pay
There's no 1 time payments involved at all
Just recurring payments
I see what you mean. Then how can I remove this initial paymentIntent that is seemingly required to be created when using apple pay?
Got it, you can use SetupIntent to collect the payment method and use it in the following subscription.
ah ok thanks
does the setupintent have the same parameters as payment intent? and is the response object the same? like can i literally just ctrl+f paymentIntent and replace with setupIntent
Just give me a sec, let me test it out in my own integration and I'll let you know the steps
k thanks
Hi @heavy saffron thanks for the waiting. here's the flow
- Create a SetupIntent with a customerId and set
payment_method_typesto ['card'] - Set
pendingto true (https://stripe.com/docs/js/appendix/payment_item_object) when you create the payment request, - In
paymentRequest.on('paymentmethod',, callstripe.confirmCardSetup()instead ofstripe.confirmPayment()
ok
what about when i update the payment request
since the price changes depending on the user form input
should i keep pending as true
also i have a parameter in my current confirmCardPayment function which is setup_future_usage, can i keep this parameter in confirmCardSetup? will it still be valid
I'd suggest you to set the pending to true so that the Apple Pay paymentsheet doesn't display the amount.
ok
i mean when i update the request with the total
should i keep pending as true
or then set it to false
The purpose is to collect the payment details so that you can use it later for the subscription invoice payment.
ok
Cool, happy to help!
how can i then force the user to enter in shipping details in apple pay? requestShipping: true in the paymentrequest and then what?
I tried that earlier and it said something about setting shippingOptions parameter? in which function do i set that
Yup, you also need to set shippingOptions, it's another param when you create the payment request https://stripe.com/docs/js/payment_request/create#stripe_payment_request-options-shippingOptions