修复支付回调报错和退款后台配置理由报错

This commit is contained in:
sugar1569 2018-11-06 13:05:39 +08:00
parent 2ec4818d21
commit 238b06279d
6 changed files with 15 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -77,8 +77,9 @@ class AuthApi extends AuthController{
* 获取退款理由
*/
public function get_refund_reason(){
$reason = SystemConfig::getValue('refund_reason')?:[];//退款理由
$reason = explode('=',$reason);
$reason = SystemConfig::getValue('stor_reason')?:[];//退款理由
$reason = str_replace("\r\n","\n",$reason);//防止不兼容
$reason = explode("\n",$reason);
return JsonService::successful($reason);
}
@ -861,6 +862,7 @@ class AuthApi extends AuthController{
}
}
/**
* 申请退款
* @param string $uni

View File

@ -4,6 +4,7 @@ use behavior\wechat\PaymentBehavior;
use service\HookService;
use service\RoutineNotify;
/**
* 小程序支付回调
* Class Routine

View File

@ -113,6 +113,11 @@ class PaymentBehavior
WechatService::payOrderRefund($orderNo,$opt);
}
/**
* 小程序支付订单退款
* @param $orderNo
* @param array $opt
*/
public static function routinePayOrderRefund($orderNo, array $opt)
{
$refundDesc = isset($opt['desc']) ? $opt['desc'] : '';

View File

@ -22,6 +22,7 @@ class RoutineRefund
* @param string $refundDesc 退款原因
* @return string
*/
public static function doRefund($totalFee, $refundFee, $refundNo, $wxOrderNo='',$orderNo='',$refundDesc = '')
{
$config = array(
@ -94,11 +95,11 @@ class RoutineRefund
//默认格式为PEM可以注释
curl_setopt($ch,CURLOPT_SSLCERTTYPE,'PEM');
// curl_setopt($ch,CURLOPT_SSLCERT,getcwd().'/cert/apiclient_cert.pem');
curl_setopt($ch,CURLOPT_SSLCERT,realpath('.'.self::options()['pay_routine_client_cert'][0]));
curl_setopt($ch,CURLOPT_SSLCERT,realpath('.'.self::options()['pay_routine_client_cert']));
//默认格式为PEM可以注释
curl_setopt($ch,CURLOPT_SSLKEYTYPE,'PEM');
// curl_setopt($ch,CURLOPT_SSLKEY,getcwd().'/cert/apiclient_key.pem');
curl_setopt($ch,CURLOPT_SSLKEY,realpath('.'.self::options()['pay_routine_client_key'][0]));
curl_setopt($ch,CURLOPT_SSLKEY,realpath('.'.self::options()['pay_routine_client_key']));
//第二种方式,两个文件合成一个.pem文件
// curl_setopt($ch,CURLOPT_SSLCERT,getcwd().'/all.pem');
$data = curl_exec($ch);

View File

@ -2,6 +2,7 @@
namespace service;
use think\Url;
/**
* 小程序支付
* Created by PhpStorm.