Payment Method Google Pay¶
You can allow customers to pay quicker with cards stored on their Google Pay accounts. Combine our solutions and the Google suggestion to enable secure, one-touch payments in your stores for all devices (smartphones and PCs), irrespective of the operating systems and web browsers.
Google Pay™ is an instant payment that allows quick and easy card transaction without having to input your payment data each time. You reduce customers’ time to buy and make them far less likely to drop their carts. And you can be sure that their sensitive card data is securely stored by Google.
Google Pay and Google Play are trademarks of Google LLC.
Implementing Google Pay with the Corefy HPP¶
How to set up¶
- Sign a contract with Corefy.
- Review and agree with Google Pay Terms of Service and Acceptable Use Policy.
- Inform your Corefy account manager about.
That's all! We integrate the Google Pay button to the Hosted Payment Page for you. Thus you can create a payment invoice from the Dashboard or via the API and start processing Google Pay transactions through Corefy.
How it works¶
- You request the customer payment data from your application/checkout page.
- You send the invoice request to Corefy, and we respond with the HPP redirect form.
- The Hosted Payment Page displays available payment methods to the customer, including Google Pay option.
- Google Pay authenticates the customer and returns their encrypted data.
- We decrypt received payment data.
- We create the purchase request and transfer the card data to the payment service provider (PSP) or bank acquirer service to complete the transaction and obtain a payment response.
- The acquirer can request an additional user verification step by passing a 3DS or OTP test; in that case, the customer gets the verification page from the issuer.
- We get the response value received from the issuer 3DS service and finalize the transaction.
- We send a Callback message to the application back-end; if the Callback URL is not set, we expect a status request from your server.
- You inform the customer about the result.
Implementing Google Pay directly through the API¶
Before you start¶
Be aware
Your site should run on the HTTPS scheme and support the TLS 1.2 protocol.
To integrate Google Pay into your Android application, check the links below:
- Google Pay Android developer documentation
- Google Pay Android integration checklist
- Google Pay Android brand guidelines
To integrate Google Pay into your website, review the following links:
- Google Pay Web developer documentation
- Google Pay Web integration checklist
- Google Pay Web brand guidelines
Get verified: send mobile app (.apk) or link to your site with the payment page.
How the direct integration works¶
- You request the customer payment data from your application/checkout page.
- Your application displays available payment methods to the customer, including Google Pay option.
- You request the encrypted payment data from your application, and Google Pay authenticates the customer.
- You handle the received payment data and send to your server.
- The application back-end transfers the encrypted data to card gateway Corefy with the invoice request to the Commerce API, and we respond with the invoice ID and the invoice status
created
. - We decrypt the payment data, create the purchase request, and transfer the card data to the payment service provider (PSP) or bank acquirer service to complete the transaction and obtain a payment response.
- The acquirer can request an additional user verification step by passing a 3DS or OTP test.
- We send to your application back-end the ACS redirect form.
- You display the ACS or OTP to the customer.
- We get the response value received from the issuer 3DS service.
- We request the payment status from the acquirer and finalize the transaction.
- We send a Callback message to the application back-end; if the Callback URL is not set, we expect a status request from your server.
- You inform the customer about the result.
How to integrate the Google Pay method¶
The overall transaction flow is similar to the standard Google Pay process. Corefy receives the encrypted Google Pay payload from your application and is responsible for decrypting the payment token and transferring the purchase data to a chosen gateway.
-
Make sure that you complete preparations from the previous section. Use Google Pay API to get a paymentData.
-
As script parameters specify:
- Available payment methods:
var allowedPaymentMethods = ['CARD']
- Tokenization type:
"tokenizationType": "PAYMENT_GATEWAY"
- Allowed card networks:
"allowedCardNetworks": ["MASTERCARD", "VISA"]
- Allowed authorization methods:
"allowedAuthMethods": "["PAN_ONLY", "CRYPTOGRAM_3DS"]"
- Gateway parameter:
paycoreio
- Your Google merchant ID
- And gateway merchant ID parameter → your unique account ID
The Customer's billing address is not required for the Corefy Google Pay API requests.
If your integration works properly, you will receive a Google Pay button on the payment page. The pop-up window or the additional card selection form will appear after pressing the button on the device with the Google Pay connected. And after customer selecting the card, you will get the data set with PaymentData.
The PaymentData item (JSON)
{ "apiVersionMinor":0, "apiVersion":2, "paymentMethodData":{ "description":"Mastercard •••• 1111", "tokenizationData":{ "type":"PAYMENT_GATEWAY", "token":"{\"signature\":\"MEQCIBjQhjaZB76j...d}" } }, "type":"CARD", "info":{ "cardNetwork":"MASTERCARD", "cardDetails":"1111" } }
- Available payment methods:
-
To initiate a Google Pay transaction, send request with the Google Pay gateway parameters and a JSON-formatted Payment Token encoded using Base64 function.
token
allows you initiate verify or charge flow transferring it to the Google Pay.Endpoint:
https://cardgate.paycore.io/payment/sale
Method: POST
JSON
{ "data":{ "type":"sale-operation", "attributes":{ "google_pay":{ "apiVersionMinor":0, "apiVersion":2, "paymentMethodData":{ "description":"Mastercard •••• 1111", "tokenizationData":{ "type":"PAYMENT_GATEWAY", "token":"{\"signature\":\"MEQCIBjQhjaZB76j...d}" } }, "type":"CARD", "info":{ "cardNetwork":"MASTERCARD", "cardDetails":"1111" } } } } }
{ "data":{ "id":"cgi_7U4hCiGtMAaGJnwN", "attributes":{ "amount":10, "currency":"USD", "description": "Payment Example", "service":"googlepay", "options":{}, "customer":{ "reference_id": "customer1" }, "repeatable":true, "flow":"charge", "status":"process_pending", "resolution":"ok", "active_request":{ "status":"process_pending", "resolution":"ok" }, "active_payment":{ "status":"authorize_required", "resolution":"ok" }, "auto_repay":false, "metadata":{ "fee":"0.00", "fee_strategy":"external" }, "form_data":{ "gateway":"paycoreio", "google_merchant_id":"014****68", "gateway_merchant_id":"coma_3****51" } }, "payment":{ "fee":"0.00", "feeStrategy":"external" } } }
-
If payment status requires 3DS-verification, you should redirect the customer to the issuing bank ACS page (
action
). Send POST request includingPaReq
(Payer Authentication Request), andMD
(Merchant Data) parameters and Return URL to return the customer after 3D Secure (TermUrl
) for 3ds 1.0 orcreq
(Challenge Request Message) for 3DS 2.0.Responses
{ "auth_payload":{ "action":"https://acs.pay_domain/acspage/cap?RID=8\u0026VAA=A", "method":"POST", "params":{ "MD":"999999999", "PaReq":"eJxVUlFvVA2jYv2jAQfuZfoD5v2E5KfQlLFJ2jAQfuZfoD5v2E5KQqurpe5os5wRBJU6dZCX79bszlDIrUe6+zWRkwjEe0qVHL3dmbqjeATGvs6XKz2Np1GBFSxq3r684PeiZvQbwnXOj9i951XdPeC4HWHT5bV1v+3z29+Vgs/OIi+9oe48acmxbs8VxVT7cFNkaX3+raapimUYqiZPbGz2CAOvRCP6gbytXany0njnTX07Y3Ii6VYY9u64EQNFz3J5OPlalzjc/4nyTv63+Lo+rfR6tFtlbfnofQDCDmaXpUEdS3SmcbXhU7MLJSwQ12gwovceazvouxlVLxmX8EgKkXeDuMSs7UoPPH47/yLbkeV+MU3SeTqst8PT5mfi9m5WZtmv+eMzCzuTzr0rcpzulYTmVbAfBLejA8KAsIlhlij6b8b+AbaDvJg=", "TermUrl":"your.pay_domain/\/complete-auth?pid=pay_gcRU0PhWvBCz2dabWNpLu1Q3_qK_ly" } } }
{ "auth_payload": { "action": "https://acs.pay_domain/acspage/challenge?id=0c95e0873", "method": "POST", "params": { "creq": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjBjOTNhNWFhLTUyNzAtMzhiNi04ZGQ4LWY5Mjc5MTVlMDg3MyIsImFjc1RyYW5zSUQiOiIyYjVkNzIyYi0yNjk2LTRhOTktYTcxZS1iZjYwYmI5MzlmNTgiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMS4wIn0=" } } }
-
The response from Corefy will contain the transaction result.
Looking for help connecting the Google Pay method via Corefy?