|
@@ -66,10 +66,31 @@ class Yspay extends Core
|
|
$this->log('支付回调-初始化', $input);
|
|
$this->log('支付回调-初始化', $input);
|
|
|
|
|
|
if ($sign == $string) {
|
|
if ($sign == $string) {
|
|
|
|
+ if (isset($input['billNo']) && $input['billNo']) {
|
|
|
|
+ $key = 'billNo';
|
|
|
|
+ } else {
|
|
|
|
+ $key = 'merOrderId';
|
|
|
|
+ }
|
|
if (isset($this->config['prefix']) && $this->config['prefix']) {
|
|
if (isset($this->config['prefix']) && $this->config['prefix']) {
|
|
- $input['merOrderId'] = str_replace($this->config['prefix'], '', $input['merOrderId']);
|
|
|
|
|
|
+ $input[$key] = str_replace($this->config['prefix'], '', $input[$key]);
|
|
|
|
+ }
|
|
|
|
+ if (!isset($input['status'])) {
|
|
|
|
+ echo 'FAILED';die;
|
|
|
|
+ }
|
|
|
|
+ $desc = '';
|
|
|
|
+ if ($input['status'] == 'TRADE_SUCCESS') {
|
|
|
|
+ # 成功
|
|
|
|
+ } if ($input['status'] == 'TRADE_REFUND') {
|
|
|
|
+ # 退款
|
|
|
|
+ echo 'SUCCESS';die;
|
|
|
|
+ } elseif ($input['status'] == 'TRADE_CLOSED') {
|
|
|
|
+ $desc = '交易关闭';
|
|
|
|
+ } elseif ($input['status'] == 'UNKNOWN') {
|
|
|
|
+ $desc = '不明确的交易状态';
|
|
|
|
+ } else {
|
|
|
|
+ echo 'FAILED';die;
|
|
}
|
|
}
|
|
- $this->updateOrder($input['merOrderId'], $input['totalAmount']);
|
|
|
|
|
|
+ $this->updateOrder($input[$key], $input['totalAmount']);
|
|
echo 'SUCCESS';die;
|
|
echo 'SUCCESS';die;
|
|
} else {
|
|
} else {
|
|
echo 'FAILED';die;
|
|
echo 'FAILED';die;
|
|
@@ -127,6 +148,8 @@ class Yspay extends Core
|
|
|
|
|
|
if ($type == 2) {
|
|
if ($type == 2) {
|
|
# 二维码支付
|
|
# 二维码支付
|
|
|
|
+ $request['subOrders']['billNo'] = $request['subOrders']['merOrderId'];
|
|
|
|
+ unset($request['subOrders']['merOrderId']);
|
|
$result = Base::get_pay_code($request, $this->config);
|
|
$result = Base::get_pay_code($request, $this->config);
|
|
|
|
|
|
if (isset($result['billQRCode'])) {
|
|
if (isset($result['billQRCode'])) {
|