#_apple-pay-server-tokens
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1386993945870860349
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Here is a snippet of the data im working with from the iOS app:
{
"data": {
"data":"redacted",
"signature":"redacted",
"header":{
"publicKeyHash":"redacted",
"ephemeralPublicKey":"redacted",
"transactionId":"redacted"
},
"version":"EC_v1"
},
"paymentMethod":{
"network":"Visa",
"displayName":"redacted",
"type":1
},
"transactionIdentifier":"redacted",
"paymentNetwork":"Visa",
"paymentType":"ApplePay"
}
And here is a snippet of how im trying to use the StripeClient:
$token = \Stripe\Token::create([
'pk_token' => base64_decode($this->request->post['data']),
'pk_token_instrument_name' => $this->request->post['paymentMethod']['displayName'],
'pk_token_transaction_id' => $this->request->post['transactionIdentifier'],
'pk_token_payment_network' => $this->request->post['paymentMethod']['network'],
]);
$charge = \Stripe\PaymentIntent::create([
'amount' => $amount,
'currency' => $currency,
'payment_method_data' => [
'card' => $token,
],
'description' => 'Order #' . $order_id
]);
But when im trying to create a token i get error
Sending credit card numbers directly to the Stripe API is generally unsafe. We suggest you use test tokens that map to the test card you are using, see https://stripe.com/docs/testing. To enable testing raw card data APIs, see https://support.stripe.com/questions/enabling-access-to-raw-card-data-apis.
I just don't really understand, I'm not sending card details directly or anything. I am sending encrypted and certified data that is received from apple pay. And then how else can I process this data?
๐ happy to help
you need to implement this https://docs.stripe.com/apple-pay?platform=web#accept
you shouldn't be using tokens for Apple Pay
So can't I use it or shouldn't I? It's just that everything is ready, I would just like to integrate the payment in the backend.
I found this thread saying that they can be used for apple pay.
https://stackoverflow.com/questions/63851049/how-do-i-send-apple-pay-payment-token-to-stripe-to-complete-the-charge/63853464#63853464
It's just that when transferring data to the tokens endpoint, I get this error "Sending credit card numbers directly to the Stripe API is generally unsafe"
are you accepting payments on web or on mobile?
Mobile ios app and then it sends token to php backend
you can't use the /tokens API to generate card tokens
Oh okay. So there is no way i can use this data to create payment?
there is, but you need to be PCI compliant and we really discourage using that method today for several reasons. but if you are PCI compliant and you need access to this feature you should contact https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
OK, I'll look into it. Thank you ๐