#Emile

1 messages · Page 1 of 1 (latest)

wind anchorBOT
still jungle
#

Okay so you want to pass the cryptogram from Apple/Google pay to Stripe to create a Payment Method?

lyric flume
#

I believe so yes, I currently received this as a payload.


{
  "amount": "9499",
  "currency": "GBP",
  "order_id": "STUF",
  "payment_method": "pay-with-google",
  "token": {
    "signedMessage": "{\"encryptedMessage\":\"asdasdasdasd+asdasd/Iu9rMeI6XGW2sjS9MXD2edG2uFJ1qmIsQQD4irxydlvde6fZnyXOIw643RfNzt/asd+WO6aNi4hF3NzWTAyYidwxsPAZJwl2N+0es+IUJoD9S0HOmCzmSBG5KSLBgmJjGsUQgRoeFLfrg/eLlRlL7DXiP3Ug5r9BAKkNBP+Fd45MRFCEsW/Ea080VUeX19Sm370f5dxDqdp0Fd/HIvvRWzxqUbh47UxYYF0zdvyptwmSoLImrm5oTJ0VDRStH4Qk++lHa1umnDXCM/c4CNnkVaEiUYyPQRZmvaT5ZaUxX0O5+zpfruc5tUvnbIwLnzQDoWaqJ3D/sGdhAK4AOgW4FTK/M9/WqPWv7w+voJn3txVjMAXnQ\\u003d\\u003d\",\"ephemeralPublicKey\":\"asdasdTEbcVoY\\u003d\",\"tag\":\"6q/pvh/T/omH0op16IU+asdasd\\u003d\"}",
    "protocolVersion": "ECv1",
    "signature": "asdasdasd="
  }
}

But i've not been able to find anything that clearly explains which parts to pass into the payment metthod

still jungle
#

This is possible but it isn't a well documented use case. Let me gather some information and I will share

lyric flume
#

That would be amazing, i've been trying to reverse enginneer what the client side doing, i.e. the Google stripe SDK. but it's proving a little difficult to keep track of what its doing.

still jungle
#

Okay so are you using Apple Pay, Google Pay, or both?

lyric flume
#

both.

still jungle
#

Hmmmm... okay I am looking around and only finding docs for the Apple Pay (either wallet produces slightly different objects when you decrypt them)

#

For instance, there is a undocumented parameter for the Tokens API called pk_token that is returned by Apple pay

lyric flume
#

I've been trying to see how the stripe android sdk calls itself when processing wallet payments and its proving a very circuitous process.

#

https://github.com/stripe/stripe-android/blob/aa3e5adb6f5afee72ac45ead88afbd982c92e767/payments-core/src/main/java/com/stripe/android/model/PaymentMethodCreateParams.kt

/**
* Used to create a [Card] object with the user's card details. To create a
* [Card] with a Stripe token (e.g. for Google Pay), use [Card.create].
*/
I'm missing a step i'm sure. as it doesn't align with the type of data i'm getting.

GitHub

Stripe Android SDK . Contribute to stripe/stripe-android development by creating an account on GitHub.

still jungle
#

Here is an example (using curl) of how you would convert a PKPaymentToken to a Stripe token:

curl -u sk_test_123: https://api.stripe.com/v1/tokens \
  -d pk_token=<PKPaymentToken.paymentData decoded as JSON> \
  -d pk_token_instrument_name=<PKPaymentToken.paymentInstrumentName> \
  -d pk_token_payment_network=<PKPaymentToken.paymentNetwork> \
  -d pk_token_transaction_id=<PKPaymentToken.transactionIdentifier>
lyric flume
#

so, its a case of creating a Stripe-Token first passing in the data one receives from either Google/Apple pay.

#

That's a good steer thanks. I'll take a look at that.

marble lintel
#

👋 stepping in

#

The above should get you going for Apple Pay. Let me know if you need help with Google Pay? You basically are going to pass the cryptogram and tokenization_method: 'android_pay' to /v1/tokens

lyric flume
#

Thanks, i'll be picking this up again monday for my sins.