setAlipayPublicKey($alipay['alipay_key']); $result = $Pay->rsaCheck($_POST, $_POST['sign_type']); if ($result === true && $_POST['trade_status'] == 'TRADE_SUCCESS') { $out_trade_no = input('out_trade_no', ''); if (($count = strpos(input('out_trade_no'), '_')) !== false) { $out_trade_no = substr(input('out_trade_no'), $count + 1); } parse_str(input('passback_params'), $attach); (new Hook(PaymentRepositories::class, 'wechat'))->listen($attach['attach'], $out_trade_no); echo 'success'; exit(); } else { echo 'error'; exit(); } } }