Download the PHP package dyanakiev/borica-emv-3ds-fixes without Composer
On this page you can find all versions of the php package dyanakiev/borica-emv-3ds-fixes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dyanakiev/borica-emv-3ds-fixes
More information about dyanakiev/borica-emv-3ds-fixes
Files in dyanakiev/borica-emv-3ds-fixes
Package borica-emv-3ds-fixes
Short Description Client library for Borica EMV 3DS
License MIT
Homepage https://1337.bg
Informations about the package borica-emv-3ds-fixes
Borica EMV 3DS
Borica EMV 3DS is PHP library providing an easier way to integrate newly released Borica protocol called EMV 3DS.
0. Requirements
TBD
- PHP 7.1 or newer
- Properly configured
default_charset
php.ini directive
1. Installation
1.1. Using Composer
Installation is recommended to be done via composer by running:
Alternatively you can add the following to the require
section in your composer.json
manually:
2. Usage
2.1. Initialize
Create and configure Borica
using your private key and certificate. The private key needs to be generated by yourself (see Cryptography
section for more details). The certificate (public key) is provided by Borica.
2.2. Create and send Sale Request (TRTYPE=1)
At the moment it works only with Bulgarian lev (BGN). Borica works on Euro (EUR) support.
To make a sale request (most commonly used one in e-commerce), create and configure SaleRequest
. Both <МИД>
and <ТИД>
are obtained from Borica. For all properties check the library source code.
Don't forget to use sanitized data instead of raw $_POST data.
Optionally you can validate that all the properties are correct with:
After you create the request, you need to generate an HTML form and redirect user to Borica payment page. See example implementation below:
2.3. Handle response
After a user pays on the Borica payment page, they will be redirected to the backUrl
defined for the terminal in APGW database (check with the bank that this URL is correctly set for the terminal). Note that this is not guaranteed, because the user can close their browser or disable JavaScript used for redirecting. In this case see 2.4. Create Status Check Request
.
2.4. Create Status Check Request (TRTYPE=90)
If you want to check the status of an already sent request, create and configure StatusCheckRequest
. <ТИД>
is obtained from Borica.
2.5. Create Reversal Request (TRTYPE=24)
To reverse successful SaleRequest
(TRTYPE=1) or completed deferred authorization (TRTYPE=24), create and configure ReversalRequest
.
<RRN>
and <INT_REF>
are returned in response of SaleRequest
and are unique for every transaction. Both <МИД>
and <ТИД>
are obtained from Borica. For all properties check the library source code.
3. Cryptography
-
Generate a private key with secure password:
-
Generate a code signing request (CSR) using your company information:
-
Rename
borica.csr
to match file patternTID_YYYYMMDD.csr
and send it to Borica. Use yourТИД
andcurrent date
(i.e.V0000000_20201105.csr
). - In response you'll receive a signed certificate (
borica.cer
) and a public key (borica.pub
) from Borica.
4. Contributing
TBD
5. License
Borica EMV 3DS is licensed under the MIT License.