2013-07-02 55 views
2

我正在使用Paypal快速結賬定期付款,併成功將其與我的網站使用PHP進行整合。不過,我有幾個問題如何配置貝寶定期付款IPN網址

  1. 如何在創建定期配置文件時設置IPN監聽器url?
  2. 當貝寶服務器擊中我的IPN偵聽器時,哪些數據會發回給我?
  3. 如何模擬或測試定期付款IPN?

我會很感激這方面的幫助。

回答

3

IPN URL可以從您的PayPal帳戶/配置文件中設置。

這裏是一步一步的指導: - http://net.tutsplus.com/tutorials/php/how-to-setup-recurring-payments/

2

1)您可以將PayPal帳戶配置文件中設置您的IPN的網址。不幸的是,API請求中的NotifyURL不支持定期付款。

2)下面是創建新配置文件時獲得的IPN示例。

payment_cycle = Monthly 
txn_type = recurring_payment_profile_created 
last_name = Testerson 
next_payment_date = 03:00:00 Jul 01, 2013 PDT 

residence_country = US 
initial_payment_amount = 0.00 
rp_invoice_id = 5053 
currency_code = USD 
time_created = 11:39:03 Jul 01, 2013 PDT 
verify_sign = AxuyKPFTDVhGvGlmhi1Hmnox3YnSAxMg2orZ0pTTDYZq.xNVLeRhMlVb 

period_type = Regular 
payer_status = unverified 
tax = 0.00 
payer_email = [email protected] 
first_name = Tester 
receiver_email = [email protected] 
payer_id = R2UKKKKXGXE 

product_type = 1 
shipping = 0.00 
amount_per_cycle = 1.95 
profile_status = Active 

charset = windows-1252 
notify_version = 3.7 
amount = 1.95 
outstanding_balance = 0.00 
recurring_payment_id = I-JM567DDW38E 

product_name = USBSwiper Monthly Subscription 
ipn_track_id = 5263496da8a39 

下面是一個IPN示例,您可以從該配置文件中完成支付。

mc_gross = 1.95 
period_type = Regular 
outstanding_balance = 0.00 
next_payment_date = 03:00:00 Aug 01, 2013 PDT 
protection_eligibility = Ineligible 
payment_cycle = Monthly 
tax = 0.00 
payer_id = RLKKKKKFFFGMAJ 
payment_date = 03:18:43 Jul 01, 2013 PDT 
payment_status = Completed 
product_name = USBSwiper Monthly Subscription 
charset = windows-1252 
rp_invoice_id = 3420 
recurring_payment_id = I-W0HKYYYIIIKN 
first_name = Tester 
mc_fee = 0.39 
notify_version = 3.7 
amount_per_cycle = 1.95 
payer_status = unverified 
currency_code = USD 
business = [email protected] 
verify_sign = AX9DPPxdksE8vxjYRM3zoykf7dT4APAKCGYTvrJ1cP7slIeYHUE9eqDh 
payer_email = [email protected] 
initial_payment_amount = 29.95 
profile_status = Active 
amount = 1.95 
txn_id = 33S38844SG269083S 
payment_type = instant 
last_name = Testerson 
receiver_email = [email protected] 
payment_fee = 0.39 
receiver_id = M5VRAQYEFCSK6 
txn_type = recurring_payment 

mc_currency = USD 
residence_country = US 
receipt_id = 4101-1432-9533-3734 
transaction_subject = 
payment_gross = 1.95 
shipping = 0.00 
product_type = 1 
time_created = 08:50:12 Mar 01, 2012 PST 
ipn_track_id = b9df4ac317b53 

爲了測試循環付款IPN的,你要麼需要在沙箱中運行它們真實的,或者你可以創建一個基本的HTML表單與一羣隱藏字段的匹配,你希望得到什麼一個實際的IPN。將此表單的操作設置爲您的IPN網址,然後您可以在瀏覽器中將其提交到屏幕上查看結果。這將幫助您清除腳本中的任何問題,並允許您在不等待PayPal系統發送通知的情況下運行測試。

請記住,如果您以這種方式測試數據實際上並非來自PayPal,那麼它將會被無視。在測試過程中,您需要確保在代碼中處理相應內容。