#xhu xi
1 messages · Page 1 of 1 (latest)
close
Is my assumption correct that I take the ApplePay token, create a PaymentMethod from it, create a PaymentIntent from that, and then confirm it?
1/ you actually first need to create a Stripe Token from the Apple Pay response
2/ then create a PaymentMethod from the Token
3/ then pass that PaymentMethod to the PaymentIntent to confirm
you have not done part 1/ right now.
Can you say why you aren't doing parts 1/ and 2/ from your iOS app? the iOS SDK has helper functions to do those
Hey thanks for taking a look.
The reason I'm not trying to create a Stripe Token first is because when I read the documentation it said card number/cvv/etc were required fields which I don't have in this case.
Creating the Stripe Token on the iOS side isn't something I knew we could do, when I started working with our iOS developer on this he just implemented the button and passed me that JSON blob you see above.
I also know that we're using Flutter for our phone apps, is that compatible with Stripe's ApplePay helper for iOS apps?
@stark mantle adding teammate to the chat for visibility
yeah so correcting a couple of things
it said card number/cvv/etc were required fields which I don't have in this case.
there's an undocumented param where you pass the Apple Pay blob which encodes all the card info , let me show you
I also know that we're using Flutter for our phone apps
gotcha, so yeah your Flutter app can use the publishable key to make the /v1/tokens request (and the /v1/payment_methods request) right from the app. Or you can do it server-side too, both work
here, this answer will help you (coincidentally was by me from a few yrs ago): https://stackoverflow.com/a/63853464/10654456
that shows you the params to pass on the /v1/tokens endpoint
and then make a /v1/payment_methods request using token: tok_123 to pass the just created Stripe Token
ok this is great, and I have to make the API call manually, not with the SDK to do it this way, right?
the SDK has a helper function but if you're using Flutter and don't have that function exposed in your Flutter app, then you can manually make the /v1/tokens request
yes that works too
cool thanks man!
np