#Ramesh

1 messages · Page 1 of 1 (latest)

zealous sirenBOT
wet adder
#

Hi there

#

Can you provide a request ID for the error?

silver cypress
#

Hi @wet adder our question is related to what payload need to be passed for Stripe (for Apple Pay)?

wet adder
#

Sure, was hoping to be able to see what you are trying to pass right now.

#

Do you have an Apple Pay PKPaymentToken right now?

#

You are trying to set up a direct integration here, yes? Where you aren't going to use our client libraries but instead you are setting up your own integration with Apple to collect the payment method details then want to pass that to Stripe?

silver cypress
#

@wet adder that is correct. We are using Ionic enterprise apple pay plug in

wet adder
#

I'm not really familiar with the Ionic plugin at all

silver cypress
#

This is payload we are receiving from the plug in and sending to Stripe

#

{
"request": {
"countryCode": "US",
"currencyCode": "USD",
"merchantCapabilities": [
"supports3DS"
],
"supportedNetworks": [
"amex",
"masterCard",
"visa"
],
"lineItems": [],
"total": {
"label": "Hot Dog",
"amount": "5.00",
"type": "final"
}
},
"token": {
"paymentMethod": {
"network": "MasterCard",
"type": "credit",
"displayName": "MasterCard 7951"
},
"transactionIdentifier": "F9123768BEA8086F1FB011CD3C10079DE9FD635FC5F43DD1E4315A8F4264F1B3",
"paymentData": {
"data": "tE9equ6CGvj2b...GAM6mdBMARoBA==",
"signature": "MIAGCSqGSIb3DQE...9gCMcSQWK9uQOp1gAAAAAAAA=",
"header": {
"publicKeyHash": "0/jmqztUB...Ms9xXBZQTY=",
"ephemeralPublicKey": "MFkwEwYHKoZIzj0CA...rZUd7pOIawDDUYAoKw==",
"transactionId": "f9123768fae8096f1fb011cd3c10079de9fd635fc5f63dd1e4315a8f4264f1b3"
},
"version": "EC_v1"
}
}
}

#

@wet adder can you please tell us which part from this payload is essential for Stripe to pledge the payment?

wet adder
#

Yep let me look

#

Okay so a cURL request to create a Token in Stripe would look like: 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>

#

That is an iOS sample. You are working with web here though it looks like?

silver cypress
#

we are trying to integrate with our native app (Hybrid app)

wet adder
#

So you should use the ApplePayPaymentToken.paymentMethod.displayName for pk_token_instrument_name and ApplePayPaymentToken.paymentMethod.network for pk_token_payment_network.

#

So let's see if we can grab the proper stuff based on the above

#

Okay yeah so looks like you have everything you need above.

#

You pass your paymentData hash to pk_token

#

Pass display_name to pk_token_instrument_name

#

And network to pk_token_payment_network

#

And finally the transactionID to pk_token_transaction_id

#

Our client libraries support this as well, it is just undocumented