Generating a Signature
WARNING
signature
parameter or contain an incorrectly calculated Signature will be rejected by ZEN.COM.INFO
SHA: SHA256
paywallSecret: c8c93c452d38acf3183d2f08fee60aa7
paywallSecret
)Convert the JSON object to a flat structure.
Prepare the JSON request based on required and optional parametersπ‘ Example of JSON
{
"terminalUuid":"05b692d0-00b9-48f7-92ca-1509f055df2e",
"amount":1000,
"currency":"PLN",
"merchantTransactionId":"trasaction1",
"customer":{
"id":"CustomerId328642",
"firstName":"John",
"lastName":"Doe",
"email":"[email protected]"
},
"items":[
{
"code":"itemCode1",
"category":"itemCategory1",
"name":"itemName1",
"price":200,
"quantity":2,
"lineAmountTotal":400
},
{
"code":"itemCode2",
"category":"itemCategory2",
"name":"itemName2",
"price":300,
"quantity":2,
"lineAmountTotal":600
}
],
"billingAddress":{
"id":"bAId1",
"firstName":"John",
"lastName":"Doe",
"country":"PL",
"street":"streetName",
"city":"cityName",
"countryState":"stateName",
"province":"provinceName",
"buildingNumber":"1",
"roomNumber":"11",
"postcode":"23-232",
"companyName":"Company Name",
"phone":"+48555555555",
"taxId":"12345678"
},
"shippingAddress":{
"id":"sA1",
"firstName":"John",
"lastName":"Doe",
"country":"PL",
"street":"streetName",
"city":"cityName",
"countryState":"stateName",
"province":"provinceName",
"buildingNumber":"1",
"roomNumber":"11",
"postcode":"11",
"companyName":"Company Name",
"phone":"+48555555555"
},
"urlFailure":"https://backtoshop/failure",
"urlRedirect":"https://backtoshop/redirect",
"urlSuccess":"https://backtoshop/success",
"customIpnUrl":"https://backtoshop/notiify",
"language":"pl"
}
Convert the JSON object to a flat structure.
1.
<>
null), a list of elements 'name=value' should be created by mapping as follows:terminalUuid=05b692d0-00b9-48f7-92ca-1509f055df2e
billingAddress.firstName=John
items[0].code=itemCode1
2.
billingAddress.firstName=Jan β billingaddress.firstname=john
3.
4.
&
character, creating a single stringamount=1000&billingaddress.buildingnumber=1&billingaddress.city=cityname
Add unique Merchant paywallSecret parameter
To the resulting string, the Merchant π‘ Example flat form request with
amount=1000&billingaddress.buildingnumber=1&billingaddress.city=cityname&billingaddress.companyname=company name&billingaddress.country=pl&billingaddress.countrystate=statename&billingaddress.firstname=john&billingaddress.id=baid1&billingaddress.lastname=doe&billingaddress.phone=+48555555555&billingaddress.postcode=23-232&billingaddress.province=provincename&billingaddress.roomnumber=11&billingaddress.street=streetname&billingaddress.taxid=12345678¤cy=pln&customer.email=[email protected]&customer.firstname=john&customer.id=customerid328642&customer.lastname=doe&customipnurl=https://backtoshop/notiify&items[0].category=itemcategory1&items[0].code=itemcode1&items[0].lineamounttotal=400&items[0].name=itemname1&items[0].price=200&items[0].quantity=2&items[1].category=itemcategory2&items[1].code=itemcode2&items[1].lineamounttotal=600&items[1].name=itemname2&items[1].price=300&items[1].quantity=2&language=pl&merchanttransactionid=trasaction1&shippingaddress.buildingnumber=1&shippingaddress.city=cityname&shippingaddress.companyname=company name&shippingaddress.country=pl&shippingaddress.countrystate=statename&shippingaddress.firstname=john&shippingaddress.id=sa1&shippingaddress.lastname=doe&shippingaddress.phone=+48555555555&shippingaddress.postcode=11&shippingaddress.province=provincename&shippingaddress.roomnumber=11&shippingaddress.street=streetname&terminaluuid=05b692d0-00b9-48f7-92ca-1509f055df2e&urlfailure=https://backtoshop/failure&urlredirect=https://backtoshop/redirect&urlsuccess=https://backtoshop/successc8c93c452d38acf3183d2f08fee60aa7
paywallSecret
parameter should be appended at the end.paywallSecret
parameteramount=1000&billingaddress.buildingnumber=1&billingaddress.city=cityname&billingaddress.companyname=company name&billingaddress.country=pl&billingaddress.countrystate=statename&billingaddress.firstname=john&billingaddress.id=baid1&billingaddress.lastname=doe&billingaddress.phone=+48555555555&billingaddress.postcode=23-232&billingaddress.province=provincename&billingaddress.roomnumber=11&billingaddress.street=streetname&billingaddress.taxid=12345678¤cy=pln&customer.email=[email protected]&customer.firstname=john&customer.id=customerid328642&customer.lastname=doe&customipnurl=https://backtoshop/notiify&items[0].category=itemcategory1&items[0].code=itemcode1&items[0].lineamounttotal=400&items[0].name=itemname1&items[0].price=200&items[0].quantity=2&items[1].category=itemcategory2&items[1].code=itemcode2&items[1].lineamounttotal=600&items[1].name=itemname2&items[1].price=300&items[1].quantity=2&language=pl&merchanttransactionid=trasaction1&shippingaddress.buildingnumber=1&shippingaddress.city=cityname&shippingaddress.companyname=company name&shippingaddress.country=pl&shippingaddress.countrystate=statename&shippingaddress.firstname=john&shippingaddress.id=sa1&shippingaddress.lastname=doe&shippingaddress.phone=+48555555555&shippingaddress.postcode=11&shippingaddress.province=provincename&shippingaddress.roomnumber=11&shippingaddress.street=streetname&terminaluuid=05b692d0-00b9-48f7-92ca-1509f055df2e&urlfailure=https://backtoshop/failure&urlredirect=https://backtoshop/redirect&urlsuccess=https://backtoshop/successc8c93c452d38acf3183d2f08fee60aa7
Encode object using SHA algorithm
The entire object should then be encoded using one of the algorithms: SHA224 / SHA256 / SHA284 / SHA512 (choose one of described).For individual API test requests SHA algorithms encoding, you can use for example this website. For production requests, use encoding solutions implemented in your software or available through an additional subscription. π‘ Encoded string sample
6a3493c9a0213fd8a33032bc268da8592218e4bfdfe33c139160369e125366e0
INFO
6a3493c9a0213fd8a33032bc268da8592218e4bfdfe33c139160369e125366e0
Add name of hashing alrgorithm
To the encoded string, add a semicolon π‘ Example of
6a3493c9a0213fd8a33032bc268da8592218e4bfdfe33c139160369e125366e0
;
followed by the lowercase name of the hashing algorithm used. For described example it is sha256
. This will result in the final value of the "signature" attribute.signature
parameter6a3493c9a0213fd8a33032bc268da8592218e4bfdfe33c139160369e125366e0
Add name of hashing alrgorithm
The generated π‘ Example of
"signature": "6a3493c9a0213fd8a33032bc268da8592218e4bfdfe33c139160369e125366e0;sha256" π‘ Example of JSON request with Signature parameter
signature
attribute should be added to the input objectsignature
parameter final value"signature": "6a3493c9a0213fd8a33032bc268da8592218e4bfdfe33c139160369e125366e0;sha256"
{
"terminalUuid":"05b692d0-00b9-48f7-92ca-1509f055df2e",
"amount":1000,
"currency":"PLN",
"merchantTransactionId":"trasaction1",
"customer":{
"id":"CustomerId328642",
"firstName":"John",
"lastName":"Doe",
"email":"[email protected]"
},
"items":[
{
"code":"itemCode1",
"category":"itemCategory1",
"name":"itemName1",
"price":200,
"quantity":2,
"lineAmountTotal":400
},
{
"code":"itemCode2",
"category":"itemCategory2",
"name":"itemName2",
"price":300,
"quantity":2,
"lineAmountTotal":600
}
],
"billingAddress":{
"id":"bAId1",
"firstName":"John",
"lastName":"Doe",
"country":"PL",
"street":"streetName",
"city":"cityName",
"countryState":"stateName",
"province":"provinceName",
"buildingNumber":"1",
"roomNumber":"11",
"postcode":"23-232",
"companyName":"Company Name",
"phone":"+48555555555",
"taxId":"12345678"
},
"shippingAddress":{
"id":"sA1",
"firstName":"John",
"lastName":"Doe",
"country":"PL",
"street":"streetName",
"city":"cityName",
"countryState":"stateName",
"province":"provinceName",
"buildingNumber":"1",
"roomNumber":"11",
"postcode":"11",
"companyName":"Company Name",
"phone":"+48555555555"
},
"urlFailure":"https://backtoshop/failure",
"urlRedirect":"https://backtoshop/redirect",
"urlSuccess":"https://backtoshop/success",
"customIpnUrl":"https://backtoshop/notiify",
"language":"pl",
"signature":"6a3493c9a0213fd8a33032bc268da8592218e4bfdfe33c139160369e125366e0;sha256"
}
Modified atΒ 2024-10-09 12:47:39