|
|
@@ -3,6 +3,7 @@
|
|
|
namespace hd\controllers;
|
|
|
|
|
|
use common\components\dict;
|
|
|
+use common\components\noticeUtil;
|
|
|
use common\components\payUtil;
|
|
|
use Yii;
|
|
|
use common\components\util;
|
|
|
@@ -45,6 +46,37 @@ class NoticeController extends PublicController
|
|
|
echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
|
|
|
}
|
|
|
|
|
|
+ //微信退款结果通知
|
|
|
+ public function actionWxRefundCallback()
|
|
|
+ {
|
|
|
+ $postStr = file_get_contents('php://input');//接收微信服务器返回的xml消息体
|
|
|
+ if (empty($postStr)) {
|
|
|
+ util::end();
|
|
|
+ }
|
|
|
+ $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
|
|
|
+ if ($postObj->return_code != 'SUCCESS') {
|
|
|
+ $msg = $postObj->return_msg ?? '';
|
|
|
+ $text = '微信退款结果通知,报错了,报错内容:' . $msg;
|
|
|
+ Yii::warning($text);
|
|
|
+ noticeUtil::push($text, '15280215347');
|
|
|
+ util::end();
|
|
|
+ }
|
|
|
+ $orderSn = $postObj->out_trade_no ?? '';
|
|
|
+ $out_refund_no = $postObj->out_refund_no ?? '';
|
|
|
+ //订单总金额
|
|
|
+ $total_fee = $postObj->total_fee ?? 0.00;
|
|
|
+ //申请退款金额
|
|
|
+ //$refund_fee = $postObj->refund_fee ?? 0.00;
|
|
|
+ //退款金额
|
|
|
+ $settlement_refund_fee = $postObj->settlement_refund_fee ?? 0.00;
|
|
|
+
|
|
|
+ $text = "退款单号:{$orderSn} {$out_refund_no} 订单金额:{$total_fee} 退款金额:{$settlement_refund_fee} 已退款成功";
|
|
|
+
|
|
|
+ noticeUtil::push($text, '15280215347');
|
|
|
+
|
|
|
+ echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
|
|
|
+ }
|
|
|
+
|
|
|
//支付宝异步通知
|
|
|
public function actionAliCallback()
|
|
|
{
|