HEX
Server: Apache
System: Linux top 5.8.11-1.el7.elrepo.x86_64 #1 SMP Tue Sep 22 18:18:35 EDT 2020 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.018111.cn/wp-content/themes/jian/shop/weixin/notify.php
<?php


/**
 * weixin异步通知
 */

header('Content-type:text/html; Charset=utf-8');
date_default_timezone_set('Asia/Shanghai');
ob_start();
require_once dirname(__FILE__) . "../../../../../../wp-load.php";
ob_end_clean();

if (!_cao('is_weixinpay')) {
    wp_safe_redirect(home_url());exit;
}

// 获取后台支付配置
$wxPayConfig = _cao('weixinpay');

if (empty($wxPayConfig['appid']) || empty($wxPayConfig['key'])) {
    wp_safe_redirect(home_url());exit;
}


// 公共配置
$params         = new \Yurun\PaySDK\Weixin\Params\PublicParams;
$params->appID  = $wxPayConfig['appid'];
$params->mch_id = $wxPayConfig['mch_id'];
$params->key    = $wxPayConfig['key'];
// SDK实例化,传入公共配置
$sdk = new \Yurun\PaySDK\Weixin\SDK($params);

class PayNotify extends \Yurun\PaySDK\Weixin\Notify\Pay
{
    /**
     * 后续执行操作
     * @return void
     */
    protected function __exec()
    {
        // 支付成功处理,一般做订单处理,$this->data 是从微信发送来的数据
        // file_put_contents(__DIR__ . '/notify_result.txt', date('Y-m-d H:i:s') . ':' . var_export($this->data, true));

        //商户本地订单号
        $out_trade_no = $this->data['out_trade_no'];
        //支付宝交易号
        $trade_no = $this->data['transaction_id'];

        //发送支付成功回调用
        $RiProPay = new RiProPay;
        $RiProPay->send_order_trade_success($out_trade_no,$trade_no,'ripropaysucc');
        // 告诉微信我处理过了,不要再通过了
        $this->reply(true, 'OK');
    }
}

$payNotify = new PayNotify;

try {
    $sdk->notify($payNotify);
} catch (Exception $e) {
    // file_put_contents(__DIR__ . '/notify_result.txt', $e->getMessage() . ':' . var_export($payNotify->data, true));
}