data_request); // 响应内容 $res = ($ret['code'] == 0) ? $this->SuccessReturn() : $this->ErrorReturn(); // 支付响应日志 PayRequestLogService::PayRequestLogEnd($log_ret['data'], $ret, $res); // 结束运行 die($res); } /** * 成功返回 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 * @date 2019-09-12 * @desc description */ private function SuccessReturn() { // 支付插件是否自定义返回内容 $res = $this->ContentReturn('SuccessReturn'); // 结束输出 return empty($res) ? 'success' : $res; } /** * 失败返回 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 * @date 2019-09-12 * @desc description */ private function ErrorReturn() { // 支付插件是否自定义返回内容 $res = $this->ContentReturn('ErrorReturn'); // 结束输出 return empty($res) ? 'error' : $res; } /** * 输出支付插件自定义内容 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 * @date 2020-07-01 * @desc description * @param [string] $action [操作方法] */ private function ContentReturn($action) { $payment = 'payment\\'.PAYMENT_TYPE; if(class_exists($payment)) { $payment_obj = new $payment(); if(method_exists($payment_obj, $action)) { return $payment_obj->$action(); } } return ''; } } ?>