Payment via EasyPay
General information¶
- Client - The end user of the service
- Merchant (WEB merchant) - A legal entity that has concluded a contract with ePay.bg
- The files cited in the documentation can be downloaded from the "Demo package" link under the login button at https://demo.epay.bg/
Description of the payment process¶
- A client of a WEB merchant places an order in his electronic store.
- After finishing the order, the customer selects "Pay at an EasyPay office".
- The merchant sends an HTTP GET payment request to ePay.bg URL (hidden from the client)
- In the case of a correctly submitted request, ePay.bg returns to the merchant a 10-digit payment code in EasyPay in the same HTTP session.
- The merchant displays this code on his site. This is the code for the customer to go to the EasyPay checkout and make the payment.
- ePay.bg monitors the status of the registered/recorded pending obligations and upon payment/rejection of the payment, a notification is sent to the merchant regarding the status of the respective request. System notifications are sent to ports:
- 80 for HTTP
- 443 for HTTPS
- Upon receiving a notification from ePay.bg, the merchant must form a corresponding response. If the notification is received again, the first response returned is repeated.
Info
Payments with a 10-digit code can also be made at an EasyPay ATM.
Communication scheme¶
Each registered merchant in the ePay.bg system has
- Alphanumeric secret word of length 64 (
secret
) - Customer Identification Number (
CIN
)
The merchant can find them in his https://epay.bg/ profile without being able to change them.
Production environment¶
Method | URL |
---|---|
GET | https://www.epay.bg/ezp/reg_bill.cgi |
Demo environment¶
Method | URL |
---|---|
GET | https://demo.epay.bg/ezp/reg_bill.cgi |
Simulate a payment made with a 10-digit code at an EasyPay office
https://demo.epay.bg/ezp/pay_bill.cgi?ACTION=PAY&IDN=1234567890
Parameter | Type | Description | Optionality |
---|---|---|---|
ACTION | PAY | Simulate Payment | Mandatory |
IDN | int | The resulting payment code | Mandatory |
You should get STATUS=PAID
on the notification URL you specified.
Payment request¶
Parameter | Type | Description | Optionality |
---|---|---|---|
ENCODED | string | Base64-encoded (RFC 3548) payment request, EOL='' . |
Mandatory |
CHECKSUM | string | Checksum on ENCODED generated as HMAC with SHA-1 algorithm and the merchant's secret word. |
Mandatory |
Parameters in ENCODED
Parameter | Type | Description | Optionality |
---|---|---|---|
MIN | int | Customer Identification Number (CIN) | Mandatory |
string | Email of the merchant in the system | Optional | |
INVOICE | int | InvoiceNumber; unique to merchant | Mandatory |
AMOUNT | float | Valid Amount > 0.01 (eg: 22, 22.8, 22.80) | Mandatory |
CURRENCY | string | Accepted currencies are BGN , USD or EUR ; if not provided it defaults to BGN |
Optional |
EXP_TIME | datetime | Payment End Date/Time; format DD.MM.YYYY[hh:mm[:ss]] |
Mandatory |
DESCR | string | Description up to 100 characters; CP1251 characters if no other ENCODING |
Optional |
ENCODING | encoding | encoding of DESCR parameter; only utf-8 is accepted, it can also be passed as an HTTP parameter |
Optional |
Important
Allow enough time for the EXP_TIME
request to be valid for the customer to go to an EasyPay checkout.
Sample request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Change timeout to 10-digit code¶
Each 10-digit code is valid until expiration_time
.
Change expiration time to a 10-digit code serves to extend the duration or disable it.
Payment notification¶
To receive real-time notifications about the status of payments, you need to develop Payment Notification.