| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- namespace app\controller\api;
- use app\extra\basic\Base;
- use LinFly\Annotation\Route\Controller;
- use LinFly\Annotation\Route\Route;
- use support\Request;
- use support\Response;
- #[Controller(prefix: "/notify")]
- class Notify extends Base
- {
- /**
- * 退款回调
- * @param Request $request
- * @return Response
- */
- #[Route(path: "refund",methods: "post")]
- public function notifyRefund(Request $request)
- {
- try {
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- /**
- * 订单支付
- */
- #[Route(path: "wx",methods: "post")]
- public function notifyWx(Request $request)
- {
- try {
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- /**
- * 充值并支付
- */
- #[Route(path: "payrecharge",methods: "post")]
- public function notifyPayRecharge(Request $request)
- {
- try {
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- /**
- * 会员卡充值
- */
- #[Route(path: "recharge",methods: "post")]
- public function notifyDataRecharge(Request $request)
- {
- try {
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- /**
- * 小程序配置
- * @return array
- */
- protected function getWxConfig(): array
- {
- return [
- 'token' => 'test',
- 'appid' => sConf("wechat.mini_appid"),
- 'appsecret' => sConf("wechat.mini_secret"),
- 'encodingaeskey' => 'BJIUzE0gqlWy0GxfPp4J1oPTBmOrNDIGPNav1YFH5Z5',
- // 配置商户支付参数(可选,在使用支付功能时需要)
- 'mch_id' => sConf("wechat.mch_id"),
- 'mch_key' => sConf("wechat.mch_key")
- ];
- }
- }
|