Download the PHP package yanosh-k/epay without Composer
On this page you can find all versions of the php package yanosh-k/epay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yanosh-k/epay
More information about yanosh-k/epay
Files in yanosh-k/epay
Package epay
Short Description A PHP class used for simplifying the work with the Bulgarian payment portal ePay.
License MIT
Informations about the package epay
Epay.php
A PHP class used for simplifying the work with the Bulgarian payment portal ePay.
About ePay (excerpts from their website)
The company is specialized in the making of payment systems, electronic trade and security of the information transmission through Internet. The company makes processing of payments with bank cards and of bank transactions in open webs. The main activity of the company is connected with operating with the payment systems ePay.bg®, ePayVoice® (payment by telephone), B-pay (payment at ATM).
Usage
Instlation
With composer: 1) Install package
2) Require the composer autoloader:
Manual: 1) Download or copy src/Epay.php inside your project 2) Require the library:
Initializing a transaction
Transactions are initialized by making a POST request to the ePay portal. All the necessary data needed for completing the transaction (invoice ID, total amount of the transaction, etc.) is passed as POST parameters. Usually a form with hidden input fields is used to guide the user to the payment portal while passing that information.
To create the form used for directing the user to the payment portal:
-
Initialize the Epay class with the merchant information you received after completing your merchant profile registration:
-
Add the current transaction information:
- Generate the form used to direct to user to payment portal.
The captured output from this function should look like this:
- Use any desired method to submit the form and direct the user to the payment portal.
Capturing payments
The payment portal will notify a previously defined URL(set in the merchant profile) for the transaction status, once it was determined by the system. The notification for a single invoice are send until a positive response is received from the URL, or until no positive response is recived for 30 days.
The scheme that ePay currently uses to send notification is as follows:
- Parse the notification
The $transactionInfo
variable should contain information in the following format:
- Generate an appropriate response
An example response might look like this: