MiddleApi.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace addons\Alitopay\common\logic;
  3. use common\logic\middleground\base\ApiAbstract;
  4. use common\models\common\MiddleMch;
  5. class MiddleApi extends ApiAbstract
  6. {
  7. public function __construct(MiddleMch $mch)
  8. {
  9. parent::__construct($mch);
  10. }
  11. public $api_list = [
  12. 'apply' => 'alitopay/apply',
  13. 'setConfig' => 'alitopay/setConfig',
  14. 'pay' => 'alitopay/pay',
  15. 'query' => 'alitopay/query',
  16. ];
  17. public function setConfig($param)
  18. {
  19. $res = $this->request($this->getFullUrl(__FUNCTION__), array_filter($param), 'post');
  20. return $res;
  21. }
  22. public function apply($param)
  23. {
  24. $res = $this->request($this->getFullUrl(__FUNCTION__), array_filter($param), 'post');
  25. return $res;
  26. }
  27. public function pay($param)
  28. {
  29. $res = $this->request($this->getFullUrl(__FUNCTION__), array_filter($param), 'post');
  30. return $res;
  31. }
  32. public function query($out_batch_no)
  33. {
  34. $res = $this->request($this->getFullUrl(__FUNCTION__), ['out_batch_no' => $out_batch_no], 'get');
  35. return $res;
  36. }
  37. }