什麼你需要做的是建立自己的IPN模擬器進行測試。您可以製作一個基本的HTML表單,其操作設置爲您的IPN URL和隱藏字段,以匹配您希望從IPN獲得的名稱/值。
通過這種方式,您可以在瀏覽器中加載測試並將其提交給IPN監聽器。您將能夠在屏幕上看到可幫助解決問題的結果。
請記住,當以這種方式進行測試時,數據不是來自PayPal的服務器,因此IPN將不被驗證。您需要確保您的代碼邏輯處理該問題。
下面是一些IPN的示例,您可以在發生退款時獲得IPN,以便您可以看到您應該期望的內容並相應地設置您的模擬器。
新案例
txn_type = new_case
payment_date = 13:40:52 Aug 05, 2013 PDT
case_id = PP-002-576-509-683
receipt_id = 4674-2219-3481-3741
case_type = chargeback
business = [email protected]
verify_sign = AeD56uUedZzgp83xxTHMkZtMZ9FVAzvpMwl6OHUf9CNvlvgA2P0mbcwP
payer_email = [email protected]
txn_id = 0PC8014855508203X
case_creation_date = 18:40:23 Sep 04, 2013 PDT
receiver_email = [email protected]
payer_id = RZ3LX555U646Q
receiver_id = M5VRA555CSK6
reason_code = non_receipt
custom =
charset = windows-1252
notify_version = 3.7
ipn_track_id = 2842c24f40ac
逆轉
mc_gross = -1972.86
protection_eligibility = Ineligible
payer_id = RZ3LX555U646Q
address_street = N/A
payment_date = 18:42:00 Sep 04, 2013 PDT
payment_status = Reversed
charset = windows-1252
address_zip = 00000
first_name = Tester
mc_fee = -44.74
address_country_code = US
address_name = Tester Testerson
notify_version = 3.7
reason_code = chargeback
custom =
business = [email protected]
address_country = United States
address_city = NA
verify_sign = Ai1PaghZh5FmBLCDCTQpwG8jB264ABWpa3tbhFljkaPnVj1L9ip5EwyS
parent_txn_id = 0PC8014555008203X
txn_id = 0PC8014855508203X
payment_type = instant
last_name = Testerson
address_state = NA
receiver_email = [email protected]
payment_fee = -44.74
receiver_id = M5VRA555CSK6
item_name = PayPal POS Web Order
mc_currency = USD
item_number =
residence_country = US
receipt_id = 4674-2219-3481-3741
handling_amount = 0.00
transaction_subject =
payment_gross = -1972.86
shipping = 100.00
ipn_track_id = f456d076de1ff
我已經做到了與仿真器(https://developer.paypal.com/webapps/developer/applications/ ipn_simulator)。我真的希望能夠有一種方法來測試從開始到結束這整個過程,就好像它在生產中一樣。 –
請問這些例子是否基於一些真實的場景?或者你使用模擬器? – lulalala
這些示例來自真實場景。我用假數據替換了一些實際的數據,但格式完全一樣。 –