Decrypted Server-Side Implementation

Creating transactionsAnchorIcon

If you decrypt the encrypted Google Pay payment data on your server, you can create a transaction with the decrypted parameters.
  1. Callback
  2. Promise
gateway.transaction.sale({
  amount: "10.00",
  androidPayCard: {
    number: applicationPrimaryAccountNumber,
    cryptogram: onlinePaymentCryptogram,
    expirationMonth: applicationExpirationDate[2..3],
    expirationYear: applicationExpirationDate[0..1],
    eciIndicator: eciIndicator,
    sourceCardType: sourceCardType,
    sourceCardLastFour: sourceCardLastFour,
    googleTransactionId: googleTransactionId
  },
  options: {
    submitForSettlement: true
  }
}, (err, result) => {
  if (result.success) {
    // See result.transaction for details
  } else {
    // Handle errors
  }
});
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.