Pay.php 715 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\mobile\controller;
  3. use app\BaseController;
  4. use app\mobile\logic\PayLogic;
  5. use think\exception\ValidateException;
  6. use think\facade\Validate;
  7. //支付相关
  8. class Pay extends BaseController
  9. {
  10. //微信支付成功后的异步通知及订单处理
  11. public function Notify()
  12. {
  13. return PayLogic::Notify();
  14. }
  15. //检查支付结果
  16. public function checkPayResult()
  17. {
  18. $param = $this->request->only(['pay_code'], 'post');
  19. $val = Validate::rule(['pay_code|支付编码' => 'require|length:18']);
  20. if (!$val->check($param)) throw new ValidateException($val->getError());
  21. return PayLogic::checkPayResult($param['pay_code']);
  22. }
  23. }