#xhu xi

1 messages · Page 1 of 1 (latest)

vocal templeBOT
forest wing
#

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

dull nova
#

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

forest wing
#

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

#

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

dull nova
#

ok this is great, and I have to make the API call manually, not with the SDK to do it this way, right?

forest wing
#

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

dull nova
#

I'd be doing this on the server side for now via PHP

#

*if possible

forest wing
#

yes that works too

dull nova
#

cool thanks man!

forest wing
#

np