我在我的网站上遇到PayPal和IPN问题,并尝试过大量的事情。
我正在尝试做什么:
从PayPal接收付款通知,然后使用变量中的详细信息更新数据库。
什么工作:
什么行不通:
我在用什么:
监听器文件是:
$p = new paypal_class;
if ($p->validate_ipn() && !empty($p->ipn_data['payment_status']) && $p->ipn_data['payment_status'] == 'Completed') {
$mc_gross = $_POST['mc_gross'];
$payer_id = $_POST['payer_id'];
$payment_date = $_POST['payment_date'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$payer_email = $_POST['payer_email'];
$payment_status = $_POST['payment_status'];
$payer_status = $_POST['payer_status'];
$address_name = $_POST['address_name'];
$address_country = $_POST['address_country'];
$address_zip = $_POST['address_zip'];
$address_state = $_POST['address_state'];
$address_city = $_POST['address_city'];
$address_street = $_POST['address_street'];
$mc_shipping = $_POST['mc_shipping'];
$mc_currency = $_POST['mc_currency'];
$ipn_track_id = $_POST['ipn_track_id'];
$stmt = $con->prepare("INSERT into orders (mc_gross, payer_id, payment_date, first_name, last_name, payer_email, payment_status, payer_status, address_name, address_country, address_zip, address_state, address_city, address_street, mc_shipping, mc_currency, ipn_track_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
$stmt->bind_param("sssssssssssssssss", $mc_gross, $payer_id, $payment_date, $first_name, $last_name, $payer_email, $payment_status, $payer_status,
$address_name, $address_country, $address_zip, $address_state,
$address_city,
$address_street, $mc_shipping, $mc_currency, $ipn_track_id);
$stmt->execute();
$stmt->close();
}
有谁知道这可能是什么问题?无论我尝试什么,似乎无法让这个工作。我在我的商业PayPal帐户中启用了IPN。
谢谢