NewMerchantController.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\client\controllers\v1;
  8. use app\models\Option;
  9. use app\modules\client\controllers\BaseController;
  10. use app\modules\client\models\v1\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. $form = new NewMerchantForm();
  18. $form->type = post_params('type','weixin');
  19. $form->id = post_params('mini_id');
  20. $res = $form->facePayConfig(input_params('total_price', 0));
  21. return $this->asJson($res);
  22. }
  23. public function actionFacePay(){
  24. $form = new NewMerchantForm();
  25. $form->type = post_params('type','weixin');
  26. $form->code = post_params("code");
  27. $form->id = post_params("mini_id",0);
  28. $form->pay_fee = post_params("pay_fee");
  29. $form->recharge_id = post_params("recharge_id");
  30. $form->is_balance = post_params("is_balance");
  31. $form->send_price = post_params('send_price');
  32. $form->take_price = post_params('take_price');
  33. $form->pay_type = post_params('pay_type', 1);
  34. $form->coupon_id = post_params('coupon_id');
  35. $form->md_id = post_params('md_id');
  36. $form->mch_id = post_params('mch_id');
  37. $res = $form->facePay();
  38. return $this->asJson($res);
  39. }
  40. //查询是否支付成功
  41. public function actionPayResult(){
  42. $form = new NewMerchantForm();
  43. $form->order_no = post_params("order_no");
  44. $res = $form->payResult();
  45. return $this->asJson($res);
  46. }
  47. }