Tipsi-stripe: Is it possible to create a token with card via apple pay without taking payments immediately?

Created on 17 Oct 2017  路  6Comments  路  Source: tipsi/tipsi-stripe

Like the title suggests, I'm trying to implement a preauthorization style payment where the user is not deducted the actual payment until later on (database trigger) but I still want to be able to preauthorize the payment via grabing the payment info with the token. I think this can be done with the createTokenWithCard but I was wondering if it can be done with the apple/android pay as well.

Thanks and cheers!

question

Most helpful comment

@kh1990 from tipsi-stripe (and stripe in general) you get a token and with that token you're doing all operations. So you can perform auth and capture workflow on your backend.

  1. Frontend: create token with apple pay (or credit card) and send it to backend
  2. Backend: create payment with flag: capture = False - this will just freeze required amount but not immediately deduct it (so you will be able to return money in any moment without penalties)
  3. Backend: capture your payment

https://stripe.com/docs/charges#auth-and-capture

Stripe gives you abstraction level over payment methods, so you're doing the same things for every type of payment, it doesn't matter if you're using credit cards, apple pay, android pay or something else (sure some methods don't support some features, like auth/capture for bitcoins but all basic CC-based things are pretty equal).

All 6 comments

@isnifer Thanks for the link, yeah I ended up using cardform to get the token to use to charge later on. I wasn't sure how to do the same with the apple pay part. Would I then call completeApplePayRequest() at a later point?

@kh1990 from tipsi-stripe (and stripe in general) you get a token and with that token you're doing all operations. So you can perform auth and capture workflow on your backend.

  1. Frontend: create token with apple pay (or credit card) and send it to backend
  2. Backend: create payment with flag: capture = False - this will just freeze required amount but not immediately deduct it (so you will be able to return money in any moment without penalties)
  3. Backend: capture your payment

https://stripe.com/docs/charges#auth-and-capture

Stripe gives you abstraction level over payment methods, so you're doing the same things for every type of payment, it doesn't matter if you're using credit cards, apple pay, android pay or something else (sure some methods don't support some features, like auth/capture for bitcoins but all basic CC-based things are pretty equal).

@cybergrind Thanks! Sorry about my confusion. I didn't realize the work flow was quite similar to the other processes via card tokens. After I set up the others I realized I could do the same with apple pay. Thanks for the capture = false flag, I havn't come across this yet so this is perfect for my use case!

The Apple Pay process is pretty close to how credit card tokens get stored into an account. I am actually using the same API endpoints to store the token returned from Apple Pay AS IF it were a credit card, and it works fine. I've been able to charge multiple times, for varying amounts - it doesn't seem to be a one-time-use token at all, as much as the UI seems to hint at that. I'm actually charging the card multiple times without prompting the user for apple pay authorization more than once.

@tmaly1980 the token return from Apple pay, do you mean the payment token? As I know it is just used one time, how can you use it(token) to charge many time? You said that you use card for charge many time - how can you got the card from apple pay?

Was this page helpful?
0 / 5 - 0 ratings