Google Pay™
Google Pay allows your customers to make payments in your app or website using any credit or debit card added to their Google Account.
Ryft supports Google Pay with Visa and Mastercard cards.
Ryft offers the ability to accept payments in-app and via websites with Google Pay
Integrate With Google Pay
See the Google Payment API guide
Google Requirements
Google Pay™ (Android)
Google Pay™ (Web)
Prior to going live with Google Pay on the Web, you must have a valid Google verified Live Merchant ID. To receive your Live Merchant ID:
- Follow Google Pay's Integration Checklist linked above, to ensure you have completed all the required steps in your integration.
- Begin the process to obtain production access from Google, here.
Using the Google Pay API
Send a Payment Request to Google
Once you have read the above, the first step is to submit a payment request to the Google Pay API. Include the following details in your request:
Parameter | Description | Value |
---|---|---|
gateway | The payment gateway you are integrating with | ryft |
gatewayMerchantId | An Id that uniquely identifies you within the gateway | <your_public_api_key> |
Example Requests:
{
'type': 'CARD',
'parameters': {
'allowedAuthMethods': ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
'allowedCardNetworks': ['MASTERCARD', 'VISA']
},
'tokenizationSpecification': {
'type': 'PAYMENT_GATEWAY',
'parameters': {
'gateway': 'ryft',
'gatewayMerchantId': '<your_public_api_key>'
}
}
}
private PaymentDataRequest createPaymentDataRequest() {
PaymentDataRequest.Builder request =
PaymentDataRequest.newBuilder()
.setTransactionInfo(
TransactionInfo.newBuilder()
.setTotalPriceStatus(WalletConstants.TOTAL_PRICE_STATUS_FINAL)
.setTotalPrice("20.00")
.setCurrencyCode("GBP")
.build())
.addAllowedPaymentMethod(WalletConstants.PAYMENT_METHOD_CARD)
.addAllowedPaymentMethod(WalletConstants.PAYMENT_METHOD_TOKENIZED_CARD)
.setCardRequirements(
CardRequirements.newBuilder()
.addAllowedCardNetworks(
Arrays.asList(
WalletConstants.CARD_NETWORK_VISA,
WalletConstants.CARD_NETWORK_MASTERCARD))
.build());
PaymentMethodTokenizationParameters params =
PaymentMethodTokenizationParameters.newBuilder()
.setPaymentMethodTokenizationType(
WalletConstants.PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY)
.addParameter("gateway", "ryft")
.addParameter("gatewayMerchantId", "<your_public_api_key>")
.build();
request.setPaymentMethodTokenizationParameters(params);
return request.build();
}
We do not require the billing address from the Google Pay token
Integrate With Ryft
Once you've requested and obtained a Google Pay token, you are now ready to send the payload to Ryft for processing.
Prerequisites
The first step in any integration is to create a payment session from your backend.
If you have not completed this yet then please follow the process detailed here
Take payment
Pass the token to our attempt-payment endpoint, e.g.
{
"clientSecret": "<payment_session_client_secret>",
"walletDetails": {
"type": "GooglePay",
"googlePayToken": "<token>"
}
}
Response Handling
The response is identical to that received for standard card payments.
SCA and PSD2 Compliance
Google Pay offers two authentication methods:
PAN_ONLY
- This authentication method is associated with payment cards stored on file with the user's Google Account. Returned payment data includes personal account number (PAN) with the expiration month and the expiration year.CRYPTOGRAM_3DS
- This authentication method is associated with cards stored as Android device tokens. Returned payment data includes a 3-D Secure (3DS) cryptogram generated on the device.
authMethod | SCA Compliance |
---|---|
CRYPTOGRAM_3DS | yes by default |
PAN_ONLY | No, the payment needs to pass SCA exemption or use 3DS authentication |
To enable 3DS for PAN_ONLY
payments, please contact support@ryftpay.com
Test Your Integration
Google Pay is supported in our sandbox environment, refer to the following table:
Environment | Google Pay environment |
---|---|
sandbox | WalletConstants.ENVIRONMENT_TEST |
production | WalletConstants.ENVIRONMENT_PRODUCTION |
You are safe to use any of the cards saved within your Google Pay wallet when testing your integration in our sandbox environment. Google Pay substitutes any real cards with test values to ensure no authorization takes place.