From d0a07b20192fcbced29f3ee78d61b195fa454d58 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 12 Sep 2019 11:32:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BE=E5=BA=A6=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=9C=AA=E8=BF=9B=E5=85=A5=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Ordernotify.php | 52 +++++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/application/api/controller/Ordernotify.php b/application/api/controller/Ordernotify.php index dc0239794..c9f7cc9a9 100755 --- a/application/api/controller/Ordernotify.php +++ b/application/api/controller/Ordernotify.php @@ -46,9 +46,57 @@ class OrderNotify extends Common $ret = OrderService::Notify($this->data_request); if($ret['code'] == 0) { - exit('success'); + $this->SuccessReturn(); } - exit('error'); + $this->ErrorReturn(); + } + + /** + * 成功返回 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-09-12 + * @desc description + */ + private function SuccessReturn() + { + // 根据支付方式处理成功返回结果 + $content = 'success'; + switch(PAYMENT_TYPE) + { + // 百度 + case 'BaiduMini' : + $content = '{"errno":0,"msg":"success","data":{"isConsumed":2}}'; + break; + } + + // 默认success + exit($content); + } + + /** + * 失败返回 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-09-12 + * @desc description + */ + private function ErrorReturn() + { + // 根据支付方式处理异步返回结果 + $content = 'error'; + switch(PAYMENT_TYPE) + { + // 百度,当处理失败也处理成功消费,需管理员手工处理订单状态或者走其它方式进行处理退款操作 + case 'BaiduMini' : + $content = '{"errno":0,"msg":"success","data":{"isConsumed":2}}'; + break; + } + + // 默认error + exit($content); } } ?> \ No newline at end of file