Florian Birolleau
Florian Birolleau

Reputation: 333

Add apple-pay as a payment method in react-native

I am currently building an Uber-like app for another kind of service. I am using Stripe in order to get payments after the service has been done. I am currently allowing my users to add credit cards.

I want to allow them to use Apple pay. What i want to do is very simple:

  1. User clicks on the button apple pay on the SelectPaymentMethod component.
  2. I get the default credit card information.
  3. I tokenize it for stripe and i store the token in my database in order to charge the credit card later when my drivers are done.
  4. User clicks on book.
  5. Service is done and we charge the credit card depending on the actual price of the booking.

After hours of research, I've have a pretty bad feeling about this. Could anyone tell me more about the apple pay local API on react native ?

I already read the documentation of react-native-payments but I don't want to charge my users upfront. I want to charge them later and that why i need to them to be table to add apple-pay as a payment method.

Thanks in advance.

Upvotes: 3

Views: 3865

Answers (1)

korben
korben

Reputation: 1146

There are a few considerations here.

  1. Apple Pay is best used for one-off payments, rather than Subscription charges or charges made at irregular intervals for varying amounts. You're likely to see a number of declines with that as a payment method.

  2. Make sure you're not setting a price up-front.

  3. Remember that you need to attach that token to a Customer object in Stripe using the Create Card Source API Method. Tokens can only be used once unless they're associated with a Customer record.

Unless there is a reason to use Apple Pay in this instance, I might recommend something else instead. Card.io makes it pretty easy to attach cards to an account, for instance.

Hopefully that helps a bit.

Cheers!

Upvotes: 1

Related Questions