FreedomPay is a universal payment acceptance tool for businesses.Each documentation script includes all the queries that can be executed to implement the chosen script.
You should read the Overview topic before start.
Call your manager, if you have any questions.
Attention! Connection doesn't require a PCI DSS certificate
HTTP method: POST or GET. Use POST: with GET all parameters, including the signature, are passed in the URL.
The response is XML in any request format, see «Response format and errors» below.
The request can be sent in any of these formats:
Format
How to pass nested parameters (for example pg_receipt_positions)
application/x-www-form-urlencoded
pg_receipt_positions[0][name]=value
multipart/form-data
pg_receipt_positions[0][name]=value
application/json
JSON array [{…}, {…}]
GET, parameters in the query string
pg_receipt_positions[0][name]=value
XML in the pg_xml parameter (application/x-www-form-urlencoded)
use another format for requests with nested parameters
In JSON, pass all values as strings, for example "pg_amount": "100.50". A JSON number is converted before the signature check (100.50 becomes 100.5), so a signature calculated from the original value does not match and the API returns a signature error.
Every request and every successful response is signed with pg_salt and pg_sig.
Check pg_sig of a response before using it.
Treat a response without pg_sig as an error: do not use it to confirm a payment or a payout.
To build pg_sig, concatenate with the separator ;:
1.
The script name — the last segment of the URL path, exactly as in the request URL: init_payment.php for {domain}/init_payment.php, init_payment for {domain}/init_payment.
2.
The values of all request parameters except pg_sig, sorted by parameter name in alphabetical order. pg_salt (a random string of Latin letters and digits) takes part like any other parameter.
3.
The secret key of the merchant.
Calculate MD5 of the resulting string and pass it in pg_sig as 32 lowercase hexadecimal characters. Any additional parameters sent in the request, including your own parameters without the pg_ prefix, also take part in the signature. A parameter added to the request after the signature is calculated makes the signature invalid: the API returns a signature error.Secret key. The merchant has two keys:
reg2nonreg, reg2reg, to_iban, payment_status2, balance_status, see Payouts
Nested parameters (for example pg_receipt_positions) are expanded: each nested value takes part in the signature in the position of its parent parameter, nested values are ordered the same way. Use the code below — it handles nesting.Response signature is calculated by the same rules with the same script name and key: take all fields of <response> except pg_sig.
— the operation succeeds, — the payment system declines it with error 99999.
Card number
3DS
Payment and card saving
Capture
Cancel before capture
Refund
4716047261941981
No
4916307416334310
Yes
4939770956154989
No
5367654276102126
Yes
5555555555555599
No
4400444400004444
Yes
6224466455690681278
No
623275279933273424
No
62528733472390953
No
Capture is needed only for a two-step payment (pg_auto_clearing = 0). A one-step payment is captured right away with any card from the table.
Cancel before capture: cancelling a two-step payment that is not captured yet. Cancelling a captured payment is a refund: see the Refund column.
No Visa or Mastercard card supports every operation. To test capture and refund, use 4716047261941981. To test cancel before capture, use 4939770956154989. UnionPay cards support every operation.