作者 王智

修改

... ... @@ -420,15 +420,15 @@ class Common extends Api
$PayOrderInfo = Db::name('pay_order')->where('OrderSn', $OrderSn['OrderSn'])->where('type', 1)->find();
$TuiMoney = $OrderSn['UpMoney'] + $OrderSn['Money'];
//配置
// $config = [
//// 'payment' => [
// 'app_id' => 'wx6a9080f20326f817',
// 'merchant_id' => '1603658973',
// 'key' => '8695A8185xyzKcdEVfreewayShenzhen',
// 'cert_path' => '/home/wwwroot/fast/book/addons/epay/certs/apiclient_cert.pem', // XXX: 绝对路径!!!!
// 'key_path' => '/home/wwwroot/fast/book/addons/epay/certs/apiclient_key.pem', // XXX: 绝对路径!!!!
//// ],
// ];
$config = [
'app_id' => 'wx6a9080f20326f817',
'payment' => [
'merchant_id' => '1603658973',
'key' => '8695A8185xyzKcdEVfreewayShenzhen',
'cert_path' => '/home/wwwroot/fast/book/addons/epay/certs/apiclient_cert.pem', // XXX: 绝对路径!!!!
'key_path' => '/home/wwwroot/fast/book/addons/epay/certs/apiclient_key.pem', // XXX: 绝对路径!!!!
],
];
$app = Factory::officialAccount($config);
try {
$result = $app->refund->byTransactionId($PayOrderInfo['WeChatOrder'], $PayOrderInfo['PayOrder'], $PayOrderInfo['money'] * 100, $TuiMoney * 100); // 总金额 100, 退款 80,操作员:商户号
... ...