Hi Alan,
As always, thanks for the quick reply. I've compared the original IPN code with yours, and you're right, there are no differences...
I've had a few successful enrollments using your script, but recently, the enrollments via you script results in a "thank you-unfortunately" message BUT the student still gets enrolled.
Here are the email messages from your script, in chronological order:
Subject: In ipn.php Before fsockopen(), paypaladdr:
www.sandbox.paypal.comBody:
CONTENTS OF POST: POST /cgi-bin/webscr HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 847
cmd=_notify-validate&mc_gross=2.00&protection_eligibility=Ineligible&payer_id=SCYV3MR2C3SPQ&tax=0.00&payment_date=22%3A32%3A30+Nov+26%2C+2008+PST&payment_status=Completed&charset=windows-1252&first_name=Test&option_selection1=Allen+Dino&mc_fee=0.36¬ify_version=2.6&custom=12-2&payer_status=verified&business=allend_1221726249_biz%40gmail.com&quantity=1&verify_sign=An5ns1Kso7MWUdW4ErQKJJJ4qi4-AEmrhlhzH7My3bWMWbOcdJAHQ9Pr&payer_email=allend_1221728337_per%40gmail.com&option_name1=User&txn_id=74737182WS472733A&payment_type=instant&last_name=User&receiver_email=allend_1221726249_biz%40gmail.com&payment_fee=0.36&receiver_id=HLLT3CQH8L4GA&txn_type=web_accept&item_name=Animation+Congress&mc_currency=USD&item_number=AnimationCongress&residence_country=US&test_ipn=1&handling_amount=0.00&transaction_subject=12-2&payment_gross=2.00&shipping=0.00
INCOMING POST WAS
KEY:mc_grossVALUE:2.00END
KEY:protection_eligibilityVALUE:IneligibleEND
KEY:payer_idVALUE:SCYV3MR2C3SPQEND
KEY:taxVALUE:0.00END
KEY:payment_dateVALUE:22%3A32%3A30+Nov+26%2C+2008+PSTEND
KEY:payment_statusVALUE:CompletedEND
KEY:charsetVALUE:windows-1252END
KEY:first_nameVALUE:TestEND
KEY:option_selection1VALUE:Allen+DinoEND
KEY:mc_feeVALUE:0.36END
KEY:notify_versionVALUE:2.6END
KEY:customVALUE:12-2END
KEY:payer_statusVALUE:verifiedEND
KEY:businessVALUE:allend_1221726249_biz%40gmail.comEND
KEY:quantityVALUE:1END
KEY:verify_signVALUE:An5ns1Kso7MWUdW4ErQKJJJ4qi4-AEmrhlhzH7My3bWMWbOcdJAHQ9PrEND
KEY:payer_emailVALUE:allend_1221728337_per%40gmail.comEND
KEY:option_name1VALUE:UserEND
KEY:txn_idVALUE:74737182WS472733AEND
KEY:payment_typeVALUE:instantEND
KEY:last_nameVALUE:UserEND
KEY:receiver_emailVALUE:allend_1221726249_biz%40gmail.comEND
KEY:payment_feeVALUE:0.36END
KEY:receiver_idVALUE:HLLT3CQH8L4GAEND
KEY:txn_typeVALUE:web_acceptEND
KEY:item_nameVALUE:Animation+CongressEND
KEY:mc_currencyVALUE:USDEND
KEY:item_numberVALUE:AnimationCongressEND
KEY:residence_countryVALUE:USEND
KEY:test_ipnVALUE:1END
KEY:handling_amountVALUE:0.00END
KEY:transaction_subjectVALUE:12-2END
KEY:payment_grossVALUE:2.00END
KEY:shippingVALUE:0.00END
Subject: In ipn.php VALID PAYMENT!, status: Completed, reason:
Body:
Test
Subject: In ipn.php Worked Fully!!!!!!!!!!!!!!!
Body:
Test
Subject: In ipn.php After while (!feof()) loop, countfgets: 12,lenfullstring: 932
Body:
HTTP/1.1 200 OK
Date: Thu, 27 Nov 2008 06:32:39 GMT
Server:
Apache/1.3.33 (Unix) mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a mod_ssl/2.8.22 OpenSSL/0.9.7e
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=3iwhWd6TGp4ihsMamJP9TP2iBBrnMvTy6LBWuOO16onVUDeucwrqov0aN4CZYG6xm3kEgJrlMJ7QaheEJljVZXZvAUc8BxnKY3Mkd31fpGWm3HRqBiSZ9jSxS5hRGJUoGUhhlG%7c86OVjA8nsjCkgSTgWh4wYxiU5WRt9uD0FyJP_iM6sBdRX2-8Z2ai8hKx21bUrnhkSFvY80%7clTHWzPsOj6UqwcMArUyNaLBP08KxXLoQhxx1PTrcVwUmqul1oNR3U2juizExoyIjiuaDcG%7c1227767560;
domain=.paypal.com; path=/
Set-Cookie: cookie_check=yes; expires=Sun, 25-Nov-2018 06:32:40 GMT; domain=.paypal.com; path=/
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/
Set-Cookie: navlns=0; expires=Wed, 22-Nov-2028 06:32:40 GMT; domain=.paypal.com; path=/
Set-Cookie: Apache=10.191.196.11.154081227767559753; path=/; expires=Wed, 15-Oct-02 00:04:23 GMT
Connection: close
Content-Type: text/html; charset=UTF-8
VERIFIED
It gets frustrating when some of the tests result in complete payment and others, I receive that dreaded "thank you-unfortunately" message. Also, I reverted back to the original ipn.php and made the same enrollment process and the same thing happened --- "thank you-unfortunately" message, then after I click continue, the student enrolled successfully.
I keep enrolling the same student for testing purposes, I just unenroll him from the course when it's time to make another enrollment-paypal test.
Warm regards,
Allen