#jm-apple-pay-setup
1 messages · Page 1 of 1 (latest)
Hi there 👋 just to clarify, you want Apple Pay to be only payment method accepted for a setup intent?
Card, Google Pay or Apple Pay
I got it working with card, and now I am setting up the request payment button, but I wasn't sure if it will behave the same for wallets
This is for a subscription, and I want to let the customer update their payment method in between billing cycle, that's why I suppose I need to use the setup intent instead of the payment intent
Gotcha, it'll work the same for wallets. Wallet payment methods are essentially card payment methods.
Great
What exactly does this mean?
"You can use Apple Pay tokens to create one-off payments or subscriptions" from https://stripe.com/docs/apple-pay?platform=web#recurring-payments
Also https://support.stripe.com/questions/using-apple-pay-for-recurring-payments talks about creating a token with Apple Pay, what token does this refer to?
You can use Apple Pay tokens to create one-off payments or subscriptions
This means that you can either use Apple Pay for on session payments (when the user is actually at their computer) or can charge them off session with our subscriptions
I am not immediately sure on the token aspect, can look in to that.
Are you clear on how to save an Apple Pay card via a SetupIntent?
Yeah, as long as it is the same as with cards, but it won't hurt some guidance, this is what I am doing
- Create setup intent and send it to the frontend
- Create card element in frontend
- use confirmCardSetup from Elements with the client secret from the setup intent
- Send the confirmed payment method id and customer id to the backend, so it can attach the payment method to the customer and save that method as their default for invoices
For Apple Pay the flow is actually a bit different. If you are using the card element, you will want to add the PaymentRequest button to be able to add Apple/Google Pay cards https://stripe.com/docs/stripe-js/elements/payment-request-button
So you would follow the flow from that doc but with a setupintent
And also when you create the payment request on the client side, you pass an amount of 0
country: 'US',
currency: 'usd',
total: {
label: 'Demo total',
amount: 0,
},
requestPayerName: true,
requestPayerEmail: true,
});```