Server-Side Implementation
Important
Your integration may be impacted by upcoming certificate changes. Visit our best practices guide to learn more.
GraphQLClick here to view the server-side
implementation using GraphQL.
Availability
Google Pay is currently available with our latest Android and JavaScript SDKs.
Creating transactions
Using card nonces
Include the Google Pay card nonce in the
Transaction: Sale call on your server:
Collect device data
from the client and include the deviceDataFromTheClient in the
transaction.
- PHP
$result = $gateway->transaction()->sale([
'amount' => '10.00',
'paymentMethodNonce' => $nonceFromTheClient,
'deviceData' => $deviceDataFromTheClient,
'options' => [
'submitForSettlement' => True
],
'billing' => [
'postalCode' => $postalCodeFromTheClient
]
]);Note
Google Pay cards are represented as Android Pay cards in our API to prevent breaking changes. For
example, the response from a
Payment Method: Create
call with a card from Google Pay will include the
AndroidPayCard response object.
Vaulting Google Pay
Google Pay cards can only be
saved to your Vault for specific use
cases;
see the support article for details. Vaulting of PayPal accounts from Google Pay is currently not supported. This means the
options.storeInVault
and
options.storeInVaultOnSuccess
options are not supported when creating a transaction. If your use case is supported, you can store
a customer's Google Pay card in your Vault in a few different ways:
-
In a separate
Payment Method: Createrequest -
In a separate
Customer: CreateorCustomer: Updaterequest -
In your
Transaction: Salerequest by using options.storeInVault or options.storeInVaultOnSuccess