Parcourir la source

feat(api): 添加支付宝支付功能

- 新增 AliPay 控制器处理支付宝支付逻辑
- 实现 getPayInfo 方法获取支付信息
- 集成汇付支付接口处理支付宝支付请求
- 添加支付宝支付路由配置
- 实现订单查询和支付参数构建功能
shichen il y a 3 mois
Parent
commit
ea59fb1b76
2 fichiers modifiés avec 33 ajouts et 0 suppressions
  1. 31 0
      app/controller/api/AliPay.php
  2. 2 0
      route/api.php

+ 31 - 0
app/controller/api/AliPay.php

@@ -0,0 +1,31 @@
1
+<?php
2
+/**
3
+ * @package merchant
4
+ *
5
+ * @author xaboy
6
+ * @day 2020/6/2
7
+ *
8
+ * 
9
+ */
10
+
11
+namespace app\controller\api;
12
+
13
+
14
+use app\common\model\store\order\StoreGroupOrder;
15
+use app\controller\api\merchant\sxy\Access;
16
+use crmeb\services\QrcodeService;
17
+use crmeb\services\WechatService;
18
+
19
+
20
+class AliPay
21
+{
22
+    public function getPayInfo()
23
+    {
24
+        $groupOrderId = request()->param('groupOrderId');
25
+        $groupOrder = StoreGroupOrder::where('group_order_id', $groupOrderId)->find()->toArray();
26
+        $access = new Access();
27
+        $res = $access->pay_huifu('ALI','',$groupOrder,'支付宝支付',env('APP_URL')."/api/hf_notify/pay");
28
+        return app('json')->success($res);
29
+    }
30
+
31
+}

+ 2 - 0
route/api.php

@@ -909,6 +909,8 @@ Route::group('api/', function () {
909 909
     //抖音详情
910 910
     Route::get('dy/get_detail', 'api.store.product.Douyin/dy_detail');
911 911
 
912
+    // 汇付支付宝支付
913
+    Route::get('ali_pay/get_pay_info','api.AliPay/getPayInfo')->name('aliPayGetPayInfo');
912 914
     //微信支付回调
913 915
     Route::any('notice/wechat_pay', 'api.Common/wechatNotify')->name('wechatNotify');
914 916
     //公证处入账确认回调