You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AppOrderController.php 1.8 KiB

3 jaren geleden
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 倪宗锋
  12. * PhpStorm AppOrderController.php
  13. * Create By 2016/11/30 13:10 $
  14. */
  15. namespace Order\Controller;
  16. use Order\Service\AppOrderService;
  17. use Util\Controller\MvcController;
  18. use Util\Util\Util;
  19. class AppOrderController extends MvcController
  20. {
  21. private $service = null;
  22. private function getService()
  23. {
  24. if ($this->service == null) {
  25. $this->service = new AppOrderService();
  26. }
  27. return $this->service;
  28. }
  29. /**
  30. * Function Description:支付回调接口
  31. * Function Name: notifyAction
  32. *
  33. * @return string
  34. *
  35. * @author 倪宗锋
  36. */
  37. public function notifyAction()
  38. {
  39. //获取传递过来的参数
  40. $getContent = file_get_contents("php://input");
  41. //数据处理及安全校验
  42. $checkNotify = $this->getService()->notify($getContent);
  43. //设置返回值
  44. $return = array(
  45. 'return_code' => 'SUCCESS',
  46. 'return_msg' => 'OK'
  47. );
  48. if ($checkNotify['flag'] == false) {
  49. $return['return_code'] = 'FAIL';
  50. $return['return_msg'] = empty($checkNotify['msg']) ? '未知错误!' : $checkNotify['msg'];
  51. }
  52. ob_clean();
  53. return Util::arrayToXml($return);//转换为xml返回
  54. }
  55. }