Link Payment API
Generate Link Payment URL
To generate a new link for payment, parameters is sent to a URL and the link is returned in the response. Parameters is sent using HTTP(s) POST tohttps://{psp-url}/admin/link_pay
Parameters
Name | Format | Mandatory | Description |
---|---|---|---|
merchant_id | string | yes | Merchants unique id. |
order_id | string | yes | Merchants order id. Unique id generated by the merchants system. |
amount | string | yes | The amount of the transaction must be 1 unit-of-currency (100 = 1 kr). |
currency | string | no | Currency to be used in payment: ‘SEK’,‘EUR’,‘DKK’,‘NOK’,‘GBP’,‘USD’,'PLN', 'HRK'. Default ‘SEK’. |
language | string | no | Language in payment window. ‘SE’,’NO’,’DK’,’GB’, 'FI', 'PL', 'HR'. Default ‘SE’. |
accept_url | string | yes | URL where customer is redirected after successful payment. |
cancel_url | string | no | URL where customer is redirected when clicking cancel in payment window. |
callback_url | string | no | URL where payment gateway sends transaction data after successful payment. |
do_3d_secure | string | no | ‘NO’ disables 3D-Secure. Please note that the banks liability shift is not active if 3D-secure is not used. Default ’YES’. |
pay_method | string | no | To control which payment methods to display in payment window. ‘PAYWIN’ displays all payment methods. ‘CARD’ displays only card entry. ‘BANK’ displays only bank payment. 'SWISH' only Swish payment. Default ‘PAYWIN’. |
return_method | string | no | Method to call accept_url. ’POST’ or ’GET’. Default ’POST’. |
prompt_name_entry | string | no | Control if cardholder name entry should be displayed in payment window. ‘YES’ activates fields. Default ‘NO’. |
result_redirect | string | no | ‘NO’ means that customer is displayed a web page after successful payment instead of being redirected to accept_url. Default ‘YES’. |
create_subscription | string | no | ‘YES’ means that an extra parameter ‘subscription_trans_id’ is sent to accept and callback-url if payment is successful. This is a reference to the card number that can be used later to debit the card. Please note that this requires support at the acquiring bank. |
posenv | string | no | Used to define where the transaction originates. This is important to match the acquiring agreement. ‘SSL’, ‘MAIL’, ‘TELEPHONE’ Default: ‘SSL’ |
capture_now | string | no | ‘YES’ means that the payment is flagged for automatic debit. No separate call for debit is required. Default ‘NO’. |
oiTypes | string | no | Names of columns for order rows described left to right. Names are seperated by ';' (semi colon). Valid names are: AMOUNT, DESCRIPTION, ITEMID, ITEMPRICE, QUANTITY, DISCOUNT, VATPERCENT |
oiRow(1..n) | string | no | Contains the order row for the payment in the same order as oiTypes. Each row is described by "oiRow1", "oiRow2" and so on. |
test | string | no | ‘YES’ means that the payment is flagged for test. Default ‘NO’. |
mac | string | no | SHA-256 checksum calculated as the example below. |
Response:
Status: 200 OK
{
"id": "103R042eZvKYlo2CGzSAyQA6",
"result": "Success",
"url": "https://{psp-url}/pay/link/103R042eZvKYlo2CGzSAyQA6"
}
MAC calculation
Sort all parameters in alphabetic order based on the parameter name:accept_url | https://www.butiken.com/store/show_receipt?order_id=WebOrder-2023 |
amount | 1000 |
callback_url | https://payment.butiken.com/notification |
currency | SEK |
merchant_id | 1007 |
order_id | WebOrder-2023 |
pay_method | PAYWIN |
Copy all parameter values to a buffer:
https://www.butiken.com/store/show_receiptorder_id=WebOrder20231000https://payment.butiken.com/notificationSEK1007WebOrder-2023PAYWIN
Append the merchants secret:
X85LmHiJ98
https://www.butiken.com/store/show_receiptorder_id=WebOrder20231000https://payment.butiken.com/notificationSEK1007WebOrder-2023PAYWINX85LmHiJ98
Calculate SHA-256-sum on the string buffer:
0a87b7f2c02f661d9bc982de586346f5dfd6ce0017cf8cdf74067c6518704639
Example link generate request
Below is an example request from command line to generate a link.
Using curl
curl https://{domain}/api/v1/merchants -d "accept_url=https://www.butiken.com/store/show_receiptorder_id=WebOrder2023&amount=1000&callback_url=https://payment.butiken.com/notification¤cy=SEK&merchant_id=1007&order_id=WebOrder2023&pay_method=PAYWIN&mac=0a87b7f2c02f661d9bc982de586346f5dfd6ce0017cf8cdf74067c6518704639"
Response:
Status: 200 OK
{
"id": "103R042eZvKYlo2CGzSAyQA6",
"result": "Success",
"url": "https://{psp-url}/pay/link/103R042eZvKYlo2CGzSAyQA6"
}
Flowchart
