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

Authorization

An Authorization is an approval of a request to exchange money. Usually a merchant asks through Datatrans if they are allowed to request the amount needed for the transaction. In most cases, depending on the payment method, there is an acquirer or issuer. The authorization is given by the party which manages the consumer account. As an example the issuing bank answers the acquirer if the given consumer has enough money and if the requesting merchant is seen enough trustworthy to proceed with the transaction. If so, the response is then forwarded through the acquirer to Datatrans and back to the merchant. Once a transaction is authorized the requested amount is reserved. Only after a settlement the money flow starts.

Each response of an authorization with Datatrans holds a uppTransactionId.

transactionId

👍

uppTransactionId is the main and unique identifier for a payment.

Save the uppTransactionId in your database for later usage. Possible use cases where the uppTransactionId is needed:

Authorization

Examples

<a href="https://pay.sandbox.datatrans.com/upp/jsp/upStart.jsp?		 
         &merchantId=1000011011
         &amount=1000
         &currency=CHF
         &refno=929787
         &sign=30916165706580013"
   class="btn btn-primary">Payment Page authorization</a>

Try it out for yourself. Click the button below to start a payment.

Payment Page authorization

Charging an Alias

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="1000011011">
        <transaction refno="929787">
            <request>
                <amount>1000</amount>
                <currency>CHF</currency>
                <reqtype>NOA</reqtype>
                <aliasCC>70323122544331174</aliasCC>
                <expm>12</expm>
                <expy>21</expy>
                <sign>30916165706580013</sign>
            </request>
        </transaction>
    </body>
</authorizationService>
EOF
<?xml version='1.0' encoding='UTF-8'?>
<authorizationService version='6'>
    <body merchantId='1000011011' status='accepted'>
        <transaction refno='929787' trxStatus='response'>
            <request>
                <amount>1000</amount>
                <currency>CHF</currency>
                <reqtype>NOA</reqtype>
                <aliasCC>70323122544331174</aliasCC>
                <expm>12</expm>
                <expy>21</expy>
                <sign>30916165706580013</sign>
            </request>
            <response>
                <responseCode>01</responseCode>
                <responseMessage>Authorized</responseMessage>
                <uppTransactionId>TRANSACTION-ID</uppTransactionId>
                <authorizationCode>807310863</authorizationCode>
                <acqAuthorizationCode>110807</acqAuthorizationCode>
                <maskedCC>375811xxxxx1115</maskedCC>               
            </response>
        </transaction>
    </body>
</authorizationService>

🚧

reqtype=NOA

In the above example <reqtype>NOA</reqtype> is used. This means that the transaction needs to be settled at a later step. Refer to Deferred Settlement for more information.


What’s Next

Check out how your server can retrieve a Webhook (POST URL) for each transaction.