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!

paymentmethod=TWI

paymentmethod=TWI

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
(Mobile SDKs or web registration)

:heavy-check-mark+:

Try it

Don't worry you will not be charged.

Pay CHF 10.00

Description

With the TWINT app, you can make payments easily and conveniently: in online shops, at supermarket cash registers, in canteens and at vending machines. With TWINT, you can transfer money in real time – easily from smartphone to smartphone. And you can also request and receive money from friends and family.

Datatrans gives you with the option to integrate TWINT in your web shop and in your native mobile applications. Additionally, Datatrans supports the tokenization of TWINT - User on File.

Payment Method provider website :link+:

Testing

To test TWINT, you will need to download a test app and go through the registration process again. Using the productive TWINT app will not allow you to test TWINT payments. You can open the following links to download the so-called 'TWINT Configurator' and finally the test application:
Configurator Android: dtrx.ch/twint-android :link+:
Configurator iOS: dtrx.ch/twint-ios :link+:

Please select the PAT environment for your tests via Datatrans. To top up your test account you will require voucher codes that are available on request.

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
Twint
Twint
 3 
[Not supported by viewer]
Customer selects Twint
[Not supported by viewer]
 2 
[Not supported by viewer]
 4 
[Not supported by viewer]
Request for Token and QR Code
Request for Token and QR Code
Validates and creates Transaction; returns QR Code and Token
[Not supported by viewer]
Displays QR Token / Waiting Page
Displays QR Token / Waiting Page
Monitors transaction status
Monitors transaction status
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
Returns Status of transaction
Returns Status of transaction
User's Device
User's Device
 7 
[Not supported by viewer]
Confirms Transaction
Confirms Transaction
 8 
[Not supported by viewer]
 9 
[Not supported by viewer]
 5 
[Not supported by viewer]
 6 
[Not supported by viewer]

Server to Server API calls

After a transactionId or alias 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

Is only possible through the web interface.

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>180816161546585482</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>850</amount>
                <currency>CHF</currency>
                <uppTransactionId>180816161546585482</uppTransactionId>
                <reqtype>COA</reqtype>
                <transtype>05</transtype>
            </request>
            <response>
                <responseCode>01</responseCode>
                <responseMessage>settlement succeeded</responseMessage>
            </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="91827364">
      <request>
        <amount>850</amount>
        <currency>CHF</currency>
        <uppTransactionId>180816162031057241</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='91827364' trxStatus='response'>
            <request>
                <amount>850</amount>
                <currency>CHF</currency>
                <uppTransactionId>180816162031057241</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>180816162031057241</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>180816162031057241</uppTransactionId>
                <reqtype>STX</reqtype>
            </request>
            <response itemNr='1'>
                <responseCode>7</responseCode>
                <responseMessage>MOA Cancel</responseMessage>
                <refno>91827364</refno>
                <amount>850</amount>
                <currency>CHF</currency>
                <authorizationCode>945407288</authorizationCode>
                <pmethod>TWI</pmethod>
                <uppTransactionId>180816162031057241</uppTransactionId>
                <maskedCC></maskedCC>
                <aliasCC></aliasCC>
                <expm></expm>
                <expy></expy>
                <trxDate>20180816</trxDate>
                <trxTime>162031</trxTime>
                <trtype>05</trtype>
            </response>
        </transaction>
    </body>
</statusService>

Updated 2 months ago

Twint


Suggested Edits are limited on API Reference Pages

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