CpaReversalController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * QuhulianController.php UTF-8
  4. * huosdk_mini_program
  5. *
  6. * @date : 2019/3/21 16:33
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : chenbingling <cbl@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace mini\sdk\controller;
  13. use huolib\status\CommonStatus;
  14. use mini\common\controller\V2ApiBaseController;
  15. use think\Log;
  16. class CpaReversalController extends V2ApiBaseController {
  17. function _initialize() {
  18. parent::_initialize();
  19. Log::write(
  20. $this->request->scheme().'://'.$this->request->server('HTTP_HOST').$this->request->server('REQUEST_URI').'?'
  21. .$this->request->getContent(),
  22. Log::LOG
  23. );
  24. }
  25. /***
  26. * 趣互联回调信息
  27. * http://doc.1tsdk.com/159?page_id=7650
  28. * 【域名】/mp/reversal
  29. */
  30. public function index() {
  31. $_code = get_val($this->rq_data, 'code');
  32. $_ext = get_val($this->rq_data, 'ext');
  33. $_game_rq = $this->setGameData();
  34. if (empty($_code) || empty($_ext)) {
  35. $_code = CommonStatus::INVALID_PARAMS;
  36. $this->error(CommonStatus::getMsg($_code), [], $_code);
  37. }
  38. $_rs = (new \huomp\controller\cpa_reversal\CpaReversalController())->reversal($_code, $_ext, $_game_rq);
  39. $this->returnData($_rs);
  40. }
  41. }