QNB Finansbank gateway for Payconn payment processing library
Installation | Supported Methods | Basic Usages
Payconn is a framework agnostic, multi-gateway payment processing library for PHP. This package implements common classes required by Payconn.
$ composer require ahmett/payconn-qnbfinansbank
- purchase : authorize and immediately capture an amount
- authorize : authorize an amount on the customer's card
- complete : capture an amount you have previously authorized
- refund : refund an already processed transaction
- cancel : cancel an already processed transaction, this generally can only be called up to 24 hours after submitting a transaction
use Payconn\Common\CreditCard;
use Payconn\QNBFinansbank\Token;
use Payconn\QNBFinansbank\Currency;
use Payconn\QNBFinansbank\Model\Purchase;
use Payconn\QNBFinansbank;
$token = new Token('MERCHANT_ID', 'MERCHANT_PASS', 'USER_CODE', 'USER_PASS');
$creditCard = new CreditCard('NUMBER', 'EXPIRE_YEAR', 'EXPIRE_MONTH', 'CVV');
$purchase = new Purchase();
$purchase->setTestMode(true);
$purchase->setCurrency(Currency::TRY);
$purchase->setAmount(1);
$purchase->setInstallment(0);
$purchase->setCreditCard($creditCard);
$purchase->generateOrderId();
$response = (new QNBFinansbank($token))->purchase($purchase);
if ( $response->isSuccessful() ) {
// success!
}
Take a look at samples folder for more usage examples.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.
The MIT License (MIT). Please see License File for more information.