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. PHP
$result = $gateway->transaction()->sale([
    'amount' => '10.00',
    'googlePayCard' => [
        'cryptogram' => onlinePaymentCryptogram,
        'expirationMonth' => substr(applicationExpirationDate, 2, 2),
        'expirationYear' => substr(applicationExpirationDate, 0, 2),
        'eciIndicator' => eciIndicator,
        'googleTransactionId' => googleTransactionId,
        'number' => applicationPrimaryAccountNumber,
        'sourceCardLastFour' => sourceCardLastFour,
        'sourceCardType' => sourceCardLastFour
    ],
    'options' => [
        'submitForSettlement' => true
    ]
]);
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.