简体   繁体   中英

How to configure paypal recurring payment IPN url

I am using Paypal express checkout for recurring payments and have successfully integrated it with my website using PHP. However i have few questions

  1. how can i set IPN listener url when creating recurring profile?
  2. What data will be posted back to me when paypal server hits my IPN listener?
  3. How can i simulate or test recurring payment IPNs?

I will appreciate any help regarding this.

IPN URL can be set from your PayPal account/profile.

here is the step-by-step guide :-- http://net.tutsplus.com/tutorials/php/how-to-setup-recurring-payments/

1) You can set your IPN URL within the PayPal account profile. Unfortunately, NotifyURL within API requests doesn't work with recurring payments.

2) Here's a sample of an IPN you'd get when a new profile is created.

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 = tester@testerson.com
first_name = Tester
receiver_email = payments@domain.com
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

Here's a sample of an IPN you'd get for a completed payment from that a profile.

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 = payments@domain.com
verify_sign = AX9DPPxdksE8vxjYRM3zoykf7dT4APAKCGYTvrJ1cP7slIeYHUE9eqDh
payer_email = tester@testerson.com
initial_payment_amount = 29.95
profile_status = Active
amount = 1.95
txn_id = 33S38844SG269083S
payment_type = instant
last_name = Testerson
receiver_email = payments@domain.com
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

To test recurring payments IPN's you'll need to either run them for real in the sandbox, or you can create a basic HTML form with a bunch of hidden fields that match what you'd expect to get in an actual IPN. Set the action of this form to your IPN URL and then you can submit this in the browser to see the result on screen. This will help you weed out any problems with the script and allow you to run tests without waiting on the PayPal system to send the notifications.

Just keep in mind if you test that way the data isn't actually coming from PayPal so it will be UNVERIFIED. You'll need to make sure to handle that accordingly within your code during testing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM