Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving Paypal IPN response multiple times

I am Using paypal payment gateway IPN in my application for payment.

When payment is done successfully I am receiving IPN response correctly.

After receiving I am sending back it for verification.

$ch = curl_init();

$paypalUrl = PAYPAL_URL;
curl_setopt($ch, CURLOPT_URL, $paypalUrl); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_field); 
curl_setopt($ch, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$res = curl_exec($ch);

Now I am receiving same IPN response multiple times (exactly about 9 times). I am sending IPN response for varification in following format:

    cmd=_notify-validate&orderUUID=eac962fe-3a0a-4b26-be89-e5ccf54ee2cb&
    mc_gross=15.00&settle_amount=11.58&
     protection_eligibility=Ineligible&payer_id=LR3LZ8R978ZK8&tax=0.00
    &payment_date=06%3A55%3A17+Jun+05%2C+2013+PDT&payment_status=Completed
  &charset=windows1252&first_name=abc&option_selection1=&option_selection2=&
 mc_fee=0.74&exchange_rate=0.812061&notify_version=3.7
  &settle_currency=USD&custom=&payer_status=verified&business=business%40mydomain.com
  &quantity=1&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AlU7JAwS8--HoB6lJfimizlVxnVa&payer_email=personal%40mydomain.com&option_name1=tour&option_name2=abc+abc&txn_id=6RU07240YB682730C&payment_type=instant&last_name=abc&receiver_email=business%40mydomain.com&payment_fee=&receiver_id=LW9JSM57BYH5Q&txn_type=web_accept&item_name=ite  m+name&mc_currency=AUD&item_number=&residence_country=US&test_ipn=1&handling_amount=0.00 &transaction_subject=item+reserva!tion+for+1+spaces+on+Jun+06&payment_gross=&shipping=0.00&ipn_track_id=b85bc954da9e5

What is the reason for receiving same response multiple times?

As I was following that, we need to send 200 OK to paypal for the IPN response, if Paypal doesn't get the 200 OK it retries again... Is it the same?

like image 782
Ganesh Patil Avatar asked Jun 05 '13 14:06

Ganesh Patil


People also ask

How do I fix PayPal Instant Payment Notification IPN?

Step 1: In your PayPal Account, go to my account –> profile – my setting tools – instant payment notifications – update – choose IPN settings. Step 2: Paste the notification URL given and enable the option “* Recive IPN messages”.

Can you have more than one IPN on PayPal?

PayPal only permits one IPN per account, so if you are already using your PayPal IPN (as part of your own checkout system for example) you may need to set up a relay to forward the IPN notification on to ChartMogul. A webhook relay will allow you to use your PayPal IPN in multiple locations.

What are PayPal IPN messages?

Instant Payment Notification (IPN) is a message service that automatically notifies merchants of events related to PayPal transactions. Merchants can use it to automate back-office and administrative functions, including automatically fulfilling orders and providing customers with order status.


2 Answers

Here I experienced one thing. suppose my original hostname is abc.com and I have created one testing instance on that. now my new hostname will be testing.abc.com . when I was doing transaction from my testing instance above problem is occurring(receiving IPN response multiple times). I handled response correctly (i.e checked is this duplicate response or new responce ). Now my application is moved on production environment and my hostname is abc.com and everything is working fine !! (receiving IPN response only once). I Think paypal was not able to receive success status from my testing instancE because of that it was trying to send same response multiple times.

like image 54
Ganesh Patil Avatar answered Sep 25 '22 04:09

Ganesh Patil


If you check your IPN history in your PayPal account, does it show a status code of 200 being sent back? Typically this is common reason for seeing IPN's multiple times.

like image 45
PP_MTS_Chad Avatar answered Sep 24 '22 04:09

PP_MTS_Chad