dev-master
9999999-devyii2支付宝支付扩展
MIT
The Requires
by XuPengLiang
yii2 alipay
v0.1
0.1.0.0yii2支付宝支付扩展
MIT
The Requires
by XuPengLiang
yii2 alipay
Wallogit.com
2017 © Pedro Peláez
yii2支付宝支付扩展
yii2支付宝支付扩展, (*1)
CHANGE LOG, (*2)
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)
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';
}
yii2支付宝支付扩展
MIT
yii2 alipay
yii2支付宝支付扩展
MIT
yii2 alipay