Guides
These docs are for v1.0.1. Click to read the latest docs for v2.1.0.

Apple Pay

120

paymentmethod=APL

Payment processIntegration
Authorisation✔️Payment Page✔️
Deferred settlements✔️Split Mode✔️
Cancel✔️Mobile SDK✔️
Refund✔️
Alias

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).

Payment Method provider website 🔗

Integration variants

Apple Pay Web

The Datatrans based integrations allows to integrate and activate Apple Pay effortlessly and can be used on our hosted Payment Page and on your website. To find out how you can integrate Apple Pay on your website you can either check out Apples official guide or use our Payment Button .

🚧

Note: Apple Pay is not available in our Lightbox Mode due to security restrictions.

Apple Pay in conjunction with our Payment Page is only supported on our datatrans.com domain.

Prerequisites

  • Apple Pay set up as payment method by our support team

Activation

As an existing customer please login to our Datatrans Webadmin Tool and navigate to 'UPP Administration' > ' Apple Pay settings'.

  • Accept the terms and conditions
  • Click 'Active on Payment Page'
  • Fill 'General Apple Pay Settings'
  • Click 'Update'

Your set up is now complete and Apple Pay will appear on your payment page.

Adding a domain

If you would like to add the Apple Pay button to your website you have to register said domain with our Datatrans Webadmin Tool . To do so navigate to 'UPP Administration' > ' Apple Pay settings' and click 'Add domain'. After following the steps described in the section to add a domain you use the Apple Pay button on your website.

Apple Pay for iOS

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.

Prerequisites

Creating a payment processing certificate

As an existing customer please login to our Datatrans Webadmin Tool and navigate to 'UPP Administration' > 'UPP Security' > 'Apple Pay Settings' > 'Apple Pay payment processing certificates' to obtain the CSR needed to create a payment processing certificate at developer.apple.com. This certificate is needed for native Apps. Once created, upload it again on our Backoffice tool and you should be ready to process Apple Pay transactions.

Web Payment Flow

 1 
 1 
Customer clicks Pay
Customer clicks Pay
Merchant Website
Merchant Website
Merchant Server
Merchant Server
Payment Page loaded from Datatrans
Payment Page loaded...
Apple
Apple
 3 
 3 
Customer selects Apple Pay
Customer selects App...
 2 
 2 
Starts Apple Pay
Starts Apple Pay
User selects Method of Payment
User selects Method...
Apple Pay API returns encrypted Payment Data
Apple Pay API return...
Decrypts Payment Data
Decrypts Payment Data
Forwards to Acquirer 
Forwards to Acquirer 
9.1
9.1
10
10
Receives Result and Invokes merchant's
POST URL (Webook)
Receives Result and...
Receives Result 
Receives Result 
 11 
 11 
Redirects customer back to merchant
Redirects customer b...
Customer gets redirected to merchant page
Customer gets redire...
Acquirer
Acquirer
Authorization
Authorization
User's Device
User's Device
 4 
 4 
 5 
 5 
 6 
 6 
 7 
 7 
 8 
 8 
 9 
 9 
Viewer does not support full SVG 1.1

Server to Server API calls

After initially receiving the cryptogram/token by completing the payment flow on the web, the authorization server to server API can be used to do the actual authorization. In the response you will receive a transactionId to call the other APIs.
##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="6">
  <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="6">
  <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="2">
  <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='2'>
    <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="2">
  <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='2'>
    <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="2">
  <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='2'>
    <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="5">
  <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='5'>
    <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>