bishwajitcadhikary / omnipay-myfatoorah
MyFatoorah driver for the Omnipay payment processing library
Fund package maintenance!
barryvdh
Requires
- omnipay/common: ~3.0
Requires (Dev)
- omnipay/tests: ~3.0
- dev-master
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.0
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0-alpha.1
- 2.3.x-dev
- 2.3.2
- v2.3.1
- v2.3.0
- v2.1.0
- v2.0.0
- 1.1.x-dev
- v1.1.0
- 1.0.x-dev
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.4
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.1
- v0.7.0
- v0.6.1
- v0.6.0
- dev-patch-2
- dev-patch-1
- dev-feat-php8
- dev-feat/add-tests
- dev-barryvdh-travis-73_74
- dev-guzzle6-adapter-v2
- dev-judgej-patch-1
- dev-delatbabel-patch-1
This package is auto-updated.
Last update: 2024-10-31 00:27:41 UTC
README
MyFatoorah gateway integration for the Omnipay PHP payment processing library
Introduction
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements acapture support for Omnipay.
Installation
To install you can composer require the package;
$ composer require myfatoorah/omnipay
You can also include the package directly in the composer.json
file
{
"require": {
"myfatoorah/omnipay": "dev-master"
}
}
Usage
Creating a payment link
use Omnipay\Omnipay; $data = array(); $data['Amount'] = '50'; $data['OrderRef'] = 'orderId-123'; $data['Currency'] = 'KWD'; $data['returnUrl'] = 'http://websiteurl.com/callback.php'; $data['Card']['firstName'] = 'fname'; $data['Card']['lastName'] = 'lname'; $data['Card']['email'] = 'test@test.com'; // // Do a purchase transaction on the gateway $transaction = $gateway->purchase($data)->send(); if ($transaction->isSuccessful()) { $invoiceId = $transaction->getTransactionReference(); echo "Invoice Id = " . $invoiceId . "<br>"; $redirectUrl = $transaction->getRedirectUrl(); echo "Redirect Url = <a href='$redirectUrl' target='_blank'>" . $redirectUrl . "</a><br>"; } else { echo $transaction->getMessage(); }
Checking payment status
In the callback, Get Payment status for a specific Payment ID
$callBackData = ['paymentId' => '100202113817903101']; // or $callBackData = ['invoiceid' => '75896']; $callback = $gateway->completePurchase($callBackData)->send(); if ($callback->isSuccessful()) { echo "<pre>"; print_r($callback->getPaymentStatus('orderId-123', '100202113817903101')); } else { echo $callback->getMessage(); }
Make a refund
Refund a specific Payment ID
$refundData = ['paymentId' => '100202113817903101', 'Amount'=>1]; $refund = $gateway->refund($refundData)->send(); if ($refund->isSuccessful()) { echo "<pre>"; print_r($refund->getRefundInfo()); } else { echo $refund->getMessage(); }