kriss / yii2-bd-payment
Yii2 必答支付的组件
Installs: 100
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.13
- yiisoft/yii2-httpclient: ^2.0
README
Yii2 必答支付的组件,仅适用于
必答支付
Installation
php composer.phar require --prefer-dist kriss/yii2-bd-payment -vvv
Basic Usage
Config
use kriss\bd\payment\Payment; $config = [ 'components' => [ Payment::COMPONENT_NAME => [ 'class' => Payment::class, 'ak' => 'ak_20180110171926539048', 'sk' => 'sk_609706e2f87affb77eefe5abd799057x', 'logCategory' => 'bd-pay', 'isTest' => true, 'version' => '2.0', ] ] ]
Get Component
$payment = Payment::getInstance();
Start Pay
see OrderPayForm.php
Handle Notify
Use More Than One Component
Create another class extend Payment
namespace common\components; use kriss\bd\payment\Payment; class AnotherPayment extends Payment { const COMPONENT_NAME = 'another-db-payment'; }
Config
use kriss\bd\payment\Payment; $config = [ 'components' => [ Payment::COMPONENT_NAME => [ 'class' => Payment::class, 'ak' => 'ak_20180110171926539048', 'sk' => 'sk_609706e2f87affb77eefe5abd799057x', 'logCategory' => 'bd-pay', 'isTest' => true, 'version' => '2.0', ], AnotherPayment::COMPONENT_NAME => [ 'class' => AnotherPayment::class, 'ak' => 'ak_20180110171926539049', 'sk' => 'sk_609706e2f87affb77eefe5abd799057y', 'logCategory' => 'another-bd-pay', 'isTest' => true, 'version' => '2.0', ], ] ]
Get Component
$payment = Payment::getInstance(); $anotherPayment = AnotherPayment::getInstance();