Google Pay
Integrate your own checkout with our API and allow your customers to make payments with Google Pay.
How does it work?
You make the following steps possible by using Google Pay JS API together with our CM.com Online Payments API:
- Customer opens your webshop, adds some items to the shopping basket, and clicks on 'Proceed to Checkout'.
- After initializing a Google Pay transaction with the initialize Google Pay transaction endpoint, you use the retrieved
details
to generate a Google Pay payment button (after checking that Google Pay is available for the device of the customer) on your checkout page. - The customer clicks on the Google Pay button. This will make you ask the Google payments client to load the payment data. As a result, a payment sheet will be displayed in the device of the customer, allowing them to select a card or enter a new card. When the customer has selected a card, the details are returned as payment data by the Google payments client. Within the payment data you will find the payment method data which must be sent as-is in your request to the auhorize Google Pay transaction endpoint. After the Payment is authorized the response will contain a
redirect.url
where your customer should be redirected to, making the customer to land on a CM.com Online Payments API url. - When the status of the transaction is updated in the CM.com Online Payments API, you will receive a webhook (if you configured it for your Google Pay transaction), and the customer will be redirected to the Return URL(s) you specified when you initialized your Google Pay transaction.
- You make a request to the get Google Pay transaction endpoint, and use its latest details to update your system.
When using webhooks, be aware that they are only a "best effort" mechanism. Find more details here.
Updated 3 months ago