gentor / omnipay-dskbank
dskbank.bg gateway for Omnipay payment processing library
Installs: 4 225
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- ext-json: *
- composer/ca-bundle: ^1.2
- omnipay/common: ^3
Requires (Dev)
- larapack/dd: ^1.1
- omnipay/tests: ^3
This package is auto-updated.
Last update: 2024-11-16 18:03:20 UTC
README
DSK Bank gateway for Omnipay payment processing library
Inspired from omnipay-paymentgateru
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements DSK Bank support for Omnipay.
Installation
Omnipay is installed via Composer. To install, simply require league/omnipay
and gentor/omnipay-dskbank
with Composer:
composer require league/omnipay gentor/omnipay-dskbank
Basic Usage
Purchase
$gateway = Omnipay::create('DskBank'); $gateway->setUserName($config['userName']) ->setPassword($config['password']) ->setTestMode($config['testMode']); $response = $gateway->authorize([ 'orderNumber' => time(), 'amount' => 5 * 100, 'description' => 'Dsk Bank Test Purchase', 'returnUrl' => 'http://dskbank.test/return.php', 'failUrl' => 'http://dskbank.test/return.php', ])->send(); $bankReference = $response->getTransactionReference(); if ($response->isRedirect()) { // Redirect to offsite payment gateway $response->redirect(); } else { // Payment failed echo $response->getMessage(); }
Complete Purchase
$status = $gateway->status($_GET)->send(); $statusExtended = $gateway->statusExtended($_GET)->send(); $orders = $gateway->getLastOrders([ 'size' => 5, 'from' => '20200926000000', 'to' => '20200928000000', 'transactionStates' => 'APPROVED,REFUNDED', ])->send(); $refund = $gateway->refund([ 'orderId' => $bankReference, 'amount' => $price * 100 ])->send(); $success = $refund->isSuccessful();