Google Pay
Overview
This guide provides information to help you quickly integrate Google Pay™ acceptance into your web-based application. Adding Google Pay to your payment methods allows customers to use their stored Google Pay data to quickly and securely pay for goods and services.
If you want to use the Google Pay payment method, please register on wooshpay and submit the corresponding review information as required. We will arrange for corresponding technical personnel to connect with you.
How it Works
By integrating Google Pay Api into your web checkout, you enable your customers to pay quickly and securely using the payment data stored in a Google Pay wallet. Wooshpay handles the decryption and tokenization of the customer's payment data (the Google Pay response object). Integrating Google Pay enables you to provide a quick, seamless checkout experience to millions of Google Pay users.
Payment Flow
- The customer selects the Google Pay payment method on your checkout page. After entering the information, you will receive the encryption key returned to you by Google Pay.
- Pass the encrypted information you received to wooshpay's backend in the specified format, and wooshpay's backend will process the transaction for you.
- Afterwards you will receive a message returned by wooshpay, success or failure (you may need to open the challenge page in pan_only mode), and display the response information in the web page.
- Transaction ended.
Integrating Google Pay with a Web Application
To integrate Google Pay acceptance into your application, perform the steps provided in the Google Pay web API documentation, using the following supplemental information to integrate the Google Pay API and Wooshpay with your checkout:
- When you choose a payment tokenization method, do the following to connect to Wooshpay:
- For the gateway parameter replace
example
withswooshtransfer
. - For the gatewayMerchantID parameter, replace
exampleGatewayMerchantId
with your merchant ID (MID).- The Google Pay Web API includes a
MerchantInfo
object with an additionalMerchantID
parameter used to specify a Google Pay merchant identifier generated by Google when you create your Google Pay merchant account. See the Google Pay Web API documentation for more information.
- The Google Pay Web API includes a
- For the gateway parameter replace
- When you define supported payment card networks, do the following:
- For getAllowedCardNetworks, specify the card types that your merchant account is configured to accept.
- For getAllowedAuthCardMethods, specify both
PAN_ONLY
andCRYPTOGRAM_3DS
.
- When you describe your allowed payment methods, do the following:
- For cardPaymentMethod, specify the tokenizationSpecification as follows:
const cardPaymentMethod = Object.assign( {tokenizationSpecification: tokenizationSpecification}, baseCardPaymentMethod );
- For cardPaymentMethod, specify the tokenizationSpecification as follows:
- Configure your app to handle the paymentData response object.
- Please set the value of BillingAddressParameters to
FULL
. - Use Google Pay Web integration checklist to check your integrations, and use Google Pay Web Brand Guidelines to optimize your users’ experience.
Using Google pay Service with Wooshpay Checkout
This is a simple integration method, you just need to open our checkout and we will take care of the relevant details of the payment process for you.
ALLOW CARD NETWORKS:
`MASTERCARD`, `VISA`
URL:
https://api.wooshpay.com/v1/checkout/sessions
METHOD:
POST
- Request
{
"cancel_url": "https://google.com/",
"mode": "payment",
"success_url": "https://google.com/",
"payment_method_types": [
"card"
],
"line_items": [
{
"price_data": {
"currency": "USD",
"unit_amount": 100,
"product_data": {
"name": "product",
"description": "product description",
"url": "https://product-url"
}
},
"quantity": 1
}
]
}
- Response
{
"id": "cs_1721736435792347136",
"object": "checkout.session",
"created": 1699328929000,
"livemode": true,
"currency": "USD",
"customer": "",
"mode": "payment",
"status": "open",
"url": "https://checkout.wooshpay.com/pay/cs_1721736435792347136?key=cGtfbGl2ZV9OVEUyTnpZNE9EUTJOamN5TlRBek9EQTRNREF4T2s5dlEyMVNURk5uWkhORVIwY3lUbkpFUm01SmNYSnNSakUyT0RnMk16VTBNelF6TmpR",
"cancel_url": "https://google.com/",
"line_items": {
"object": "list",
"data": [
{
"id": "li_1721736435821707264",
"object": "item",
"currency": "USD",
"description": "product",
"price": {
"id": "price_1721736435834290176",
"object": "price",
"created": 1699328929000,
"livemode": true,
"active": false,
"currency": "USD",
"product": {
"id": "prod_1721736435846873088",
"object": "product",
"created": 1699328929000,
"livemode": true,
"active": false,
"description": "product description",
"name": "product",
"url": "https://product-url",
"updated": 1699328929000
},
"type": "one_time",
"unit_amount": 100,
"billing_scheme": "per_unit"
},
"quantity": 1,
"amount_subtotal": 100,
"amount_total": 100
}
]
},
"payment_intent": "pi_1721736438384427008",
"payment_method_types": [
"googlepay"
],
"payment_status": "unpaid",
"success_url": "https://google.com/",
"amount_subtotal": 100,
"amount_total": 100,
"billing_address_collection": "auto",
"expires_at": 1699415329269,
"payment_link": "",
"client_secret": "pi_1721736438384427008_secret_6VJCdXKvbyU2xtjGfljdZkbf"
}
Then open the url
parameter in the parameter structure, wait for the result notification, and update the order results in the system.
Using Google pay Service with Wooshpay Sdk
- Merchant must adhere to the Google Pay APIs Acceptable Use Policy and accept the terms defined in the Google Pay API Terms of Service.
- Our sdk only has one version. If you want to use our sdk, please contact our technical staff. The technical staff will provide you with the sdk and help you integrate it into your own web page.
Google Developer Resources
Google Pay provides APIs for both Android and web applications, and comprehensive developer documentation for each version of the API. The specific Google Pay API integration details depend on the type of application you are developing.
See the following resources for detailed Google Pay API integration details: