定制 bishwajitcadhikary/omnipay-myfatoorah 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bishwajitcadhikary/omnipay-myfatoorah

最新稳定版本:v3.2.3

Composer 安装命令:

composer require bishwajitcadhikary/omnipay-myfatoorah

包简介

MyFatoorah driver for the Omnipay payment processing library

README 文档

README

MyFatoorah gateway integration for the Omnipay PHP payment processing library

Introduction

Build Status Scrutinizer Code Quality Code Intelligence Status Total Downloads

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();
}

统计信息

  • 总下载量: 110
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-02