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

PayPal

120

paymentmethod=PAP

Payment ProcessIntegration
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:heavy-check-mark:

Description

PayPal is a global wallet for online payments. It has 173 million active customer accounts and is available in 203 markets and more than 100 currencies. Once registered with PayPal, customers can buy from multiple merchants without having to enter payment details again.
Payment Method provider website :link:

📘

Request and response parameter reference

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

🚧

Other PayPal flows

If you are interested in other PayPal flows like the Order-Authorize-Capture or UATP model, please get in contact with us .

Order-Authorize-Capture model

This mode allows a merchant to create an order without authorizing the transaction. Once the merchant is ready to start the payment flow the transaction can be authorized, settled, canceled or refunded.

Step 1: Create order

The order can be created by using following parameter when the payment page is called:

📘

“PayPalOrderId”="get"

The payment result will return a Paypal-alias which will be used in step 2.

Step 2: Authorization

Use the XML-API to authorize with the alias from step 1.

Step 3: Settlement

With the uppTransactionID settle the transaction using the XML-API

Further actions

Using the uppTransactionID you can use the Datatrans-API as usual to cancel, credit or retrieve the status.

PayPal buy online, pickup in-store (BOPIS)

To enable PayPal ship-to-store the parameter uppCustomerName can be used. The value of the parameter needs to start with S2S. For example:

uppCustomerName="S2S your branch"

Web payment flow

 1 
[Not supported by viewer]
Customer selects PayPal
Customer selects PayPal
Merchant Website
Merchant Website
Merchant Server
Merchant Server
Redirects to Paypal
Redirects to Paypal
PayPal
PayPal<br>
Handles Client Login
[Not supported by viewer]
 2 
[Not supported by viewer]
 4 
[Not supported by viewer]
Validates client account and authorizes payment 
[Not supported by viewer]
 5 
[Not supported by viewer]
Receives Result 
Receives Result 
5.1
[Not supported by viewer]
 7 
[Not supported by viewer]
Invokes merchant's
POST URL (Webhook)
Invokes merchant's<br>POST URL (Webhook)
Receives Result 
Receives Result 
 8 
[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
 3 
[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

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="1100004624">
    <transaction refno="1232323434324">
      <request>
        <amount>100</amount>
        <currency>CHF</currency>
        <reqtype>NOA</reqtype>
        <aliasCC>B-0A264331GJ9897603</aliasCC>
        <sign>30916165706580013</sign>
        <pmethod>PAP</pmethod>
      </request>
    </transaction>
  </body>
</authorizationService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<authorizationService version='6'>
    <body merchantId='1100004624' status='accepted'>
        <transaction refno='1232323434324' trxStatus='response'>
            <request>
                <amount>100</amount>
                <currency>CHF</currency>
                <reqtype>NOA</reqtype>
                <aliasCC>B-0A264331GJ9897603</aliasCC>
                <sign>30916165706580013</sign>
                <pmethod>PAP</pmethod>
                <PayPalBillingAgreementId/>
            </request>
            <response>
                <responseCode>01</responseCode>
                <responseMessage>PayPal trx successful</responseMessage>
                <uppTransactionId>181015153142749534</uppTransactionId>
                <authorizationCode>142749538</authorizationCode>
                <acqAuthorizationCode>7HS58427E9540662G</acqAuthorizationCode>
            </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="1100004624">
    <transaction refno="1232323434324">
      <request>
        <amount>100</amount>
        <currency>CHF</currency>
        <uppTransactionId>181015153142749534</uppTransactionId>
      </request>
    </transaction>
  </body>
</paymentService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='2'>
    <body merchantId='1100004624' status='accepted'>
        <transaction refno='1232323434324' trxStatus='response'>
            <request>
                <amount>100</amount>
                <currency>CHF</currency>
                <uppTransactionId>181015153142749534</uppTransactionId>
                <reqtype>COA</reqtype>
                <transtype>05</transtype>
            </request>
            <response>
                <responseCode>01</responseCode>
                <responseMessage>settlement succeeded</responseMessage>
                <uppTransactionId>181015153142749534</uppTransactionId>
                <authorizationCode>0</authorizationCode>
                <acqAuthorizationCode></acqAuthorizationCode>
            </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="1100004624">
    <transaction refno="1232323434324">
      <request>
        <amount>100</amount>
        <currency>CHF</currency>
        <uppTransactionId>181015153142749534</uppTransactionId>
        <transtype>06</transtype>
      </request>
    </transaction>
  </body>
</paymentService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='2'>
    <body merchantId='1100004624' status='accepted'>
        <transaction refno='1232323434324' trxStatus='response'>
            <request>
                <amount>100</amount>
                <currency>CHF</currency>
                <uppTransactionId>181015153142749534</uppTransactionId>
                <transtype>06</transtype>
                <reqtype>COA</reqtype>
            </request>
            <response>
                <responseCode>01</responseCode>
                <responseMessage>credit succeeded</responseMessage>
                <uppTransactionId>181015153411989137</uppTransactionId>
                <authorizationCode>416099369</authorizationCode>
                <acqAuthorizationCode>0</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="1100004624">
    <transaction refno="1232323434324-2">
      <request>
        <amount>100</amount>
        <currency>CHF</currency>
        <uppTransactionId>181015153442771170</uppTransactionId>
        <reqtype>DOA</reqtype>
      </request>
    </transaction>
  </body>
</paymentService>

Response

<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='2'>
    <body merchantId='1100004624' status='accepted'>
        <transaction refno='1232323434324-2' trxStatus='response'>
            <request>
                <amount>100</amount>
                <currency>CHF</currency>
                <uppTransactionId>181015153442771170</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="1100004624">
    <transaction>
      <request>
        <uppTransactionId>181015153442771170</uppTransactionId>
        <reqtype>STX</reqtype>
      </request>
    </transaction>
  </body>
</statusService>
EOF

Response

<?xml version='1.0' encoding='UTF-8'?>
<statusService version='5'>
    <body merchantId='1100004624' status='accepted'>
        <transaction trxStatus='response'>
            <request>
                <uppTransactionId>181015153442771170</uppTransactionId>
                <reqtype>STX</reqtype>
            </request>
            <response itemNr='1'>
                <responseCode>7</responseCode>
                <responseMessage>MOA Cancel</responseMessage>
                <refno>1232323434324-2</refno>
                <amount>100</amount>
                <currency>CHF</currency>
                <authorizationCode>442771174</authorizationCode>
                <pmethod>PAP</pmethod>
                <uppTransactionId>181015153442771170</uppTransactionId>
                <maskedCC></maskedCC>
                <aliasCC></aliasCC>
                <expm></expm>
                <expy></expy>
                <trxDate>20181015</trxDate>
                <trxTime>153442</trxTime>
                <trtype>05</trtype>
            </response>
        </transaction>
    </body>
</statusService>