定制 clapp/omnipay-otphu 二次开发

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

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

clapp/omnipay-otphu

Composer 安装命令:

composer require clapp/omnipay-otphu

包简介

Experimental Omnipay v2.5 Payment Gateway for https://www.otpbank.hu

README 文档

README

Experimental package, not recommended for production.

Install

composer require clapp/omnipay-otphu:dev-master

Usage Example

<?php
include 'vendor/autoload.php';

$gateway = Omnipay\Omnipay::create("\\".Clapp\OtpHu\Gateway::class);

$gateway->setShopId("0199123456");
$gateway->setPrivateKey(file_get_contents('myShopKey.privKey.pem'));
$gateway->setTestMode(false);

try {
    $request = $gateway->purchase([
        'amount' => '100.00',
        'currency' => 'HUF',
        'returnUrl' => 'https://www.example.com/processing-your-payment',
    ]);
    $response = $request->send();

    if ($response->isRedirect()){
        $redirectionUrl = $response->getRedirectUrl();
        $transactionId = $response->getTransactionId();
        /**
         * redirect the user to $redurectionUrl and store $transactionId for later use
         */
    }
}catch(Exception $e){
    /**
     * something went wrong
     */
}
// after the user is redirected back to our site by OTP
<?php
include 'vendor/autoload.php';

$gateway = Omnipay\Omnipay::create("\\".Clapp\OtpHu\Gateway::class);

$gateway->setShopId("0199123456");
$gateway->setPrivateKey(file_get_contents('myShopKey.privKey.pem'));
$gateway->setTestMode(false);

try {
    $response = $gateway->completePurchase([
        'transactionId' => 'myTransactionId',
    ])->send();

    if ($response->isSuccessful()){
        /**
         * the user's payment was successful
         */
    }
    if ($response->isPending()){
        /**
         * the user's payment is still pending, we should try $gateway->completePurchase() later
         */
    }
    if ($response->isCancelled()){
        /**
         * the user cancelled the payment
         */
    }
    if ($response->isRejected()){
        /**
         * the payment gateway rejected the user's payment
         */
         $reasonCode = $response->getTransaction()->getRejectionReasonCode(); //OTP's error code string
         $reasonMessage = $response->getTransaction()->getRejectionReasonMessage(); //human readable string
    }
}catch(Exception $e){
    /**
     * something went wrong
     */
}

Documentation

In the /docs folder or on Github Pages.

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固