How to generate Payment Token in GooglePay & ApplePay for Authorize.net (In Mobile App Transaction)?

Viewed 367

This is the Above API to process the payment through google pay also ApplePay

This is the Above API to process the payment through google pay also ApplePay. Under OpaqueValues the datavalue is base64 token. My Question is how to generate this token from googlePay and ApplePay so that we can process the payment in Flutter.

1 Answers

Browsing Authorize.Net's documentation, I came across the following: https://developer.authorize.net/api/reference/features/in-app.html#Google_Pay%E2%84%A2

Using the Payment Network Token

After obtaining a payment network token from Google Pay, encode the token's blob using Base64:

new String(Base64.encode(paymentData.getPaymentMethodToken().getToken().getBytes()))

Submit a createTransactionRequest API call. Set the dataDescriptor field to COMMON.GOOGLE.INAPP.PAYMENT, and set the dataValue field to the Base64-encoded blob.

Related