Search code examples
androidgoogle-pay

Google pay preauthorized payment


Im my scenario I would like to offer a service with pay per mins price, I don't know the final price until the user press stop button.

the idea is to pre-authorize payment and when user finish to use that service execute the transaction.

Is it possible with Google Pay to pre-authorize a payment with unknown price?

I know with ApplePay we can archive something like that by creating a PKPaymentSummaryItem with non-zero positive integers price and PKPaymentSummaryItemType.pending as type.


Solution

  • Because Google Pay is only involved in facilitating the payment, and not the actual payment processing, the pre-authorization will need to be handled between you and your payment processor (see list of supported payment processors).

    The process will look something like this:

    1. Request Google Pay payment data (returns a payment token),
    2. Call your payment processor with payment token from step 1 to create a pre-authorization with estimated amount,
    3. Determine the actual charge amount
    4. Capture the pre-authorization with the actual amount with your payment processor

    I don't know which payment processor you are using, but Stripe documentation should give you a good example of what is required for steps 2 & 4.