AliPay.php 882 B

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