我使用下面的類來處理IPN數據: https://github.com/WadeShuler/PHP-PayPal-IPN(和它一直在努力罰款歲)貝寶IPN現在返回無效 - PHP代碼之前工作的罰款
最後成功處理付款是在9月28日,10月5日發生的下一次IPN付款返回了無效的回覆,因爲每次付款都是如此。
如果我在IPN模擬器中測試,則消息處理成功。 Sandbox或Live,響應無效。我原以爲Sandbox會有一個設施,在那裏我可以查看爲什麼一封郵件被拒絕爲無效,但似乎並非如此?肯定會是看到拒絕原因的簡單方法,我錯過了什麼嗎?
,帶你到貝寶從我的網站的鏈接是:
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ext-enter&redirect_cmd=_xclick&[email protected]&item_name=QLD++%28Pacific+pines+secondary+Sat+25th+July+%29&item_number=FYD15000003&custom=0001000003¤cy_code=AUD&amount=0.01&no_shipping=1&image_url=http://www.fydentry.com/img/follow-your-dreams-100.jpg&return=http://www.fydentry.com/entry-test.php&cancel_return=http://www.fydentry.com/entry-test.php¬ify_url=http://www.fydentry.com/payback-test.php
貼貝寶回來的數據是:
transaction_subject = 0001000003 & txn_type = web_accept & payment_date = 07%3A05%3A07 + Oct + 15%2C + 2015 + PDT & last_name =買家& residence_country = AU & pending_reason = multi_currency & ITEM_NAME = QLD ++%28Pacific +松樹+次級+週六+ 25 +月+%29 & payment_gross = & mc_currency = AUD &業務=銷售調解人%40fydentry.com & payment_type =即時& protection_eligibility =不合格的& verify_sign = Acssfl2b2v1gxOK33TD2StcDhf-OAZxwix74kxFlSgpWMku6myuy.WFL & payer_status =驗證&的test_ipn = 1 &稅= 0.00 & PAYER_EMAIL =銷售額 - 購買%40fydentry.com & txn_id = 9BV63134E20871700 &量= 1個& RECEIVER_EMAIL =銷售調解人%40fydentry.com & FIRST_NAME =測試& payer_id = FY3RYW98GNMXG 01receiver_id = 95FC3QCK53MHC & ITEM_NUMBER = FYD15000003 & handling_amount = 0.00 & PAYMENT_STATUS =待定&運費= 0.00 & mc_gross = 0.01 &定製= 0001000003 &的charset =窗口1252 & notify_version = 3.8 & ipn_track_id = cfbd422d97d69
我送回到貝寶的迴應是:
CMD = _notify-驗證& transaction_subject = 0001000003 & txn_type = web_accept & PAYMENT_DATE = 07%3A05%3A07 +月+ 15%2C + 2015 + PDT &姓氏=買方& residence_country = AU & pending_reason = multi_currency & ITEM_NAME = QLD ++% 28太平洋+松樹+中學+週六+ 25日+ 7月+%29 & payment_gross = & mc_currency = AUD & business = sales-facilitator%40fydentry。COM & payment_type =即時& protection_eligibility =不合格的& verify_sign = Acssfl2b2v1gxOK33TD2StcDhf-OAZxwix74kxFlSgpWMku6myuy.WFL & payer_status =驗證&的test_ipn = 1 &稅= 0.00 & PAYER_EMAIL =銷售額 - 購買%40fydentry.com & txn_id = 9BV63134E20871700 &量= 1 & RECEIVER_EMAIL =銷售促進%40fydentry.com & FIRST_NAME =測試& payer_id = FY3RYW98GNMXG 01receiver_id = 95FC3QCK53MHC & = ITEM_NUMBER FYD15000003 & handling_amount = 0.00 & PAYMENT_STATUS =待定&航運= 0.00 & mc_gross = 0.01 &定製= 0001000003 &的charset =窗口1252 & notify_version = 3.8 & ipn_track_id = cfbd422d97d69
而且在回報-test.php的代碼是:
<?php
include_once("f_common.php");
include_once("IpnListener.php");
use wadeshuler\paypalipn\IpnListener;
$listener = new IpnListener();
$listener->use_sandbox = true;
$dbh = open_db();
$res = 'UNKNOWN';
try {
$listener->requirePostMethod();
$verified = $listener->processIpn();
} catch (Exception $e) {
error_log($e->getMessage());
exit(0);
}
if ($verified) {
$res = "VERIFIED";
} else {
$res = "INVALID";
}
$stmt_debug = $dbh->prepare('INSERT INTO fyd_paypal_ipn (post_data, response_data, status, message_time) VALUES (:post_data, :response_data, :status, UTC_TIMESTAMP())');
$stmt_debug->execute(array(':post_data' => $listener->rawPostData, ':response_data' => $listener->debug_response, ':status' => $res));
?>
注意,對於本次練習的目的,我還修改了IpnListener類,以便可以獲取用於調試目的的響應副本。
在變量聲明的文件的頂部,我做了$ rawPostData公開,並添加這個變量:
public $debug_response;
並存儲該值,我們使用它的權利之前:
$this->debug_response = $req;
if ($this->use_curl) {
$res = $this->curlPost($req);
} else {
$res = $this->fsockPost($req);
}
我假設Paypal方面有些事情已經改變了,以阻止這項工作,但我看不到它是什麼,特別是因爲我的回答看起來是正確的(相同的),我找不到任何東西沙盒方面,幫助我確定爲什麼它被視爲無效?不幸的是,底部的調試代碼在我追蹤IPN發佈數據和響應的過程中是新的,所以我沒有更老的(工作!)一組消息來比較內容。
數字調幅廣播你的網站需要一些嚴重的CSS工作。 –
css值得我的妻子爲此付出的每一分錢:)是的,這是在「待辦事項」列表的某處。 –
祝你好運,這是一個好主意 –