Wechat.php 954 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | A3Mall
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2020 http://www.a3-mall.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: xzncit <158373108@qq.com>
  8. // +----------------------------------------------------------------------
  9. namespace app\api\controller\pay;
  10. use app\common\library\payment\wechat\WeChat as WeChatPayment;
  11. use xzncit\core\http\Response;
  12. /**
  13. * 微信支付回调控制器
  14. * Class Wechat
  15. * @package app\api\controller\pay
  16. */
  17. class Wechat {
  18. /**
  19. * 异步通知
  20. * @return string
  21. */
  22. public function index(){
  23. try{
  24. return (new WeChatPayment())->notify();
  25. }catch (\Exception $ex){
  26. return Response::arr2xml(['return_code' => 'FAIL', 'return_msg' => 'ERROR']);
  27. }
  28. }
  29. }