sorokin0andrey/react-native-google-pay

Stripe questions

stravi opened this issue · 2 comments

Hi, I don't understand what is the purpose of including the stripe detail when calling requestPayment() if in your example you anyway say that the token has to be sent to payment gateway:

GooglePay.requestPayment(requestData)
        .then((token: string) => {
          // Send a token to your payment gateway
        })
        .catch((error) => console.log(error.code, error.message));

As far as I understand react-native-google-pay only asks google pay for a token and then the token need to be sent to stripe using stripe API. Correct? Or calling stripe endpoint is also handled in this lib?

@stravi Hello! Sorry for the late reply, i was really busy 😰
Sure. This module only asks GPay token and then you have to send it to your payment gateway (like stripe API endpoint).

Hey,

@stravi and @sorokin0andrey above method give the exact same response as the stripe create token API endpoint. Does that mean this library internally called stripe endpoint? This is the response I got as a token
{
"id": "tok_1LXjxqKZVXw7v7nbqIrxxxx",
"object": "token",
"card": {
"id": "card_1LXjxpKZVXw7v7nbAJHj8SDT",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "American Express",
"country": "US",
"cvc_check": null,
"dynamic_last4": "4242",
"exp_month": 12,
"exp_year": 2027,
"funding": "credit",
"last4": "0005",
"metadata": {},
"name": null,
"tokenization_method": "android_pay"
},
"client_ip": "209.85.198.209",
"created": 1660733950,
"livemode": false,
"type": "card",
"used": false
}