|
@@ -237,7 +237,13 @@ class Yspay extends Core
|
|
|
$request['subOrders']['totalAmount'] = $request['refundAmount'] - $request['platformAmount'];
|
|
|
$request['subOrders'] = array($request['subOrders']);
|
|
|
}
|
|
|
- $result = Base::refund($request, $this->config);
|
|
|
+
|
|
|
+ $account = Dever::db('pay/account')->find($order['account_id']);
|
|
|
+ $method = 'refund';
|
|
|
+ if ($account && $account['system_source'] == 4) {
|
|
|
+ $method = 'code_refund';
|
|
|
+ }
|
|
|
+ $result = Base::$method($request, $this->config);
|
|
|
|
|
|
if (isset($result['refundStatus']) && $result['refundStatus'] == 'SUCCESS') {
|
|
|
return true;
|
|
@@ -383,6 +389,9 @@ class Base
|
|
|
# 二维码支付
|
|
|
static $qrcode_url = 'v1/netpay/bills/get-qrcode';
|
|
|
|
|
|
+ # 二维码支付退款
|
|
|
+ static $qrcode_refund_url = 'v1/netpay/bills/refund';
|
|
|
+
|
|
|
|
|
|
//===================== 支付相关 ==============================
|
|
|
/**
|
|
@@ -407,6 +416,18 @@ class Base
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 二维码交易退款
|
|
|
+ */
|
|
|
+ static public function code_refund($param, $config)
|
|
|
+ {
|
|
|
+
|
|
|
+ $url = self::$qrcode_refund_url;
|
|
|
+ $result = self::get($url, $param, $config);
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 支付撤销
|
|
|
*/
|