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!

Apple Pay

paymentmethod=APL

paymentmethod=APL

Payment process
Integration

Authorisation

:heavy-check-mark+:

Payment Page

:x+:

Deferred settlements

:heavy-check-mark+:

Split Mode

:heavy-check-mark+:

Cancel

:heavy-check-mark+:

Mobile SDK

:heavy-check-mark+:

Refund

:heavy-check-mark+:

Alias

:x+:

Try it

Apple Pay Web

Description

Apple Pay is the payment system for Apple products like iPhone, iPad, MacBook Pro with Touchbar and Apple Watch.

Apple Pay supports NFC (card present), in-app purchases for card not present (a native iOS app is required) and browser based shop solutions (Apple Pay Web).
The Datatrans Payment Libraries support Apple Pay for in-app purchases on iOS apps. An updated SDK is now available for interested merchants. You can find the technical details in our iOS developers manual.

For Apple Pay web please refer to our sample app on Github. For the client side integration please check out the guide from Apple directly.

Payment Method provider website :link+:

Prerequisites

Creating a payment processing certificate

As an existing customer please login to our Datatrans Webadmin Tool](https://admin.sandbox.datatrans.com/) (navigate to 'UPP Administration' > 'UPP Security' > 'Apple Pay key and certificate') to obtain the CSR needed to create a payment processing certificate on developer.apple.com. This certificate is needed for both, Apple Pay for native Apps and Apple Pay on the Web. Once created, upload it again on our Backoffice tool and you should be ready to process Apple Pay transactions.

Payment Setup

Since Apple Pay is a wallet for payment methods your Datatrans setup needs to be set up to process the contained payment methods

Resources

Datatrans Apple Pay Web Sample

Payment Flow (Apple Pay Web)

 1 
[Not supported by viewer]
Merchant collects payment through ApplePay API's
Merchant collects payment through ApplePay API's
Merchant Website
Merchant Website
Merchant Server
Merchant Server
Merchant submits Apple Pay token to Datatrans through XML API's
[Not supported by viewer]
 3 
[Not supported by viewer]
Decrypts token with merchants provided key
[Not supported by viewer]
Forwards payment data to Acquirer 
Forwards payment data to Acquirer 
 6 
[Not supported by viewer]
Returns Authorization Result 
Returns Authorization Result 
Receives Result 
Receives Result 
Acquirer
Acquirer
Authorization
Authorization
 4 
[Not supported by viewer]
 5 
[Not supported by viewer]
Text
Text
 2 
[Not supported by viewer]
Displays Success / Error Page of Payment
Displays Success / Error Page of Payment
 7 
[Not supported by viewer]

Server to Server API calls

After initialy receiveing the transactionId by completing the payment flow on the web, the following server to server API calls can be used to do other actions. (Except for the Authorization call which happens beforehand)

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="$merchantId">
    <transaction refno="$refno">
      <request>
        <applePayToken><![CDATA[$token]]></applePayToken>
        <reqtype>NOA</reqtype>
        <sign>$sign</sign>
      </request>
    </transaction>
  </body>
</authorizationService>
EOF

Response

<?xml version="1.0" encoding="UTF-8" ?>
<authorizationService version="1">
  <body merchantId="$merchantId" status="accepted">
    <transaction refno="$refno" trxStatus="response">
      <request>
        <applePayToken><![CDATA[$token]]></applePayToken>
        <reqtype>NOA</reqtype>
        <transtype>05</transtype>
        <sign>$sign</sign>
      </request>
      <response>
        <responseCode>01</responseCode>
        <responseMessage>Authorized</responseMessage>
        <uppTransactionId>160823101329060450</uppTrasactionId>
        <authorizationCode>538050451</authorizationCode>
        <acqAuthorizationCode>101538</acqAuthorizationCode>
        <aliasCC>70119122433810042</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="1000011011">
    <transaction refno="705824">
      <request>
        <amount>99</amount>
        <currency>CHF</currency>
        <uppTransactionId>160823101329060450</uppTransactionId>
      </request>
    </transaction>
  </body>
</paymentService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='1'>
    <body merchantId='1000011011' status='accepted'>
        <transaction refno='705824' trxStatus='response'>
            <request>
                <amount>99</amount>
                <currency>CHF</currency>
                <uppTransactionId>160823101329060450</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="1000011011">
    <transaction refno="999273">
      <request>
        <amount>99</amount>
        <currency>CHF</currency>
        <uppTransactionId>160823101329060450</uppTransactionId>
        <transtype>06</transtype>
      </request>
    </transaction>
  </body>
</paymentService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='1'>
    <body merchantId='1000011011' status='accepted'>
        <transaction refno='999273' trxStatus='response'>
            <request>
                <amount>99</amount>
                <currency>CHF</currency>
                <uppTransactionId>160823101329060450</uppTransactionId>
                <reqtype>COA</reqtype>
                <transtype>05</transtype>
            </request>
            <response>
                <responseCode>01</responseCode>
                <responseMessage>credit 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="1000011011">
    <transaction refno="29023">
      <request>
        <amount>99</amount>
        <currency>CHF</currency>
        <uppTransactionId>160823101329060450</uppTransactionId>
        <reqtype>DOA</reqtype>
      </request>
    </transaction>
  </body>
</paymentService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='1'>
    <body merchantId='1000011011' status='accepted'>
        <transaction refno='29023' trxStatus='response'>
            <request>
                <amount>99</amount>
                <currency>CHF</currency>
                <uppTransactionId>160823101329060450</uppTransactionId>
                <reqtype>DOA</reqtype>
                <transtype>05</transtype>
            </request>
            <response>
                <responseCode>01</responseCode>
                <responseMessage>cancellation succeeded</responseMessage>
            </response>
        </transaction>
    </body>
</paymentService>

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="1000011011">
    <transaction>
      <request>
        <uppTransactionId>160823101329060450</uppTransactionId>
        <reqtype>STX</reqtype>
      </request>
    </transaction>
  </body>
</statusService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<statusService version='3'>
    <body merchantId='1000011011' status='accepted'>
        <transaction trxStatus='response'>
            <request>
                <uppTransactionId>180806230520144753</uppTransactionId>
                <reqtype>STX</reqtype>
            </request>
            <response itemNr='1'>
                <responseCode>1</responseCode>
                <responseMessage>Trx ready for settlement (trx authorized)</responseMessage>
                <refno>1533589519700</refno>
                <amount>99</amount>
                <currency>CHF</currency>
                <authorizationCode>520244760</authorizationCode>
                <pmethod>VIS</pmethod>
                <uppTransactionId>180806230520144753</uppTransactionId>
                <maskedCC>424242xxxxxx4242</maskedCC>
                <aliasCC></aliasCC>
                <expm>12</expm>
                <expy>21</expy>
                <trxDate>20180806</trxDate>
                <trxTime>230520</trxTime>
                <trtype>05</trtype>
            </response>
        </transaction>
    </body>
</statusService>

Apple Pay


Suggested Edits are limited on API Reference Pages

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