#Reygo-applepay
1 messages · Page 1 of 1 (latest)
@vale rapids yep ,you want https://stripe.com/docs/stripe-js/elements/payment-request-button , that's how it's done.
You can't just get the card from their settings directly. You can only get it from the user going through Apple's payment sheet.
No, what I'm saying is that I want the paymentMethod.id in my site's user settings. Which is obviously not during the checkout flow. Basically have them "pre confirm" the use of Apple Pay during checkout later. We can do that in React Native.
oh so you just want to do a payment on the web with saved card you already have?
Well, that saved card would be Apple Pay
that's just an overload of confirmCardPayment for example https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-existing ( assuming you have a Customer object with a saved PaymentMethod pm_xxx you've retrieved from your database/backend/Stripe's API)
the fact the payment method came from Apple Pay when it was first saved I don't think is relevant here(though I'm not 100% sure I follow you so maybe I miss something)
- We have an account page where users can edit their payment info
- There we give them the ability right now, through Stripe, to add a credit card
- We want to give them the ability to add Apple Pay as well
And we're not charging them at this step
Then we store the payment method id and we use during checkout
I'm thinking of maybe "charging them" $0
And that should produce a payment method id
yep that's the only way really
you can't get the Apple pay details in any way except the payment sheet
Yeah, it looks like that's how we do it for native as well
it does look like/is optimisef for checkout flows but that's how these digital wallets are built unfortunately , the "save without charging" use case is a bit of a kludge
the PaymentRequest doesn't actually charge the card or anything, it just gives you the PaymentMethod ID
in that example we use the PaymentMethod ID to immediately charge it, but you don't have to do that
Yeah. It's just that there's no amount at that point
So I'll probably go that route and see how it goes
you would instead confirm a SetupIntent with it (https://stripe.com/docs/js/setup_intents/confirm_card_setup#stripe_confirm_card_setup-existing)
Complete reference documentation for the Stripe JavaScript SDK.