#faz-ApplePay
1 messages · Page 1 of 1 (latest)
Hi there, the fastest way to start using subscription is via Stripe Checkout in subscription mode. You can pass in an existing product, or create an ad-hoc product when creating the Checkout Session.
The Checkout page support Apple Pay out-of-the box, so you can save the trouble of setting up Apple Pay in your own website.
I'd like to set up the subscription without using Checkout, and i've already got apple pay set up on my own website. I'm just not sure how to set up the apple pay for a subscription
I've already been able to set it up for one-time payments
I'm not sure how to retrieve the card token? Should I change the listener to 'token' instead of 'paymentmethod'? And then how do I make the new customer with just a card token and no payment method?
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements&card-or-payment-element=payment-element this guide should get you started.
You can take a look at it and see if you want to build the subscription page by yourself. I'd strongly recommend to to use Checkout though.
I've built a payment intent using the information passed from the apple pay button, but now i'm receiving the status requires_confirmation in my payment dashboard and i'm not sure how to continue? I've already tried running stripe.confirmCardPayment upon receiving this status but haven't had any luck. Any suggestions?
Can you give me the PaymentIntent ID?
There's a couple, but this is the most recent: pi_3KiCgDD7lOuiuDEB0kkYpN4s
I don't see any requests to confirm this PI.
yea, i'm just now realizing i ran a confirmcardpayment function in the wrong part
however i'm not sure what's the correct way to do it
i'm returning paymentintent object from my paymentintent creation on backend
If you are using the Payment Request Button API then yes you can call stripe.confirmCardPayment to confirm the payment
do i then use confirmcardpayment
ok
do i have to use confirmcardpayment before or after making the subscription
because at the moment i'm putting it after, based on the logic in my code that was already there for non-apple pay subscriptions, which is that the card payment was confirmed after the subscription was created
sorry I'm not clear on your question. can you show me the code?
you see how i'm calling the "subscribe" function before doing the card payment confirmation
this worked for me in non-apple pay payments but seemingly not for apple pay
And what does this subscribe function do?
makes a customer, product, and subscription
returns client secret, status, and customer id
OK, and where do you get the paymentIntent?
for the subscription? the payment method is passed in the request body
for the third-party-pay function, payment intent is created in the function
that's the third-party-pay function code
Hmm, one sec. let me zoom back. We are discussing the payment confirmation for subscription right. I'd like to know how did you get the paymentIntent(or clientSecret) after creating the subscription. Can you share with me the code what you wrote in the subscribe function?
Ok, I'd suggest you to set setup_future_usage=off_session https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage when creating the payment intent. This indicates that you intend to make future payments with this PaymentIntent’s 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.
So the payment method can be ready for off_session subscriptions payments.
didn't do anything
Hi! I'm taking over Jack Tan. So if I understand correctly you are trying to create a subscription using Apple Pay?
Where exactly are you stuck? Do you get an error message? Can you share a PaymentIntent ID?
error messages are supposed to be going through to my slack channel, but they don't for some reason
latest payment intent id is pi_3KiDebD7lOuiuDEB1ZPDATNH
Thanks! I see this PaymentIntent was created successfully, but you never tried to confirm it. So you need to call confirmCardPayment().