A minimal implementation for Bancard API vPOS 2.0
- PHP >= 7.3
Run the following command in your console terminal:
$ composer require zrkb/bancard
use Bancard\Bancard;
use Bancard\Util\Currency;
Bancard::setPrivateKey('PRIVATE_KEY');
Bancard::setPublicKey('PUBLIC_KEY');
Bancard::setStaging(true);
$bancard = new Bancard;
$response = $bancard->singleBuy([
'shop_process_id' => 7777777, // MUST be an integer
'name' => 'My Product',
'description' => 'Product Description',
'amount' => '10000.00', // two decimals required
'currency' => Currency::PYG,
'return_url' => 'https://app.test/return_url',
'cancel_url' => 'https://app.test/cancel_url',
]);
The above example will return:
{
"status": "success",
"process_id": "KKt*PMyY88Jv88Wjrk7-"
}
$response = $bancard->singleBuyConfirm([
'shop_process_id' => 7777777,
'amount' => '10000.00', // two decimals required
'currency' => Currency::PYG,
]);
$response = $bancard->singleBuyGetConfirmation([
'shop_process_id' => 7777777,
]);
$response = $bancard->singleBuyRollback([
'shop_process_id' => 7777777,
]);
If you discover any security related issues, please use the issue tracker.
The MIT License (MIT). Please see License File for more information.