Google Pay

Decrypted Server-Side Implementation

Important
Decrypting Google Pay payment data on your server is not recommended, as it increases your risk and compliance burden. See Getting Started for our recommended integration method.

Creating transactionsAnchorIcon

If you decrypt the encrypted Google Pay payment data on your server, you can create a transaction with the decrypted parameters.
Important
If there is an electronic commerce indicator (ECI) within the decrypted payment data, it must be included below.
  1. python
request = {
  "amount": Decimal("10.00"),
  "android_pay_card": {
    "cryptogram": online_payment_cryptogram,
    "eci_indicator": eci_indicator,
    "expiration_month": expiration_month,
    "expiration_year": expiration_year,
    "google_transaction_id": google_transaction_id,
    "number": application_primary_account_number,
    "source_card_last_four": source_card_last_four,
    "source_card_type": source_card_type
  },
  "options": {
    "submit_for_settlement": True
  }
}

result = gateway.transaction.sale(request)
The amount you specify in your client-side payment request should reflect the actual amount you authorize and submit for settlement; transactions will still process in cases where the amount changes during order fulfillment.