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. java
TransactionRequest request = new TransactionRequest()
    .amount(new BigDecimal("10.00"))
    .androidPayCardRequest()
    .cryptogram(onlinePaymentCryptogram)
    .eciIndicator(eciIndicator)
    .expirationMonth(expirationDate)
    .expirationYear(expirationYear)
    .googleTransactionId(googleTransactionId)
    .number(applicationPrimaryAccountNumber)
    .sourceCardLastFour(sourceCardLastFour)
    .sourceCardType(sourceCardType)
    .done()
    .options()
    .submitForSettlement(true)
    .done();

Result<transaction> 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.