ahmett/payconn-qnbfinansbank

QNB Finansbank payment processing library for PHP

v1.2.0 2021-03-16 16:01 UTC

This package is auto-updated.

Last update: 2024-12-20 14:10:44 UTC


README

Payconn: QNB Finansbank

QNB Finansbank gateway for Payconn payment processing library

Build Status Total Downloads Latest Stable Version License

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.

Installation

$ composer require ahmett/payconn-qnbfinansbank

Supported Methods

  • 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

Basic Usages

Purchase Action:

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.

Support

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.

License

The MIT License (MIT). Please see License File for more information.