@@ -1,35 +0,0 @@ | |||
<?php | |||
namespace addons\config; | |||
class AliPayConfig | |||
{ | |||
public static $env= "wendy"; | |||
private static $wendy=[ | |||
"ali_app_id"=>"2021001199650201", | |||
"ali_notify_url"=>"http://internalsales.iicn.co/addons/unishop/pay/notify/type/alipay", | |||
"ali_return_url"=>"http://internalsales.iicn.co/h5/#/pages/order/order?state=0", | |||
"ali_public_key"=>"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ttBosJiuTgQkLBu03CgkJ0FHXiiN6iYnWof2U8Qzcg/oIJDdfeb7KnpjHRblqoD108GrsfU8pfHwuqt65OeH0e+gQPQj2GRaQ2XrWqp3kitbFRfWHAcAoE81kHkLjKtUKDgx1afOmiybRJMryNBy9uPn5bUZLSIlMDr/GD6Hq+Z6p0ZAswCBFpZs2GTlPaDXHM/oOPDZEzNkdI05CDTSDCyjg2jCfQHZb6ItM6Xc3fPjbMoSd4quw/z3uqbfnIx62Bc0j7DbLJeup/ItCjuHaZ5gd0ITQPPEQQSxrYCaRKctC88JyW/wmPT/onSuVX/WWUdPOMIS1sZdyecjKncPwIDAQAB", | |||
"ali_private_key"=>"MIIEowIBAAKCAQEA0ttBosJiuTgQkLBu03CgkJ0FHXiiN6iYnWof2U8Qzcg/oIJDdfeb7KnpjHRblqoD108GrsfU8pfHwuqt65OeH0e+gQPQj2GRaQ2XrWqp3kitbFRfWHAcAoE81kHkLjKtUKDgx1afOmiybRJMryNBy9uPn5bUZLSIlMDr/GD6Hq+Z6p0ZAswCBFpZs2GTlPaDXHM/oOPDZEzNkdI05CDTSDCyjg2jCfQHZb6ItM6Xc3fPjbMoSd4quw/z3uqbfnIx62Bc0j7DbLJeup/ItCjuHaZ5gd0ITQPPEQQSxrYCaRKctC88JyW/wmPT/onSuVX/WWUdPOMIS1sZdyecjKncPwIDAQABAoIBADdRwtSavx/s75umTk023UlTiMYEojqMBw41i4mNztDOWrMXue83OTdMFLP+yxCqJjvUxeIRF3NWE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kqEuM6aEcitLi6fLRJyrVjqfdcyI+GY7Yy8AzJZkFJvV9H/cI0kotXxQNiA6lJnK", | |||
"ali_sandbox"=>0 | |||
]; | |||
private static $Lan=[ | |||
"ali_app_id"=>"2021001199650201", | |||
"ali_notify_url"=>"http://internalsales.iicn.co/addons/unishop/pay/notify/type/alipay", | |||
"ali_return_url"=>"http://internalsales.iicn.co/h5/#/pages/order/order?state=0", | |||
"ali_public_key"=>"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ttBosJiuTgQkLBu03CgkJ0FHXiiN6iYnWof2U8Qzcg/oIJDdfeb7KnpjHRblqoD108GrsfU8pfHwuqt65OeH0e+gQPQj2GRaQ2XrWqp3kitbFRfWHAcAoE81kHkLjKtUKDgx1afOmiybRJMryNBy9uPn5bUZLSIlMDr/GD6Hq+Z6p0ZAswCBFpZs2GTlPaDXHM/oOPDZEzNkdI05CDTSDCyjg2jCfQHZb6ItM6Xc3fPjbMoSd4quw/z3uqbfnIx62Bc0j7DbLJeup/ItCjuHaZ5gd0ITQPPEQQSxrYCaRKctC88JyW/wmPT/onSuVX/WWUdPOMIS1sZdyecjKncPwIDAQAB", | |||
"ali_private_key"=>"MIIEowIBAAKCAQEA0ttBosJiuTgQkLBu03CgkJ0FHXiiN6iYnWof2U8Qzcg/oIJDdfeb7KnpjHRblqoD108GrsfU8pfHwuqt65OeH0e+gQPQj2GRaQ2XrWqp3kitbFRfWHAcAoE81kHkLjKtUKDgx1afOmiybRJMryNBy9uPn5bUZLSIlMDr/GD6Hq+Z6p0ZAswCBFpZs2GTlPaDXHM/oOPDZEzNkdI05CDTSDCyjg2jCfQHZb6ItM6Xc3fPjbMoSd4quw/z3uqbfnIx62Bc0j7DbLJeup/ItCjuHaZ5gd0ITQPPEQQSxrYCaRKctC88JyW/wmPT/onSuVX/WWUdPOMIS1sZdyecjKncPwIDAQABAoIBADdRwtSavx/s75umTk023UlTiMYEojqMBw41i4mNztDOWrMXue83OTdMFL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6PXBQo/sX3IENT0kHL0XkqEuM6aEcitLi6fLRJyrVjqfdcyI+GY7Yy8AzJZkFJvV9H/cI0kotXxQNiA6lJnK", | |||
"ali_sandbox"=>0 | |||
]; | |||
public static function getByName($name){ | |||
if (static::$env=="wendy") { | |||
return static::$wendy[$name]; | |||
}else{ | |||
return static::$Lan[$name]; | |||
} | |||
} | |||
} |
@@ -1,7 +1,5 @@ | |||
<?php | |||
use addons\config\AliPayConfig; | |||
return array ( | |||
0 => | |||
array ( | |||
@@ -40,11 +38,11 @@ return array ( | |||
), | |||
'value' => | |||
array ( | |||
'app_id' => AliPayConfig::getByName('ali_app_id'), | |||
'notify_url' => AliPayConfig::getByName('ali_notify_url'), | |||
'return_url' => AliPayConfig::getByName('ali_return_url'), | |||
'ali_public_key' => AliPayConfig::getByName('ali_public_key'), | |||
'private_key' => AliPayConfig::getByName('ali_private_key'), | |||
'app_id' => '2021001199650201', | |||
'notify_url' => 'http://internalsales.iicn.co/addons/unishop/pay/notify/type/alipay', | |||
'return_url' => 'http://internalsales.iicn.co/h5/#/pages/order/order?state=0', | |||
'ali_public_key' => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq8N4o64A4Wt434t3n2ohBgkulg3DDshTjeiAjSe40R4hyhYtatw6zvVbLHkFedlv9H2xcO/gp4+2AdNlP2w8hskc5IowEfnslLyZlL9TK/Ye6kG7MExbywdmC/E8FI0QIsuD4LECrzPFCDOwf+zoi/7b6B7NA6GkEP05N2N02e2PjucD4QyN1I797DEA+FocpKm2/10WnCSBDfaEA56k/yLCwNyV+DOwxX1DAhm10Kdzew/0souOcmo0nsztg+ZWqDk64/CHco/n/fqFENNdLfm550OU5MtjWf+wsytSxRhcQ1MprSlmRAbgoaQ4fP6RakKMYgFc/7lL3sT3m6nIBQIDAQAB', | |||
'private_key' => 'MIIEowIBAAKCAQEA0ttBosJiuTgQkLBu03CgkJ0FHXiiN6iYnWof2U8Qzcg/oIJDdfeb7KnpjHR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4edYWpLhGEicLbIrIpShGz3kUU8RgkSo3yNImgRBY3Bidcfr6oHwCXpAnUBO4NNqMDqZcdt4r3zLcDzkCgYAuheUPNdZyIQIFxdLUhl5opkPF5Rx1GQ6qon5cqWnDkBG+/peqraxWOkyBWN7jkQSebwp+i40denrIsGx6y2kv5GlsDn2Vu2q0t/ufVCXdl6Y6nmv7ke6jdikejLIA+9AChI/fe+O2W9Vxb65vn1I29+KNLWSYRHvhLsaxW/qRmQKBgHsLvFDC95PWDcWXxR10JjPb/QHhrZBEjXPYEsqPryrvFtuohG/D2vKPltKrEh5xGOW5Xx02vPkLL3mf+92DMKVZ6PXBQo/sX3IENT0kHL0XkqEuM6aEcitLi6fLRJyrVjqfdcyI+GY7Yy8AzJZkFJvV9H/cI0kotXxQNiA6lJnK', | |||
'log' => '1', | |||
), | |||
'rule' => 'required', | |||
@@ -2,7 +2,6 @@ | |||
namespace Yansongda\Pay\Gateways\Alipay; | |||
use addons\config\AliPayConfig; | |||
use Yansongda\Pay\Contracts\GatewayInterface; | |||
use Yansongda\Pay\Exceptions\GatewayException; | |||
use Yansongda\Pay\Exceptions\InvalidArgumentException; | |||
@@ -54,8 +53,8 @@ abstract class Alipay implements GatewayInterface | |||
'charset' => 'UTF-8', | |||
'sign_type' => 'RSA2', | |||
'version' => '1.0', | |||
'notify_url' => AliPayConfig::getByName('ali_notify_url'), | |||
'return_url' => AliPayConfig::getByName('ali_return_url'), | |||
'notify_url' => \addons\unishop\model\Config::getByName('ali_notify_url')['value'], | |||
'return_url' => \addons\unishop\model\Config::getByName('ali_return_url')['value'], | |||
'timestamp' => date('Y-m-d H:i:s'), | |||
'sign' => '', | |||
'biz_content' => '', | |||
@@ -17,8 +17,7 @@ | |||
namespace addons\nzf; | |||
use addons\config\AliPayConfig; | |||
use addons\unishop\model\Config; | |||
class AliPay | |||
{ | |||
@@ -163,7 +162,7 @@ class AliPay | |||
private static function getSysParams() | |||
{ | |||
//组装系统参数 | |||
$sysParams["app_id"] = AliPayConfig::getByName('ali_app_id'); | |||
$sysParams["app_id"] = Config::getByName('ali_app_id')['value']; | |||
$sysParams["version"] = '1.0'; | |||
$sysParams["format"] = 'json'; | |||
$sysParams["sign_type"] = 'RSA2'; | |||
@@ -171,8 +170,8 @@ class AliPay | |||
$sysParams["timestamp"] = date("Y-m-d H:i:s"); | |||
$sysParams["alipay_sdk"] = 'alipay-sdk-php-20160411'; | |||
$sysParams["prod_code"] = ''; | |||
$sysParams["notify_url"] = AliPayConfig::getByName('ali_notify_url'); | |||
$sysParams["return_url"] = AliPayConfig::getByName('ali_return_url'); | |||
$sysParams["notify_url"] = Config::getByName('ali_notify_url')['value']; | |||
$sysParams["return_url"] = Config::getByName('ali_return_url')['value']; | |||
$sysParams["charset"] = "utf-8"; | |||
return $sysParams; | |||
} | |||
@@ -213,7 +212,7 @@ class AliPay | |||
unset($params['sign']); | |||
} | |||
$content = self::getSignContent($params); | |||
$priKey = AliPayConfig::getByName('ali_private_key'); | |||
$priKey = Config::getByName('ali_private_key')['value']; | |||
// $res = "-----BEGIN RSA PRIVATE KEY-----\n" . | |||
// wordwrap($priKey, 64, "\n", true) . | |||
// "\n-----END RSA PRIVATE KEY-----"; | |||
@@ -9,7 +9,6 @@ | |||
namespace addons\unishop\controller; | |||
use addons\config\AliPayConfig; | |||
use addons\epay\library\Service; | |||
use addons\nzf\AliPay; | |||
use addons\unishop\extend\Ali; | |||
@@ -104,8 +103,8 @@ class Pay extends Base | |||
'orderid' => $order->out_trade_no, | |||
'type' => "wechat", | |||
'title' => $body, | |||
'notifyurl' => AliPayConfig::getByName('notify_url'), | |||
'returnurl' => AliPayConfig::getByName('ali_return_url'), | |||
'notifyurl' => Config::getByName('notify_url')['value'], | |||
'returnurl' => Config::getByName('ali_return_url')['value'], | |||
'trade_type' => $trade_type, | |||
]; | |||
@@ -230,8 +229,8 @@ class Pay extends Base | |||
'orderid' => $order->out_trade_no, | |||
'type' => "alipay", | |||
'title' => $body, | |||
'notifyurl' => AliPayConfig::getByName('ali_notify_url'), | |||
'returnurl' => AliPayConfig::getByName('ali_return_url'), | |||
'notifyurl' => Config::getByName('ali_notify_url')['value'], | |||
'returnurl' => Config::getByName('ali_return_url')['value'], | |||
'method' => "wap", | |||
]; | |||
@@ -10,7 +10,7 @@ | |||
namespace addons\unishop\extend; | |||
use addons\config\AliPayConfig; | |||
use addons\unishop\model\Config; | |||
use Yansongda\Pay\Pay; | |||
class Ali | |||
@@ -18,12 +18,12 @@ class Ali | |||
public static function initAliPay() | |||
{ | |||
$config = [ | |||
'app_id' => AliPayConfig::getByName('ali_app_id'), | |||
'notify_url' => AliPayConfig::getByName('ali_notify_url'), | |||
'return_url' => AliPayConfig::getByName('ali_return_url'), | |||
'ali_public_key' => AliPayConfig::getByName('ali_public_key'), | |||
'app_id' => Config::getByName('ali_app_id')['value'], | |||
'notify_url' => Config::getByName('ali_notify_url')['value'], | |||
'return_url' => Config::getByName('ali_return_url')['value'], | |||
'ali_public_key' => Config::getByName('ali_public_key')['value'], | |||
// 加密方式: **RSA2** | |||
'private_key' => AliPayConfig::getByName('ali_private_key'), | |||
'private_key' => Config::getByName('ali_private_key')['value'], | |||
// 'log' => [ // optional | |||
// 'file' => './logs/alipay.log', | |||
// 'level' => 'info', // 建议生产环境等级调整为 info,开发环境为 debug | |||
@@ -38,7 +38,7 @@ class Ali | |||
//'mode' => 'dev', // optional,设置此参数,将进入沙箱模式 | |||
]; | |||
if (AliPayConfig::getByName('ali_sandbox') == 1) { | |||
if (Config::getByName('ali_sandbox')['value'] == 1) { | |||
$config['mode'] = 'dev'; | |||
} | |||