Reputation: 21
I have installed package react-native-payments in react native project, and i have token from that response, using that token i wants to do payment with stripe, is that any api available? to use apple pay token with stripe.
basically we have to check with token which will get from apple pay and then can able to pass in strip payment api method, Is any thing available from api side ?
Upvotes: 2
Views: 2166
Reputation: 3240
The react-native-payments library has a Stripe-specific plugin that you can use:
As documented, this plugin will allow you to receive Stripe-chargeable tokens as part of the PaymentResponse.
Once you have the Stripe Token you'll need to send it to you server where you can save it to a Stripe Customer to make charges with. If the token you get back from the library has a tok_
prefix that means that it's a legacy Token, so you'd likely want to convert that to the newer PaymentMethods API. To do this you would create a new PaymentMethod and pass in card: { token: "tok_xyz" }
. From there you can save the newly created PaymentMethod (will have a pm_
prefix) to a Stripe Customer:
You can then use the Customer/PaymentMethod duo to process payments using all of Stripe's APIs.
Upvotes: 2