Download the PHP package travijuu/bkm-express without Composer
On this page you can find all versions of the php package travijuu/bkm-express. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download travijuu/bkm-express
More information about travijuu/bkm-express
Files in travijuu/bkm-express
Informations about the package bkm-express
BKM Express PHP Payment Library
BKM Express is easy and fast payment system in Turkey which makes possible online payments without giving whole credit card information so this library provides you a simple API for it.
NOTE: currently working on this project. Documentation has not been completed yet.
Installation
You can simply install this library via Composer.
Firstly, add this line into your composer.json
and then run composer update
command.
Payment Steps in BKM Express
There are four steps to make payment transaction.
- Initialize Payment - prepare your data (banks, installments, payment options, etc..), send them to BKM Express, get the result from BKM Express and make POST request to BKM after the verification.
- Request Merch Info - BKM makes SOAP request to you to get your virtual pos info according to client's credit card selection.
- Success/Cancel URL - BKM Express makes payment transaction request to defined bank instead of you when it gets your virtual pos info. According to the transaction result, it makes another request to success or cancel url.
- Confirmation URL - Apart from success/fail url request, BKM Express makes another request to your confirmation url. This request is same as success/fail request so it is an extra request to be ensure that preventing data loss from a failure in success/fail request
Basic Usage
Let's start with first step.
Initialize Payment
Then, make POST request to $response->getUrl()
with 3 parameters by redirecting page to BKM Express
Another way of POST request. (But not preferred)
After this step, you should be redirected to BKM Express website.
Once customer logged into the system, available credit cards will be listed. So, customer can see all installment options which are sent in initialize payment request.
After credit card selection, a SMS password will be requested from customer.
In next step, BKM Express will make a SOAP request to your application to get bank API information which is related to customer's selected card (Request Merch Info
)
Request Merch Info
IMPORTANT: You should declare a webservice url to BKM Express customer service.
Thus, BKM Express will make a SOAP request to this url to get bank API information from your server.
The result of this request will be returned to BKM Express and it will make a bank transaction with your bank API information. After that, BKM Express will make a POST request according to the result of the bank transaction (success / cancel url
)
Success/Cancel URL
BKM Express will make a POST request to success url (https://example.com/bkm/success) or cancel url (https://example.com/bkm/error) You need to get the POST data and pass it into confirm function
Note: https://example.com/bkm/success/{orderCode} You can use your success url like this so that can help you to understand which order you are trying to pay.
Confirmation URL
Apart from success url
, BKM Express will do this POST request to your confirmation URL for precaution. They assumed that the request sent to success url
may not be reached.
IMPORTANT: You should declare confirmation url to BKM Express customer service.
TODO
- Agreements will be added.
Contribute
If you have any suggestions, feel free to create an issue here on Github and/or fork this repo, make changes and submit a pull request!