PostFinance E-Finance
Payment Process | Integration | ||
---|---|---|---|
Authorization | ✔️ | Payment Page | ✔️ |
Deferred Settlement | ✔️ | Split Mode | ✔️ |
Refund | ✔️ | Mobile SDK | ✔️ |
Cancel | ✔️ | ||
Alias | ❌ |
Description
With the account from PostFinance your customers pay for their purchases direct via computer or mobile telephone. The payment is made with the PostFinance Card or PostFinance E-Finance. The payment solution "eCom" from Datatrans offers you the opportunity of activating both methods of payment.
Money transactions are settled round the clock via the internet using e-finance. With about 1 million customers, PostFinance is the leading platform for online finance.
Proper Redirects
Lightbox Mode: When using PostFinance (PFC, PEF) or SwissBilling (SWB) make sure to also submit the uppStartTarget=_top parameter. This ensures that a proper redirect is made to the respective systems.
Web payment flow
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="1000011011">
<transaction refno="749532">
<request>
<amount>100</amount>
<currency>CHF</currency>
<aliasCC>PF151126170240403883</aliasCC>
<sign>30916165706580013</sign>
<pmethod>PEF</pmethod>
</request>
</transaction>
</body>
</authorizationService>
Response
<?xml version='1.0' encoding='UTF-8'?>
<authorizationService version='6'>
<body merchantId='1000011011' status='accepted'>
<transaction refno='749532' trxStatus='response'>
<request>
<amount>100</amount>
<currency>CHF</currency>
<aliasCC>PF151126170240403883</aliasCC>
<sign>30916165706580013</sign>
<pmethod>PEF</pmethod>
<reqtype>NOA</reqtype>
</request>
<response>
<responseCode>01</responseCode>
<responseMessage>authorization successful</responseMessage>
<uppTransactionId>171002152752145299</uppTransactionId>
<authorizationCode>752165301</authorizationCode>
<acqAuthorizationCode>239433</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="1000011011">
<transaction refno="705824">
<request>
<amount>50</amount>
<currency>CHF</currency>
<uppTransactionId>171002152752145299</uppTransactionId>
</request>
</transaction>
</body>
</paymentService>
Response
<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='2'>
<body merchantId='1000011011' status='accepted'>
<transaction refno='705824' trxStatus='response'>
<request>
<amount>50</amount>
<currency>CHF</currency>
<uppTransactionId>171002152752145299</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>100</amount>
<currency>CHF</currency>
<uppTransactionId>171002152752145299</uppTransactionId>
<transtype>06<transtype>
</request>
</transaction>
</body>
</paymentService>
Response
<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='2'>
<body merchantId='1000011011' status='accepted'>
<transaction refno='999273' trxStatus='response'>
<request>
<amount>100</amount>
<currency>CHF</currency>
<uppTransactionId>171002153232242915</uppTransactionId>
<reqtype>COA</reqtype>
<transtype>06</transtype>
</request>
<response>
<responseCode>01</responseCode>
<responseMessage>credit succeeded</responseMessage>
<uppTransactionId>171002153232242915</uppTransactionId>
<authorizationCode>430939749</authorizationCode>
<acqAuthorizationCode>092430</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="1000011011">
<transaction refno="29023">
<request>
<amount>100</amount>
<currency>CHF</currency>
<uppTransactionId>171002153232242915</uppTransactionId>
<reqtype>DOA</reqtype>
</request>
</transaction>
</body>
</paymentService>
Response
<?xml version='1.0' encoding='UTF-8'?>
<paymentService version='2'>
<body merchantId='1000011011' status='accepted'>
<transaction refno='29023' trxStatus='response'>
<request>
<amount>100</amount>
<currency>CHF</currency>
<uppTransactionId>171002153232242915</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>171002153232242915</uppTransactionId>
<reqtype>STX</reqtype>
</request>
</transaction>
</body>
</statusService>
Response
<?xml version='1.0' encoding='UTF-8'?>
<statusService version='5'>
<body merchantId='1000011011' status='accepted'>
<transaction trxStatus='response'>
<request>
<uppTransactionId>171002153232242915</uppTransactionId>
<reqtype>STX</reqtype>
</request>
<response itemNr='1'>
<responseCode>6</responseCode>
<responseMessage>DOA Cancel</responseMessage>
<refno>999273</refno>
<amount>100</amount>
<currency>CHF</currency>
<authorizationCode>232262916</authorizationCode>
<pmethod>PEF</pmethod>
<uppTransactionId>171002153232242915</uppTransactionId>
<maskedCC>****3448</maskedCC>
<aliasCC>PF151126170240403883</aliasCC>
<expm>06</expm>
<expy>21</expy>
<trxDate>20171002</trxDate>
<trxTime>153232</trxTime>
<trtype>05</trtype>
<settledAmount>100</settledAmount>
</response>
</transaction>
</body>
</statusService>
Updated over 2 years ago