123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?php
- /**
- * Niushop商城系统 - 团队十年电商经验汇集巨献!
- * =========================================================
- * Copy right 2019-2029 山西牛酷信息科技有限公司, 保留所有权利。
- * ----------------------------------------------
- * 官方网址: https://www.niushop.com.cn
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
- * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
- * =========================================================
- */
- namespace app\pay\controller;
- use app\Controller;
- use think\facade\Log;
- /**
- * 支付控制器
- */
- class Pay extends Controller
- {
-
- /**
- * 支付异步回调
- */
- public function VipPayNotify()
- {
- $data = file_get_contents('php://input');
- $is_xml = xml_parser($data);
- if($is_xml) {
- $jsonXml = json_encode(simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA));
- $data = json_decode($jsonXml, true);
- Log::write('pay_notifiy:'.$jsonXml, 'notice');
- }
- else{
- $data = input();
- Log::write('pay_notifiy_pay:'.var_export($data,true), 'notice');
- }
- event('VipPayNotify', $data);
- }
- public function FranchiseePayNotify()
- {
- $data = file_get_contents('php://input');
- $is_xml = xml_parser($data);
- if($is_xml) {
- $jsonXml = json_encode(simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA));
- $data = json_decode($jsonXml, true);
- Log::write('pay_notifiy:'.$jsonXml, 'notice');
- }
- else{
- $data = input();
- Log::write('pay_notifiy_pay:'.var_export($data,true), 'notice');
- }
- event('FranchiseePayNotify', $data);
- }
- public function OrderPayNotify()
- {
- $data = file_get_contents('php://input');
- $is_xml = xml_parser($data);
- if($is_xml) {
- $jsonXml = json_encode(simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA));
- $data = json_decode($jsonXml, true);
- $data['pay_type']='wechatpay';
- Log::write('pay_notifiy:'.$jsonXml, 'notice');
- }
- else{
- $data = input();
- $data['pay_type']='alipay';
- Log::write('pay_notifiy_pay:'.var_export($data,true), 'notice');
- }
- event('OrderPayNotify', $data);
- }
- public function SupplierPayNotify()
- {
- $data = file_get_contents('php://input');
- $is_xml = xml_parser($data);
- if($is_xml) {
- $jsonXml = json_encode(simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA));
- $data = json_decode($jsonXml, true);
- Log::write('pay_notifiy:'.$jsonXml, 'notice');
- }
- else{
- $data = input();
- Log::write('pay_notifiy_pay:'.var_export($data,true), 'notice');
- }
- event('SupplierPayNotify', $data);
- }
- public function BalancePayNotify()
- {
- $data = file_get_contents('php://input');
- $is_xml = xml_parser($data);
- if($is_xml) {
- $jsonXml = json_encode(simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA));
- $data = json_decode($jsonXml, true);
- Log::write('pay_notifiy:'.$jsonXml, 'notice');
- }
- else{
- $data = input();
- Log::write('pay_notifiy_pay:'.var_export($data,true), 'notice');
- }
- file_put_contents('pay3_log.log', $data["out_trade_no"]);
- event('BalancePayNotify', $data);
- }
-
- public function payReturn()
- {
- }
-
- }
|