2017 © Pedro Peláez
 

yii2-extension alipay

yii2支付宝支付扩展

image

xplalipay/alipay

yii2支付宝支付扩展

  • Sunday, April 1, 2018
  • by q490880
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

yii2-alipay

yii2支付宝支付扩展, (*1)

CHANGE LOG, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require xplalipay/alipay

or add, (*5)

"xplalipay/alipay": "*"

to the require section of your composer.json., (*6)

Configuration

To use this extension, simply add the following code in your application configuration:, (*7)

return [
    //....
    'components' => [
        'alipay'=>[
            'class'=>'xplalipay\alipay\Alipay',
            'back_url'=> '回调地址',
            'gateway_url' => 'https://openapi.alipay.com/gateway.do',
            'app_id' => 'APPID',
            'rsa_private_key' => '私钥',
            'format' => 'json',
            'charset'=>'UTF-8',
            'sign_type'=>"RSA2",
            'alipayrsa_public_key' => "公钥"
        ],
    ],
];

[获取支付密钥]

$token = \Yii::$app->alipay->sdkExecute([
                'body'=>'商品描述',
                'subject'=>'商品名称',
                'out_trade_no'=>'订单号',
                'timeout_express'=>'1h',
                'total_amount'=>'金额(元)',
                'product_code'=>'QUICK_MSECURITY_PAY',
            ]);
将获取到的密钥给客户端返回即可

[回调代码]

$resultNotify = \Yii::$app->alipay->notify();
        $result = false;
        if($resultNotify){
            $notifyData = \Yii::$app->request->post();
            $result = "回调逻辑";
        }
        if($result){
            echo 'SUCCESS';
        }else{
            echo 'ERROR';
        }

The Versions

01/04 2018

dev-master

9999999-dev

yii2支付宝支付扩展

  Sources   Download

MIT

The Requires

 

by XuPengLiang

yii2 alipay

01/04 2018

v0.1

0.1.0.0

yii2支付宝支付扩展

  Sources   Download

MIT

The Requires

 

by XuPengLiang

yii2 alipay