SAMIR RATHOD
SAMIR RATHOD

Reputation: 3510

Authorize a transaction with unknown amount, and charge the amount for the service later

I'm developing a kind of Car Booking iOS Application; and I want to develop following kind of process for payment :

Want to implement Consumption based payment for my App Users. Rather than pre-payment; User will do Post Payment based on his Usage.

In my Application, User will book a Car ---> He can use it for as many Hours as he wants to use. E.g. he used it for 10 Hours ---> And at the time of submitting car back ---> System automatically deducts the money from his credit card for his usage.

So, e.g. Hourly Rate is 2$/Hour and User used it for 20 hours; than system will deduct 40 $(2*20) From his credit card.

My Plan is to Use Apple Pay,I got below information : https://developer.apple.com/apple-pay/get-started/

Transaction type : Authorization unknown amount & capture
Description : Authorize a transaction with unknown amount, and charge
the amount for the service later
Example : Taxi ride

I have read apple pay document and see apple pay video from here :

https://developer.apple.com/videos/play/wwdc2015/702/
https://developer.apple.com/apple-pay/get-started/
https://dzone.com/articles/integrating-your-ios-app-apple
https://developer.apple.com/apple-pay/Getting-Started-with-Apple-Pay.pdf

I have also refer following demo:

I'm buildingn my iOS Application in Objective C.

https://developer.apple.com/library/content/samplecode/Emporium/Introduction/Intro.html
https://github.com/prolificinteractive/applepay-demo
https://www.raywenderlich.com/87300/apple-pay-tutorial

also refer :

Paypal - charge customer an unknown amount at a later date

Now I want to know is there any best option than apple pay? Or how can I achieve above requirement using Apple Pay.

My main goal is to take automatic payment from user after he/she used my services.

Please give me your opinion for the same and How can I use Transaction type?

Thanks in Advance.

Upvotes: 4

Views: 2083

Answers (1)

Triinu
Triinu

Reputation: 41

Here is an explanation from apple developer pages:

If you do not know the actual cost when the payment is authorized (for example, a taxi fare), make a subtotal summary item using the PKPaymentSummaryItemTypePending type and a 0.0 amount. For the grand total, use a positive non-zero amount and the PKPaymentSummaryItemTypePending type. The system then shows the cost as pending without a numeric amount.

https://developer.apple.com/library/archive/ApplePay_Guide/CreateRequest.html#//apple_ref/doc/uid/TP40014764-CH3-SW2

Upvotes: 4

Related Questions