NewMerchantController.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\alliance\controllers;
  8. use app\models\Option;
  9. use app\modules\alliance\controllers\BaseController;
  10. use app\modules\alliance\models\NewMerchantForm;
  11. use Overtrue\Socialite\SocialiteManager;
  12. use yii\helpers\Json;
  13. class NewMerchantController extends BaseController
  14. {
  15. //TODO 当面付逻辑 start
  16. public function actionFacePayConfig()
  17. {
  18. $form = new NewMerchantForm();
  19. $form->type = post_params('type', 'weixin');
  20. $form->qrcode_id = post_params('qrcode_id');
  21. $form->id = post_params('mini_id');
  22. $form->store_id = post_params('store_id');
  23. $res = $form->facePayConfig();
  24. return $this->asJson($res);
  25. }
  26. public function actionFacePay()
  27. {
  28. $form = new NewMerchantForm();
  29. $form->type = post_params('type', 'weixin');
  30. $form->code = post_params("code");
  31. $form->qrcode_id = post_params("qrcode_id");
  32. $form->id = post_params("mini_id", 0);
  33. $form->pay_fee = post_params("pay_fee");
  34. $form->_from = post_params("_from");
  35. $form->send_price = post_params("send_price");
  36. $form->take_price = post_params("take_price");
  37. $form->is_use_yunst = intval(post_params("is_use_yunst"));
  38. $res = $form->facePay();
  39. return $this->asJson($res);
  40. }
  41. //查询是否支付成功
  42. public function actionPayResult()
  43. {
  44. $form = new NewMerchantForm();
  45. $form->order_no = post_params("order_no");
  46. $res = $form->payResult();
  47. return $this->asJson($res);
  48. }
  49. //赠送积分
  50. public function actionGetGiveIntegral()
  51. {
  52. $form = new NewMerchantForm();
  53. $form->pay_fee = get_params("pay_fee");
  54. $res = $form->getGiveIntegral();
  55. return $this->asJson($res);
  56. }
  57. }