#kaneW

1 messages · Page 1 of 1 (latest)

vapid wedgeBOT
red spoke
#

hello! is there a reason why you don't use the Stripe SDK to collect payments with Apple Payinstead, and want to use the Apple Pay Token?

rotund jacinth
#

We are a PCI DSS compliant entity and hence wanted to generate a PPC on our own and use this to make payments

red spoke
#

ah

#

Once you have the PKPaymentToken or ApplePayPaymentToken, you would use the Create Token API with the undocumented pk_token parameter to exchange your Apple Pay Token for a Stripe Token. This is supported by all of our client libraries--you don't have to use cURL, but here is a cURL example of what the syntax should look like that can be mirrored in whatever library you are using.

The curl request for passing a pk_token to the /v1/tokens API would look something like this:

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>

After getting the Stripe Token, you can convert it to a Payment Method : https://stripe.com/docs/api/payment_methods/create

curl -u sk_test_123: https://api.stripe.com/v1/payment_methods \
-d type=card \
-d "card[token]"=tok_123

Or, use it directly to create a PaymentIntent : https://stripe.com/docs/api/payment_intents/create

curl -u sk_test_123: https://api.stripe.com/v1/payment_intents \
-d amount=2000 \
-d currency=usd \
-d "payment_method_data[type]"=card \
-d "payment_method_data[card][token]"=tok_123
#

let me know if i've misunderstood and this isn't what you're looking for

rotund jacinth
#

Yup, we are looking for something like this. Will give it a try and get back

#

For the /tokens request can you share some sample or default parameter values for us to map?

red spoke
#

i can't unfortunately, it requires actual data

#

sample data wouldn't work

rotund jacinth
#

{ "applicationPrimaryAccountNumber"=>"4109370251004320", "applicationExpirationDate"=>"200731", "currencyCode"=>"840", "transactionAmount"=>100, "deviceManufacturerIdentifier"=>"040010030273", "paymentDataType"=>"3DSecure", "paymentData"=> { "onlinePaymentCryptogram"=>"Af9x/QwAA/DjmU65oyc1MAABAAA=", "eciIndicator"=>"5" } }

#

This entire JSON should be passed aspk_token

#

?

#

Could you share the link to documentation for pk_token exchange?

vapid wedgeBOT
sharp prism
#

The documentation is not public as it's largely discouraged. The example @red spoke shared above is essentially what we have internaly