Payment Service Provider API
What is Payment Service Provider (PSP)?
Payment Service Provider is intended for collaborating with business partners to help them to accept payments via plastic card. Using this service, you will provide your users with the opportunity of making payments without any negotiation with banks.
This documentation consists of the steps below.
Partners have to:
- Sign up on this page: http://psp.mps.az/register
- Then create service and wait for the confirmation
- Afterwards use the instructions shown below in their project
In case of creating new service partner should fill required fields:
(Title, Description, Callback URL, Secret key, IP address)
*Callback URL is intended to redirect the user to determine the result of payment after entering card credentials.
a) Partner should send request for generating PSP RRN.
b) Using this RRN partner should redirect the user to PSP.
c) After completing payment process the user will be redirected to callback URL entered by partner when he will have created the service.
Request method: POST
client_rrn - Transaction number on partner's side
amount - Amount that will be payed
client_ip - IP address of client that will do payment
hash - HASH code
Hash will be generated with SHA256 method like as below:
secret_key => Secret key generated by partner when creates a service
hash = hash_hmac('sha256', service_id.client_rrn.amount, secret_key)
If everything is right, client will be prompted to check datas. After submitting he will be redirected to the page of bank to enter card credentials.
How to know the result of transaction
To be able to know the result of transaction partner should send request to the URL showed below this transaction number.
psp_rrn - Transaction number
"description": "Request failed",
"date": "2016-08-22 11:37:23.000000",
OK - everything is right with request
BAD - something went wrong with request parameters
-1 - Request failed
0 - OK
1 - Pending
You should consider the result of the payment according to “code” parameter.
Other examples on check request:
"description": "RRN is wrong"
"description": "Validation error",
"The psp rrn field is required."