Google Pay™
This scenario describes how to perform a payment to a bank card via Google Pay. To use this scenario, integrate Google Pay into your website or application
Step 1. Get a payment token from Google Pay
- A user forms an order on your website or application.
- The user selects Google Pay as a payment method.
- The user selects one of his saved cards or enters details of a new one.
- The user clicks Pay.
- Google passes you a token.
Step 2. Start a payment session
Send the session/init/payment
request to start a payment session. In the payment_details.type
filed specify the secured_card
value. In the secured_card
object pass the data needed to process the payment.
Request headers should be used to pass your project identifier and the request's signature.
Request example: session creation with simultaneous payment initiation
--header 'X-PARTNER-SIGN: key' \
--header 'X-PARTNER-PROJECT: shop1' \
--header 'Content-Type: application/json' \
--data-raw '{
"payment_details": {
"type": "secured_card",
"secured_card": {
"type": "google_pay",
"google_pay": {
"token": "{\"signature\":
\"MEgKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwbcg\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"118716\\\"}\",\"signatures\":[\"MEQCIw\\u003d\\u003d\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"wkJmz3OvO4\\\\u003d\\\"}\"}"
}
}
},
"amount_details":{
"amount": 100,
"currency": "rub"
},
"metadata": {
"key": "value"
},
"customer":{
"reference":"lucky"
}
}'
Step 3. 3-D Secure
If the user's card requires 3D Secure, Bank 131 will send you the webhook action_required
with redirection details. Redirect the user to the address that will be specified in the field customer_interaction.redirect.url
.
Step 4. Learn the payment result
Wait for the webhook payment_finished
or request the payment status using the method session/status
.
The result of the payment can be found in the payment.status
field.
If the status is succeeded
, then the payment has been successful. If the status is failed
, then the payment has not been completed because of an error.
All done, the payment has been performed.