#Emile
1 messages · Page 1 of 1 (latest)
👋 happy to help
I have am exiting backend (nodejs express) payment scripts, and i need to swap out existing GLobal Pay payment processing with stripe in some situations.
As such i can't just use the stripe ios/google sdks.
I'm struggling to find any documentation that explains how to take the google/apple pay information and send it to stripe to complete a payment.
unfortunately this is not documented
if you have already an integration with Apple Pay and you have the token resulting from that integration
Your colleagues shared some information on friday, but i've not been able to fully understand the exact calls to make. Also i beleive the typescript library is typed such that i will have to call the rest API directly rather than using the stripe nodejs lib because it doesn't allow the fields previously suggested.
might be the case but I'm not sure
let me check that for you first
actually if it's just a typescript error, you could suppress the typescript warning
and try it out
I'm currently on android.
so this is the stripe test, i basically get this and the apple equivelent.
i do not now how to send this information to stripe createPaymentMethod, to be able to process a wallet payment.
So i'm currently just trying to build a Postman call for either the tokens/ endpoint, but without documentation i'm not sure what the google fields are and what values i need to post.
It was suggested that for apple id send pk_tokenization_method and a bunch of other fields.
just give me a moment
np, thanks.
those instructions are for Apple Pay. I have never heard of this being possible with Google Pay
that was exactly what I was going to ask about, thanks for jumping in @burnt tundra
I've been trying to see what the google and apple sdks do. Its pretty difficult to track.
I only heard this question being asked once(in several years of working at Stripe), and I think all we can say is you can try it(passing the GPay cryptogram to the /v1/tokens undocumented params like pk_token, and it might work, we honestly don't know
https://github.com/stripe/stripe-android/blob/563dccab9d678d2564a99d9638c352bb2f96f921/payments-core/src/main/java/com/stripe/android/googlepaylauncher/StripeGooglePayActivity.kt
https://github.com/stripe/stripe-android/blob/d6be9b7cc8a8c5753c4a839944ab3ae0068fe0c8/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt
https://github.com/stripe/stripe-android/search?q=PaymentMethodCreateParams+createFromGooglePay
https://github.com/stripe/stripe-android/blob/ea05ac48a91d54042a9f440ec1f8cf34b11c71d5/payments-core/src/test/java/com/stripe/android/model/GooglePayFixtures.kt
Stripe Android SDK . Contribute to stripe/stripe-android development by creating an account on GitHub.
Stripe Android SDK . Contribute to stripe/stripe-android development by creating an account on GitHub.
Stripe Android SDK . Contribute to stripe/stripe-android development by creating an account on GitHub.
Stripe Android SDK . Contribute to stripe/stripe-android development by creating an account on GitHub.
the Google SDK doesn't do this. Google has a direct integration with us.
they send us the payment details directly when you use us as the tokenizationMethod
oh
i.e you use Stripe as part of https://developers.google.com/pay/api/web/guides/tutorial#tokenization (you can search for us in the input box there)
ah, this is a step i may have missed.
so we have dual payment provides in the APP and the business, so the app needs to support both depending on thwat they are paying for.
so i would need to configure the google/apple pay config to switch the payment provider depending on what they are paying for. Oh joy.
yep, well that's what you take on when you choose to be multi-processor
yeah, This isn't even the worst of it.
ok, so presuming i get the app updated to switch the payment provider out correctly, what happens then.
in any case you can 100% use https://developers.google.com/pay/api/android/guides/tutorial and integrate that way — you get a Stripe token object tok_xxx in the PaymentData from their SDK at the end
that token can then be converted to a PaymentMethod in our API by calling /v1/payment_methods with type:card and card[token]=tok_xx , and then you use the PaymentMethod with the PaymentIntents APIs normal
this is a highly advanced integration, but it is completely possible and many of our merchants do it
ok, so i get a proper Stripe Token as long as we setup the app correctly. Perfect. i can get this done.
thanks for your help.
hmm, actually you already did this
like that is the correct result from Google
you just need to parse that token ID from the JSON and call /v1/payment_methods with it.
https://stripe.com/docs/api/payment_methods/create#create_payment_method-card
For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format
card: {token: "tok_visa"}
that's the same thing our SDK does(https://github.com/stripe/stripe-android/blob/aa3e5adb6f5afee72ac45ead88afbd982c92e767/payments-core/src/main/java/com/stripe/android/model/PaymentMethodCreateParams.kt#L830-L853) just wrapped in some internal classes. But it's basically just parsing the JSON for that token ID and calling /v1/payment_methods with it.
Oh, cool, I’ll check to see if I can grab that value. Currently it’s not passed to my server endpoint. Thanks again.