tobelyan/omnipay-arca 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

tobelyan/omnipay-arca

Composer 安装命令:

composer require tobelyan/omnipay-arca

包简介

ARCA Payment Gateways for ACBA,ASHIB,INECO and other arca.am partner banks [Laravel] with CardBinding

README 文档

README

arca driver for the Omnipay Laravel payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements ARCA support for Omnipay. With CardBinding Support

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "tobelyan/omnipay-arca": "dev-master"
    }
}

And run composer to update your dependencies:

composer update

Or you can simply run

composer require tobelyan/omnipay-arca

Basic Usage

  1. Use Omnipay gateway class:
    use Omnipay\Omnipay;
  1. Initialize ARCA gateway:
    $gateway = Omnipay::create('Arca');
    $gateway->setUserName(env('username'));
    $gateway->setPassword(env('password'));
    $gateway->setParameter('language',\App::getLocale()); // Language
    $gateway->setParameter('amount',10); // Amount to charge
    $gateway->setParameter('TransactionId',XXXX); // Transaction ID from your system
  1. Call purchase, it will automatically redirect to ARCA's hosted page
    $purchase = $gateway->purchase()->send();

    $purchase->redirect();
  1. Here we should get callback url to check status, e.g
public function checkStatus(Request $request) {
    $orderId = $request->orderId;
    //then make a request
    $gateway = Omnipay::create('Arca');
    $gateway->setUserName(env('username'));
    $gateway->setPassword(env('password'));
    $purchase = $gateway->getOrderStatus(['transactionId' => $request->orderId])->send();
    if($purchase->isSuccessful()) {
        //your logic
    }
}

Card Binding

Add these methods to your logic

    $gateway->setParameter('clientId', auth()->user()->id);
    $gateway->setParameter('bindingPayment',true);
    $gateway->setParameter('bindingId',$card->bindingId);

    //Send Binding info using these methods
    $gateway->setParameter('mdOrder',$orderId);
    $purchase = $gateway->makeBindingPayment()->send();
    //then send Redirection
    if ($purchase->isRedirect()) {
        $purchase->redirect();
    }

Data you will get after payment

$purchaseData = [
    'user_id'=>auth()->user()->id,
    'expiration'=>$purchase->getData()['cardAuthInfo']['expiration'],
    'cardholderName'=>$purchase->getData()['cardAuthInfo']['cardholderName'],
    'approvalCode'=>$purchase->getData()['cardAuthInfo']['approvalCode'],
    'pan'=>$purchase->getData()['cardAuthInfo']['pan'],
    'clientId'=>$purchase->getData()['bindingInfo']['clientId'],
    'bindingId'=>$purchase->getData()['bindingInfo']['bindingId'],
    'secure_hash'=>md5($purchase->getData()['cardAuthInfo']['pan'])
];

For general usage instructions, please see the main Omnipay repository.

Developed BY DINEURON

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

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.

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固