diff --git a/app/data/service/PaymentService.php b/app/data/service/PaymentService.php index 03792ec10..c679a69d5 100644 --- a/app/data/service/PaymentService.php +++ b/app/data/service/PaymentService.php @@ -171,10 +171,10 @@ abstract class PaymentService extends Service /** * 支付通知处理 - * @param string $type + * @param string $param 支付通道-支付编号 * @return string */ - abstract public function notify(string $type = ''): string; + abstract public function notify(string $param = ''): string; /** * 订单主动查询 diff --git a/app/data/service/payment/AliPaymentService.php b/app/data/service/payment/AliPaymentService.php index d538ed61f..a623e72ec 100644 --- a/app/data/service/payment/AliPaymentService.php +++ b/app/data/service/payment/AliPaymentService.php @@ -63,19 +63,19 @@ class AliPaymentService extends PaymentService /** * 支付结果处理 - * @param string $type 支付通道 + * @param string $param 支付通道 * @return string * @throws \WeChat\Exceptions\InvalidResponseException * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ - public function notify(string $type = ''): string + public function notify(string $param = ''): string { - if (is_numeric(stripos($type, '-'))) { - [$payType, $payId] = explode('-', $type); + if (is_numeric(stripos($param, '-'))) { + [$payType, $payId] = explode('-', $param); } else { - [$payType, $payId] = [$type ?: static::$type, static::$id]; + [$payType, $payId] = [$param ?: static::$type, static::$id]; } $notify = \AliPay\App::instance($this->params)->notify(); if (in_array($notify['trade_status'], ['TRADE_SUCCESS', 'TRADE_FINISHED'])) { diff --git a/app/data/service/payment/JoinPaymentService.php b/app/data/service/payment/JoinPaymentService.php index 82b429ba5..ade8fd59a 100644 --- a/app/data/service/payment/JoinPaymentService.php +++ b/app/data/service/payment/JoinPaymentService.php @@ -125,18 +125,18 @@ class JoinPaymentService extends PaymentService /** * 支付结果处理 - * @param string $type 支付通道 + * @param string $param 支付通道 * @return string * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ - public function notify(string $type = ''): string + public function notify(string $param = ''): string { - if (is_numeric(stripos($type, '-'))) { - [$payType, $payId] = explode('-', $type); + if (is_numeric(stripos($param, '-'))) { + [$payType, $payId] = explode('-', $param); } else { - [$payType, $payId] = [$type ?: static::$type, static::$id]; + [$payType, $payId] = [$param ?: static::$type, static::$id]; } $notify = $this->app->request->get(); foreach ($notify as &$item) $item = urldecode($item); diff --git a/app/data/service/payment/WechatPaymentService.php b/app/data/service/payment/WechatPaymentService.php index 203cf2ae2..20a90dab6 100644 --- a/app/data/service/payment/WechatPaymentService.php +++ b/app/data/service/payment/WechatPaymentService.php @@ -100,19 +100,19 @@ class WechatPaymentService extends PaymentService /** * 支付结果处理 - * @param string $type 支付通道 + * @param string $param 支付通道 * @return string * @throws \WeChat\Exceptions\InvalidResponseException * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ - public function notify(string $type = ''): string + public function notify(string $param = ''): string { - if (is_numeric(stripos($type, '-'))) { - [$payType, $payId] = explode('-', $type); + if (is_numeric(stripos($param, '-'))) { + [$payType, $payId] = explode('-', $param); } else { - [$payType, $payId] = [$type ?: static::$type, static::$id]; + [$payType, $payId] = [$param ?: static::$type, static::$id]; } $notify = $this->payment->getNotify(); if ($notify['result_code'] == 'SUCCESS' && $notify['return_code'] == 'SUCCESS') {