1. Go to this page and download the library: Download vm-labs/borica library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Borica\Entity\Request as BoricaRequest;
use Borica\Manager\RequestManager;
class PaymentController extends AbstractController
{
public function __invoke(RequestManager $requestManager)
{
$request = new BoricaRequest();
$request->setAmount(29);
$request->setDescription('Payment details.');
# You can check that the data is valid or pick up the list of errors before submitting the form.
if (!$paymentRequest->isValidData()) {
$errorList = $paymentRequest->getErrorList();
// ...
}
$paymentRequest = $requestManager->payment($request, 'config_1'); // the second argument is
use Borica\Manager\ResponseManager;
class PaymentResponseController extends AbstractController
{
public function __invoke(ResponseManager $responseManager)
{
$boricaResponse = $this->responseManager->response();
# Verification of the signature in response from APGW
if (!$boricaResponse->isValid()) {
// ...
}
# Check if the borica response is completed successfully.
if (!$boricaResponse->isSuccessful()) {
$responseCode = $boricaResponse->getResponseCode();
// ...
}
$response = $boricaResponse->getData();
$orderId = $response->getOrderId();
// ...
}
}
use Borica\Entity\Request as BoricaRequest;
use Borica\Manager\RequestManager;
class StatusRequestController extends AbstractController
{
public function __invoke(RequestManager $requestManager)
{
$request = new BoricaRequest();
$request->setOrder($order);
$statusRequest = $requestManager->status($request);
if (!$paymentRequest->isValidData()) {
$errorList = $paymentRequest()->getErrorList();
// ...
}
$boricaResponse = $statusRequest->request();
if ($boricaResponse->isValid()) {
// ...
}
if ($boricaResponse->isSuccessful()) {
// ...
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.