| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- /**
- * @package merchant
- *
- * @author xaboy
- * @day 2020/6/2
- *
- *
- */
- namespace app\controller\api;
- use app\common\model\store\order\StoreGroupOrder;
- use app\controller\api\merchant\sxy\Access;
- use crmeb\services\QrcodeService;
- use crmeb\services\WechatService;
- class AliPay
- {
- public function getPayInfo()
- {
- $groupOrderId = request()->param('groupOrderId');
- $groupOrder = StoreGroupOrder::where('group_order_id', $groupOrderId)->find()->toArray();
- if (!$groupOrder) {
- return app('json')->fail('订单不存在');
- }
- if ($groupOrder['paid'] == 1) {
- return app('json')->fail('订单已支付');
- }
- $access = new Access();
- $res = $access->pay_huifu('ALI','',$groupOrder,'支付宝支付',env('APP_URL')."/api/hf_notify/pay");
- // 更新store_group_order表hf_pay_id
- StoreGroupOrder::update(['hf_pay_id'=>$res['id']],['group_order_id'=>$groupOrderId]);
- return app('json')->success($res);
- }
- }
|