定制 omnipay/epay 二次开发

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

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

omnipay/epay

Composer 安装命令:

composer require omnipay/epay

包简介

Epay Bg gateway for Omnipay payment processing library

README 文档

README

Epay driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Epay, EasyPay Bpay and more Bugarian online payment providers support for Omnipay.

Installation

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

{
    "require": {
        //...
        "omnipay/epay": "1.2.*@dev",
    }
}

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

###The following gateways are provided by this package:

  • Epay (Epay Chekcout)
  • EasyPay (EasyPay check out provider)

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

BASIC USAGE

SEND DATA TO GATEWAY

use Omnipay\Omnipay;
$method = Epay; # Or Easypay 
$gateway = Omnipay::create($method);
$gateway->setSignature('EapyKey');
$gateway->setMin('Eapy user');
$gateway->setReturnUrl('ecample.com/{successful}'); ##retunr url after success pay
$gateway->setCancelUrl('ecample.com/{reject}'); ##return url after recject pay
//For demo pack 
$gateway->setTestMode(true);
//To generate transactionId/invoce we need basic function
$invoce = substr(number_format(time() * rand(), 0, '', ''), 0, 10);
$params =  $params = [
            'amount'        => $amount,
            'transactionId' => $invoice,
            'currency'      => $currency,
        ];
$response = $gateway->purchase($params)->send();

if ($response->isSuccessful()) {
    // only EasyPay get IDN 
    echo($response->getRedirectData()); 
} elseif ($response->isRedirect()) {
    // redirect to epay payment gateway
    $response->redirect();
} else {
    // payment failed: display message to customer
    echo $response->getMessage();
}

EPAY LISTENER

  • Listener for return payment status
//Use only epay gateway
$gateway  = $gateway = Omnipay::create('epay');
$response = $gateway->capture($_POST)->send();
if ($response['invoice']) {
    if (isset($response['notify_text'])) {
        //This is requere to stop epay gateway sends data 
        //Status of pyments is $response['status']; 
        //
        echo $response['notify_text'];
    }
}

EPAY BG

EPAY BG DOCUMENTATION

##TODO

  • Add funtion for expire data
  • Add function for add description
  • Add for more property

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.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-25