#_apple-pay-server-tokens

1 messages ยท Page 1 of 1 (latest)

thin cragBOT
#

๐Ÿ‘‹ 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.

restive quarry
#

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.

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods and redirects.

#

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?

thin cragBOT
ancient remnant
#

๐Ÿ‘‹ happy to help

#

you shouldn't be using tokens for Apple Pay

restive quarry
#

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"

ancient remnant
#

are you accepting payments on web or on mobile?

restive quarry
#

Mobile ios app and then it sends token to php backend

ancient remnant
#

you can't use the /tokens API to generate card tokens

restive quarry
#

Oh okay. So there is no way i can use this data to create payment?

ancient remnant
#

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

restive quarry
#

OK, I'll look into it. Thank you ๐Ÿ™‚

thin cragBOT