farhan928/yii2-ipay88 问题修复 & 功能扩展

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

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

farhan928/yii2-ipay88

Composer 安装命令:

composer require farhan928/yii2-ipay88

包简介

Yii2 extension for iPay88 payment gateway

README 文档

README

Yii2 extension for iPay88 payment gateway

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require farhan928/yii2-ipay88 "^1.0.0"

or add

"farhan928/yii2-ipay88": "^1.0.0"

to the require section of your composer.json file.

Release Changes

NOTE: Refer the CHANGE LOG for details on changes to various releases.

Usage

Add this to the alias section of your main config.

'aliases' => [
    ...
    '@farhan928/Ipay88' => '@vendor/farhan928/yii2-ipay88/src',
    ...
],

and add this code below to the module section of your main config.

'modules' => [
    ...
    'ipay88' => [
            'class' => 'farhan928\Ipay88\Module',
            'layout' => 'default',
            'authMode' => 'db', //db or config, default to config         
            'entityTable' => 'user', // only set if authMode is db        
            'entityNameColumn' => 'name', // only set if authMode is db        
            'merchantKey' => 'YourMerchantKey', // only set if authMode is config
            'merchantCode' => 'YourMerchantCode', // only set if authMode is config
            'testMode' => false, // if set to true, all transactions will use amount 1.00
            'schema' => 'http', // default to http. 
            'on backendPost' => function ($event) {              
                // optional - event triggered when there is a backend post                
                // use $event->payload to get the post data from ipay88
                // write your code here
            },
        ],           
    ],
    ...
],

Add this code to the urlManager rules section.

'urlManager' => [
    ...
    'rules' => [
        ...
        'ipay88/<controller:\w+>/<id:\d+>' => 'ipay88/<controller>/index',
        'ipay88/<controller:\w+>/<action:\w+>/<id:\d+>' => 'ipay88/<controller>/<action>',
        'ipay88/<controller:\w+>/<action:\w+>' => 'ipay88/<controller>/<action>',
        ...
    ]
]

Run migration files

php yii migrate --migrationPath=@farhan928/Ipay88/migrations

If authMode is set to db, you can go to http://your.app.url/index.php?r=ipay88/config to add your entity configuration such as the merchant code and merchant key

Examples

Create a payment Request

$create_request = $ipay88->setEntityId(1) // optional 
    ->setRefNo('ABC123') // optional. if leave null or not set, will auto generate.
    ->setAmount(1)
    ->setProdDesc('Product Description')
    ->setUserName('Your User Name')
    ->setUserEmail('youruser@email.com')
    ->setUserContact('012123123123')
    ->setRedirectUrl('http://yourredirecturl.com')
    ->setRemark('Remark') // optional
    ->createRequest();

Will return iPay88 object with payment URL. Redirect to the payment URL to proceed with payment.

License

yii2-ipay88 is released under the BSD-4-Clause License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-4-Clause
  • 更新时间: 2019-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固