金波菜 官方支付宝配置

master
tping 5 years ago
parent df81c76b99
commit 20b17fdd9e

@ -40,7 +40,12 @@ class Notify2Controller extends BaseController
} }
Vendor('Alipay.AopSdk'); Vendor('Alipay.AopSdk');
$aop = new \AopClient(); $aop = new \AopClient();
$aop->alipayrsaPublicKey = file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt");
// $aop->alipayrsaPublicKey = file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt");
$aop->alipayrsaPublicKey = C('alipay.pub_secret');
if (!$aop->alipayrsaPublicKey) {
$aop->alipayrsaPublicKey = file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt");
}
$result = $aop->rsaCheckV1($notify,'','RSA2'); $result = $aop->rsaCheckV1($notify,'','RSA2');
if ($result) { if ($result) {
//获取回调订单信息 //获取回调订单信息

@ -116,7 +116,14 @@ class Pay
$aop = new \AopClient(); $aop = new \AopClient();
$aop->appId = C('alipay.appid'); $aop->appId = C('alipay.appid');
$aop->signType = 'RSA2'; $aop->signType = 'RSA2';
$aop->rsaPrivateKey = file_get_contents("./Application/Sdk/SecretKey/alipay/rsa2_private_key.txt"); $aop->rsaPrivateKey = C('alipay.pri_secret');
if (!$aop->rsaPrivateKey) {
$aop->rsaPrivateKey = file_get_contents("./Application/Sdk/SecretKey/alipay/rsa2_private_key.txt");
}
$aop->alipayrsaPublicKey = C('alipay.pub_secret');
if (!$aop->alipayrsaPublicKey) {
$aop->alipayrsaPublicKey = file_get_contents("./Application/Sdk/SecretKey/alipay/alipay2_public_key.txt");
}
$type = $vo->getPayMethod(); $type = $vo->getPayMethod();
//file_put_contents(dirname(__FILE__) . '/newbuildRequestForm.txt',json_encode($vo->getOrderNo())); //file_put_contents(dirname(__FILE__) . '/newbuildRequestForm.txt',json_encode($vo->getOrderNo()));
switch ($type) { switch ($type) {

Loading…
Cancel
Save