Google Pay
paymentmethod=PAY
Payment Process | Integration | ||
|---|---|---|---|
Authorization | ✔️ | Payment Page* | ✔️ |
Deferred Settlement | ✔️ | Split Mode | ✔️ |
Refund | ✔️ | Mobile SDK | ✔️ |
Cancel | ✔️ | ||
Alias | ❌ |
* Payment page integrationThe Payment Page integration is only supported if a payment method selection screen is displayed. So either do not send the
paymentmethodparameter at all (and have multiple payment methods active) or at minimum specify payment method Google Pay. For example:paymentmethod=PAY
Description
Google Pay is a payment platform that can be used across devices with a Google-Account. It enables merchants to offer a better and faster checkout experience for their clients. Google Pay supports NFC (card present), in-app purchases for card not present and browser based shop solutions (Google Pay Web).Datatrans supports Google Pay on the web and through our XML-APIs.
Checkout our Github-sample to find out more on implementation details and testing.
Payment Method provider website 🔗
Payment Setup
Since Google Pay is a wallet for payment methods your Datatrans setup needs to be set up to process the contained payment methods
Resources
Request and response parameter referenceFor a more detailed description of the request and response parameters for Google Pay
please check the API Reference
Web payment flow
Server to Server API calls
After a transactionId was received by completing the payment flow on the web, the following server to server API calls can be used to do other actions.
Authorization
Request
curl -v -X POST https://api.sandbox.datatrans.com/upp/jsp/XML_authorize.jsp \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d @- << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<authorizationService version="5">
<body merchantId="1100016230">
<transaction refno="1234987abc">
<request>
<googlePayData><![CDATA[{"signature":"MEQCIHvzDvEf3sBGPOe8Naz0rEjAqv0nMgoypEnZMaTb5S72AiB4fRdyg1ZI0IE3mDBfC2VPZfZhL8n8a5kewlsiGVCYIw==","protocolVersion":"ECv1","signedMessage":"{\"encryptedMessage\":\"6JPqz2lG1v3Mdxgz3h+YFev3H82c0zx7hRD8QNx/ndUG2Ea0XafL+Sc5ZC38HMVJl8TFx3OqbfuOiPEg9O8F/h0NyoP7DQ8gcbrvYShcUWbzH7IWPLZdHuhFA4VY9XHhTDNHuHHKwzm1We8zdHaIShy0Elb9gMbRI4LqxFoPdoJEmCo5zHGCV7obdB6GU4Oc9RiFUSHLGJJZQzqWhinF2PW6G2aGD0u8ATa+e9OdSeKt6RtSGvR9wqwKNW8/Fu3PTDG85m6g99a7gFHXPUzuatMqfqZUD7ffXbgrWKmTEYPmQhIXzNKcMedMZEkqcuc7SahacRupOMO9HyBorF65HN0+sw76p6X/2mkJCG4+VG5fNUM79mMYTXStG2tnobbJLK85nUOMiah4O7xToJw8mwc082LBeF40PhxE0lYjUC37zXEU59dssBgmaJbwy9MtYFnMZaA\\u003d\",\"ephemeralPublicKey\":\"BPpTdtcZ4clFbPrHJt0JtYKiJvuWCBdVWazFwwNJk/3+0bPD8veVrptUnWmkoUMtT7yCw1sAAm55vXKRCI8gyBA\\u003d\",\"tag\":\"pETHSV0SkGsXLEOuuvyLXP16jwMLJhfrGWvAHTz36UY\\u003d\"}"}]]></googlePayData>
<sign>1523525497706</sign>
<amount>1</amount>
<currency>CHF</currency>
</request>
</transaction>
</body>
</authorizationService>
EOFResponse
<?xml version='1.0' encoding='UTF-8'?>
<authorizationService version='5'>
<body merchantId='1100016230' status='accepted'>
<transaction refno='1234987abc' trxStatus='response'>
<request>
<googlePayData>
<![CDATA[{"signature":"MEQCIHvzDvEf3sBGPOe8Naz0rEjAqv0nMgoypEnZMaTb5S72AiB4fRdyg1ZI0IE3mDBfC2VPZfZhL8n8a5kewlsiGVCYIw==","protocolVersion":"ECv1","signedMessage":"{\"encryptedMessage\":\"6JPqz2lG1v3Mdxgz3h+YFev3H82c0zx7hRD8QNx/ndUG2Ea0XafL+Sc5ZC38HMVJl8TFx3OqbfuOiPEg9O8F/h0NyoP7DQ8gcbrvYShcUWbzH7IWPLZdHuhFA4VY9XHhTDNHuHHKwzm1We8zdHaIShy0Elb9gMbRI4LqxFoPdoJEmCo5zHGCV7obdB6GU4Oc9RiFUSHLGJJZQzqWhinF2PW6G2aGD0u8ATa+e9OdSeKt6RtSGvR9wqwKNW8/Fu3PTDG85m6g99a7gFHXPUzuatMqfqZUD7ffXbgrWKmTEYPmQhIXzNKcMedMZEkqcuc7SahacRupOMO9HyBorF65HN0+sw76p6X/2mkJCG4+VG5fNUM79mMYTXStG2tnobbJLK85nUOMiah4O7xToJw8mwc082LBeF40PhxE0lYjUC37zXEU59dssBgmaJbwy9MtYFnMZaA\\u003d\",\"ephemeralPublicKey\":\"BPpTdtcZ4clFbPrHJt0JtYKiJvuWCBdVWazFwwNJk/3+0bPD8veVrptUnWmkoUMtT7yCw1sAAm55vXKRCI8gyBA\\u003d\",\"tag\":\"pETHSV0SkGsXLEOuuvyLXP16jwMLJhfrGWvAHTz36UY\\u003d\"}"}]]>
</googlePayData>
<reqtype>NOA</reqtype>
<transtype>05</transtype>
<sign>1523525497706</sign>
<amount>1</amount>
<currency>CHF</currency>
</request>
<response>
<responseCode>01</responseCode>
<responseMessage>Authorized</responseMessage>
<uppTransactionId>180612091108284041</uppTransactionId>
<authorizationCode>108344042</authorizationCode>
<acqAuthorizationCode>091108</acqAuthorizationCode>
<returnCustomerCountry>GBR</returnCustomerCountry>
<aliasCC>424242SKMPRI4242</aliasCC>
<expy>21</expy>
<expm>12</expm>
</response>
</transaction>
</body>
</authorizationService>Settlement
Request
curl -v -X POST https://api.sandbox.datatrans.com/upp/jsp/XML_processor.jsp \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d @- << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<paymentService version="2">
<body merchantId="1100016230">
<transaction refno="1234987abc">
<request>
<amount>1</amount>
<currency>CHF</currency>
<uppTransactionId>180612091108284041</uppTransactionId>
</request>
</transaction>
</body>
</paymentService>
EOFResponse
<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='2'>
<body merchantId='1100016230' status='accepted'>
<transaction refno='1234987abc' trxStatus='response'>
<request>
<amount>1</amount>
<currency>CHF</currency>
<uppTransactionId>180612091108284041</uppTransactionId>
<reqtype>COA</reqtype>
<transtype>05</transtype>
</request>
<response>
<responseCode>01</responseCode>
<responseMessage>settlement succeeded</responseMessage>
</response>
</transaction>
</body>
</paymentService>Credit
Request
curl -v -X POST https://api.sandbox.datatrans.com/upp/jsp/XML_processor.jsp \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d @- << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<paymentService version="2">
<body merchantId="1100016230">
<transaction refno="1234987abc">
<request>
<amount>1</amount>
<currency>CHF</currency>
<uppTransactionId>180612091108284041</uppTransactionId>
<transtype>06</transtype>
</request>
</transaction>
</body>
</paymentService>
EOFResponse
<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='2'>
<body merchantId='1100016230' status='accepted'>
<transaction refno='1234987abc' trxStatus='response'>
<request>
<amount>1</amount>
<currency>CHF</currency>
<uppTransactionId>180612091108284041</uppTransactionId>
<transtype>06</transtype>
<reqtype>COA</reqtype>
</request>
<response>
<responseCode>01</responseCode>
<responseMessage>credit succeeded</responseMessage>
<uppTransactionId>180612092430899748</uppTransactionId>
<authorizationCode>430939749</authorizationCode>
<acqAuthorizationCode>092430</acqAuthorizationCode>
</response>
</transaction>
</body>
</paymentService>Cancel
Request
curl -v -X POST https://api.sandbox.datatrans.com/upp/jsp/XML_processor.jsp \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d @- << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<paymentService version="2">
<body merchantId="1100016230">
<transaction refno="1234987abc">
<request>
<amount>1</amount>
<currency>CHF</currency>
<uppTransactionId>180612091108284041</uppTransactionId>
<reqtype>DOA</reqtype>
</request>
</transaction>
</body>
</paymentService>
EOFResponse
<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='2'>
<body merchantId='1100016230' status='accepted'>
<transaction refno='1234987abc' trxStatus='response'>
<request>
<amount>1</amount>
<currency>CHF</currency>
<uppTransactionId>180612091108284041</uppTransactionId>
<reqtype>DOA</reqtype>
<transtype>05</transtype>
</request>
<response>
<responseCode>01</responseCode>
<responseMessage>cancellation succeeded</responseMessage>
</response>
</transaction>
</body>
</paymentService>
EOFStatus
Request
curl -v -X POST https://api.sandbox.datatrans.com/upp/jsp/XML_status.jsp \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d @- << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<statusService version="5">
<body merchantId="1100016230">
<transaction>
<request>
<uppTransactionId>180612091108284041</uppTransactionId>
<reqtype>STX</reqtype>
</request>
</transaction>
</body>
</statusService>
EOFResponse
<?xml version='1.0' encoding='UTF-8'?>
<statusService version='5'>
<body merchantId='1100016230' status='accepted'>
<transaction trxStatus='response'>
<request>
<uppTransactionId>180612091108284041</uppTransactionId>
<reqtype>STX</reqtype>
</request>
<response itemNr='1'>
<responseCode>6</responseCode>
<responseMessage>DOA Cancel</responseMessage>
<refno>1234987abc</refno>
<amount>1</amount>
<currency>CHF</currency>
<authorizationCode>108344042</authorizationCode>
<pmethod>VIS</pmethod>
<uppTransactionId>180612091108284041</uppTransactionId>
<maskedCC>424242xxxxxx4242</maskedCC>
<aliasCC></aliasCC>
<expm>12</expm>
<expy>21</expy>
<trxDate>20180612</trxDate>
<trxTime>091108</trxTime>
<trtype>05</trtype>
<settledAmount>1</settledAmount>
</response>
</transaction>
</body>
</statusService>Updated 6 days ago