The developer.datatrans.com Developer Hub

Welcome to the developer.datatrans.com developer hub. You'll find comprehensive guides and documentation to help you start working with developer.datatrans.com as quickly as possible, as well as support if you get stuck. Let's jump right in!

Google Pay

paymentmethod=PAY

paymentmethod=PAY

Payment Process
Integration

Authorization

:heavy-check-mark+:

Payment Page*

:heavy-check-mark+:

Deferred Settlement

:heavy-check-mark+:

Split Mode

:heavy-check-mark+:

Refund

:heavy-check-mark+:

Mobile SDK

:heavy-check-mark+:

Cancel

:heavy-check-mark+:

Alias

:x+:

* Payment page integration

The Payment Page integration is only supported if a payment method selection screen is displayed. So either do not send the paymentmethod parameter at all (and have multiple payment methods active) or at minimum specify payment method Google Pay. For example: paymentmethod=PAY

Try it

Don't worry you will not be charged

Pay CHF 10.00

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 :link+:

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

Google Pay Developer Portal :link+:

Request and response parameter reference

For a more detailed description of the request and response parameters for Google Pay
please check the API Reference

Web payment flow

 1 
[Not supported by viewer]
Customer clicks Pay
Customer clicks Pay
Merchant Website
Merchant Website
Merchant Server
Merchant Server
Payment Page loaded from Datatrans
Payment Page loaded from Datatrans
Google
Google
 3 
[Not supported by viewer]
Customer selects Google Pay
[Not supported by viewer]
 2 
[Not supported by viewer]
Starts Google Pay
Starts Google Pay
User selects Method of Payment
User selects Method of Payment
Google Pay API returns encrypted Payment Data
Google Pay API returns encrypted Payment Data
Decrypts Payment Data
Decrypts Payment Data
Forwards to Acquirer 
Forwards to Acquirer 
9.1
[Not supported by viewer]
10
[Not supported by viewer]
Receives Result and Invokes merchant's
POST URL (Webhook)
[Not supported by viewer]
Receives Result 
Receives Result 
 11 
[Not supported by viewer]
Redirects customer back to merchant
Redirects customer back to merchant
Customer gets redirected to merchant page
Customer gets redirected to merchant page
Acquirer
Acquirer
Authorization
Authorization
User's Device
User's Device
 4 
[Not supported by viewer]
 5 
[Not supported by viewer]
 6 
[Not supported by viewer]
 7 
[Not supported by viewer]
 8 
[Not supported by viewer]
 9 
[Not supported by viewer]

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="1">
   <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>
 EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<authorizationService version='1'>
    <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="1">
  <body merchantId="1100016230">
    <transaction refno="1234987abc">
      <request>
        <amount>1</amount>
        <currency>CHF</currency>
        <uppTransactionId>180612091108284041</uppTransactionId>
      </request>
    </transaction>
  </body>
</paymentService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='1'>
    <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="1">
  <body merchantId="1100016230">
    <transaction refno="1234987abc">
      <request>
        <amount>1</amount>
        <currency>CHF</currency>
        <uppTransactionId>180612091108284041</uppTransactionId>
         <transtype>06</transtype>
      </request>
    </transaction>
  </body>
</paymentService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='1'>
    <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="1">
  <body merchantId="1100016230">
    <transaction refno="1234987abc">
      <request>
        <amount>1</amount>
        <currency>CHF</currency>
        <uppTransactionId>180612091108284041</uppTransactionId>
        <reqtype>DOA</reqtype>
      </request>
    </transaction>
  </body>
</paymentService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='1'>
    <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>
EOF

Status

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="3">
  <body merchantId="1100016230">
    <transaction>
      <request>
        <uppTransactionId>180612091108284041</uppTransactionId>
        <reqtype>STX</reqtype>
      </request>
    </transaction>
  </body>
</statusService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<statusService version='3'>
    <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>

Google Pay


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.