| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\common\controllers;
- use app\models\ReOrder;
- use app\modules\common\models\NotifyForm;
- use app\utils\OrderNo;
- use app\utils\Wechat\Wechat;
- use app\utils\Wechat\WechatProfit;
- use app\utils\Wechat\WechatShare;
- use EasyWeChat\Kernel\Exceptions\Exception;
- use EasyWeChat\Kernel\BaseClient;
- use yii\web\Controller;
- use app\utils\IotCloudHelper;
- use app\models\Store;
- use app\models\OrderUnion;
- use app\models\Order;
- use app\models\WechatConfig;
- use app\modules\common\models\WechatNotifyForm;
- /**
- * 微信回调类
- * Class WechatNotifyController
- * @package app\modules\common\controllers
- */
- class WechatNotifyController extends Controller
- {
- public static $plugins = [
- 'SC' => '\app\plugins\scanCodePay\controllers\CallbackController::execute'
- ];
- public function actionTest() {
- $a = \app\utils\Wechat\B2b\B2bPay::find(297, 'ML20250318094814299906');
- // $b = \app\utils\Wechat\B2b\B2bPay::notify($msg);
- // $c = \app\utils\Wechat\B2b\B2bPay::getretailopenidlist(297);
- $c = \app\utils\Wechat\B2b\B2bPay::setmchprofitrate(297, 20);
- var_dump($a, $b, $c);die;
- }
- /**
- * 入口文件
- * @throws \Exception
- */
- public function actionIndex() {
- $store_id = get_params('store_id');
- $xml = simplexml_load_string(\Yii::$app->request->getRawBody());
- \Yii::error(['WECHAT NOTIFY INDEX <==========> ', \Yii::$app->request->getRawBody()]);
- return (new WechatNotifyForm())->notifyIndex($store_id, $xml);
- }
- private function pluginCallback($message, $orderNoHead) {
- call_user_func(self::$plugins[$orderNoHead], $message);
- }
- }
|