Payment.php 897 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. use \think\Request;
  5. class Payment extends Base
  6. {
  7. public function __construct()
  8. {
  9. parent::__construct();
  10. }
  11. public function notify()
  12. {
  13. if (Request()->isPost()) {
  14. $param = input();
  15. $pay_type = $param['pay_type'];
  16. if ($GLOBALS['config']['pay'][$pay_type]['appid'] == '') {
  17. echo lang('index/payment_status');
  18. exit;
  19. }
  20. $cp = 'app\\common\\extend\\pay\\' . ucfirst($pay_type);
  21. if (class_exists($cp)) {
  22. $c = new $cp;
  23. $c->notify();
  24. }
  25. else{
  26. echo lang('index/payment_not');
  27. exit;
  28. }
  29. }
  30. else{
  31. return $this->success(lang('index/payment_ok'), url('user/index') );
  32. }
  33. }
  34. }