Please see the guidance below:
For Payment Pages, JavaScript or Mobile SDK integrations
If you're developing Payouts for Google Pay for integrations using our hosted Payment Pages or JavaScript solutions, you can only process payouts using a parenttransactionreference value from a previous transaction.
Submit a REFUND request including the parenttransactionreference of a previous transaction from which you want to inherit the Google Pay card account information.
#!/usr/bin/python
import securetrading
stconfig = securetrading.Config()
stconfig.username = "webservices@example.com"
stconfig.password = "Password1^"
st = securetrading.Api(stconfig)
payout= {
"accounttypedescription": "CFT",
"baseamount": "1",
"currencyiso3a": "GBP",
"parenttransactionreference": "1-2-345678",
"requesttypedescriptions": ["REFUND"],
"sitereference": "site12346"
}
strequest = securetrading.Request()
strequest.update(payout)
stresponse = st.process(strequest) #stresponse contains the transaction response
<?php
if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) {
throw new Exception('Composer autoloader file could not be found.');
}
require_once($autoload);
$configData = array(
'username' => 'webservices@example.com',
'password' => 'Password1^',
);
$requestData = array(
'accounttypedescription' => 'CFT',
'baseamount' => '1',
'currencyiso3a' => 'GBP',
'parenttransactionreference' => '1-2-345678',
'requesttypedescriptions' => array('REFUND'),
'sitereference' => 'site12346'
);
$api = \Securetrading\api($configData);
$response = $api->process($requestData);
var_dump($response->toArray());
?>
curl --user webservices@example.com:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{
"alias": "webservices@example.com",
"version": "1.00",
"request": [{
"accounttypedescription": "CFT",
"baseamount": "1",
"currencyiso3a": "GBP",
"parenttransactionreference": "1-2-345678",
"requesttypedescriptions": ["REFUND"],
"sitereference": "site12346"
}]
}'
{
"alias":"webservices@example.com",
"version":"1.00",
"request":[{
"accounttypedescription":"CFT",
"baseamount":"1",
"currencyiso3a":"GBP",
"parenttransactionreference": "1-2-345678",
"requesttypedescriptions":["REFUND"],
"sitereference":"site12346"
}]
}
<requestblock version="3.67">
<alias>webservices@example.com</alias>
<request type="REFUND">
<billing>
<amount currencycode="GBP">1</amount>
</billing>
<operation>
<accounttypedescription>CFT</accounttypedescription>
<parenttransactionreference>1-2-345678</parenttransactionreference>
<sitereference>site12346</sitereference>
</operation>
</request>
</requestblock>
Replace <DOMAIN> with a supported domain. View full domain list.
If the payout is declined, this may be due to the Google Pay token referenced in your request being deleted or updated. In this scenario:
- Process a new payment or account check to re-capture the cardholder's Google Pay details.
- Obtain the new transactionreference from the response.
- Submit a new payout request using this transactionreference as the parenttransactionreference.
If the payout is still declined, the cardholder should contact their card issuer for support.
For API integrations with Google Pay direct
If you're developing Payouts for integrations that processes transactions with Google Pay directly, please follow the guidance below:
Payment details from the Google Pay response:
-
pan
Mapped from:
encryptedMessage ≫ paymentMethodDetails ≫ pan -
expirydate
Mapped from:
encryptedMessage ≫ paymentMethodDetails ≫ expirationMonth/expirationYear -
walletdisplayname
Mapped from:
paymentMethodData ≫ info
If you intend to capture the customer's billing and delivery details from their Google Wallet, you will also need to parse the response from the Google API for these fields and map these to the appropriate fields in the subsequent request.
Request example
#!/usr/bin/python
import securetrading
stconfig = securetrading.Config()
stconfig.username = "webservices@example.com"
stconfig.password = "Password1^"
st = securetrading.Api(stconfig)
auth = {
"accounttypedescription":"CFT",
"baseamount":"2000",
"currencyiso3a":"GBP",
"expirydate":"07/2026",
"pan":"5100000000000511",
"requesttypedescriptions": ["REFUND"],
"sitereference": "test_site12345",
"walletdisplayname":"MasterCard 0511",
"orderreference":"My_Order_123",
"walletsource":"GOOGLEPAY"
}
strequest = securetrading.Request()
strequest.update(auth)
stresponse = st.process(strequest) #stresponse contains the transaction response
<?php
if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) {
throw new Exception('Composer autoloader file could not be found.');
}
require_once($autoload);
$configData = array(
'username' => 'webservices@example.com',
'password' => 'Password1^',
);
$requestData = array(
'accounttypedescription' => 'CFT',
'baseamount' => '2000',
'currencyiso3a' => 'GBP',
'expirydate' => '07/2026',
'pan' => '5100000000000511',
'requesttypedescriptions' => ["REFUND"],
'sitereference' => 'test_site12345',
'walletdisplayname' => 'MasterCard 0511',
'orderreference' => 'My_Order_123',
'walletsource' => 'GOOGLEPAY'
);
$api = \Securetrading\api($configData);
$response = $api->process($requestData);
var_dump($response->toArray());
?>
curl --user webservices@example.com:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{
"alias":"webservices@example.com",
"version": "1.00",
"request": [{
"accounttypedescription":"CFT",
"baseamount":"2000",
"currencyiso3a":"GBP",
"expirydate":"07/2026",
"pan":"5100000000000511",
"requesttypedescriptions":["REFUND"],
"sitereference": "test_site12345",
"walletdisplayname":"MasterCard 0511",
"orderreference":"My_Order_123",
"walletsource":"GOOGLEPAY"
}]
}'
{
"alias":"webservices@example.com",
"version":"1.00",
"request":[{
"accounttypedescription":"CFT",
"baseamount":"2000",
"currencyiso3a":"GBP",
"expirydate":"07/2026",
"pan":"5100000000000511",
"requesttypedescriptions":["REFUND"],
"sitereference": "test_site12345",
"walletdisplayname":"MasterCard 0511",
"orderreference":"My_Order_123",
"walletsource":"GOOGLEPAY"
}]
}
<requestblock version="3.67">
<alias>webservices@example.com</alias>
<request type="REFUND">
<billing>
<payment>
<expirydate>07/2026</expirydate>
<pan>5100000000000511</pan>
<wallet>
<displayname>MasterCard 0511</displayname>
<source>GOOGLEPAY</source>
</wallet>
</payment>
<amount currencycode="GBP">2000</amount>
</billing>
<merchant>
<orderreference>My_Order_123</orderreference>
</merchant>
<operation>
<sitereference>test_site12345</sitereference>
<accounttypedescription>CFT</accounttypedescription>
</operation>
</request>
</requestblock>
If the payout is declined, the cardholder should contact their card issuer for support.
Useful resources
If CRYPTOGRAM_3DS is returned in the authMethod, you don't need to perform 3-D secure authentication.
Following the response from Google Pay, you should be in possession of the fields listed below, which are required in the subsequent request:
Payment details from the Google Pay response:
-
pan
Mapped from:
encryptedMessage ≫ paymentMethodDetails ≫ pan -
expirydate
Mapped from:
encryptedMessage ≫ paymentMethodDetails ≫ expirationMonth/expirationYear -
walletdisplayname
Mapped from:
paymentMethodData ≫ info -
tavv
Mapped from:
encryptedMessage ≫ paymentMethodDetails ≫ cryptogram -
eci
Mapped from:
encryptedMessage ≫ paymentMethodDetails ≫ eciIndicator
If you intend to capture the customer's billing and delivery details from their Google Wallet, you will also need to parse the response from the Google API for these fields and map these to the appropriate fields in the subsequent request.
Request example
#!/usr/bin/python
import securetrading
stconfig = securetrading.Config()
stconfig.username = "webservices@example.com"
stconfig.password = "Password1^"
st = securetrading.Api(stconfig)
auth = {
"accounttypedescription":"CFT",
"baseamount":"2000",
"currencyiso3a":"GBP",
"eci":"2",
"expirydate":"07/2026",
"pan":"5100000000000511",
"requesttypedescriptions": ["REFUND"],
"sitereference":"test_site12345",
"tavv":"ALFoEd4DhmGzAIj3dUo4AoABFA==",
"tokenisedpayment":"1",
"tokentype":"GOOGLEPAY",
"walletdisplayname":"MasterCard 0511",
"walletsource":"GOOGLEPAY"
}
strequest = securetrading.Request()
strequest.update(auth)
stresponse = st.process(strequest) #stresponse contains the transaction response
<?php
if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) {
throw new Exception('Composer autoloader file could not be found.');
}
require_once($autoload);
$configData = array(
'username' => 'webservices@example.com',
'password' => 'Password1^',
);
$requestData = array(
'accounttypedescription' => 'CFT',
'baseamount' => '2000',
'currencyiso3a' => 'GBP',
'eci' => '2',
'expirydate' => '07/2026',
'orderreference' => 'My_Order_123',
'pan' => '5100000000000511',
'requesttypedescriptions' => array('REFUND'),
'sitereference' => 'test_site12345',
'tavv' => 'ALFoEd4DhmGzAIj3dUo4AoABFA==',
'tokenisedpayment' => '1',
'tokentype' => 'GOOGLEPAY',
'walletdisplayname' => 'MasterCard 0511',
'walletsource' => 'GOOGLEPAY'
);
$api = \Securetrading\api($configData);
$response = $api->process($requestData);
var_dump($response->toArray());
?>
curl --user webservices@example.com:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{
"alias":"webservices@example.com",
"version": "1.00",
"request": [{
"accounttypedescription":"CFT",
"baseamount":"2000",
"currencyiso3a":"GBP",
"eci":"2",
"expirydate":"07/2026",
"orderreference": "My_Order_123",
"pan":"5100000000000511",
"requesttypedescriptions": ["REFUND"],
"sitereference": "test_site12345",
"tavv":"ALFoEd4DhmGzAIj3dUo4AoABFA==",
"tokenisedpayment":"1",
"tokentype":"GOOGLEPAY",
"walletdisplayname":"MasterCard 0511",
"walletsource":"GOOGLEPAY"
}]
}'
{
"alias":"webservices@example.com",
"version":"1.00",
"request":[{
"accounttypedescription":"CFT",
"baseamount":"2000",
"currencyiso3a":"GBP",
"eci":"2",
"expirydate":"07/2026",
"orderreference": "My_Order_123",
"pan":"5100000000000511",
"requesttypedescriptions": ["REFUND"],
"sitereference": "test_site12345",
"tavv":"ALFoEd4DhmGzAIj3dUo4AoABFA==",
"tokenisedpayment":"1",
"tokentype":"GOOGLEPAY",
"walletdisplayname":"MasterCard 0511",
"walletsource":"GOOGLEPAY"
}]
}
<requestblock version="3.67">
<alias>webservices@example.com</alias>
<request type="REFUND">
<billing>
<payment>
<expirydate>07/2026</expirydate>
<pan tokenised="1" tokentype="GOOGLEPAY">5100000000000511</pan>
<wallet>
<displayname>MasterCard 0511</displayname>
<source>GOOGLEPAY</source>
</wallet>
</payment>
<amount currencycode="GBP">2000</amount>
</billing>
<merchant>
<orderreference>My_Order_123</orderreference>
</merchant>
<operation>
<sitereference>test_site12345</sitereference>
<accounttypedescription>CFT</accounttypedescription>
</operation>
<threedsecure>
<eci>2</eci>
<tavv>ALFoEd4DhmGzAIj3dUo4AoABFA==</tavv>
</threedsecure>
</request>
</requestblock>
If the payout is declined, the cardholder should contact their card issuer for support.