Who is stupid: Me or Paypal?
Thu, Jun 26th 08 3:38 pm | comments (2)
I feel like blogging this today because the emotion is still at it's peak.
For weeks I've been struggling on the error of Internal Server Error passed by Paypal API when I do DoExpressCheckoutPayment. I even posted it in Paypal Developers forum, PHPUGPH, asked a couple of people for help but no one was able to find the answer as well (you'll find later why).
The most trivial for me is that I just copied the code from osCommerce paypal express module and the osc application works flawlessly! While in my application, whatever changes I apply, I can't get it to work! *Starting to scratch my hand while googling*
So today I got my hands dirty because tonight is my due date and this is the only module left unfinished. Playing with the paypal module from oscommerce and with mine, compared them line by line, character by character. And finally, I got it working!
DAMN! That's the first word I shouted when it worked. It's a BIG BIG DAMN!!
So what was really the problem? the Number format. This is what I passed to paypal before I got the answer:
(
[USER] => xxxx
[PWD] => xxx
[VERSION] => 3.2
[SIGNATURE] => xxx
[METHOD] => DoExpressCheckoutPayment
[TOKEN] => EC-xxx
[PAYMENTACTION] => Sale
[PAYERID] => xxx
[AMT] => 9.0000
[CURRENCYCODE] => USD
[BUTTONSOURCE] => paypal_express
)
Passing those parameters produced the ffg output:
Internal_Server_Error The_server_encountered_an_internal_error_or misconfiguration_and_was_unable_to_complete your_request_Please_contact_the_server_administrator, _ppmtps@paypal_com_and_inform_them_of_the_time_the_error_occurred, and_anything_you_might_have_done_that_may_have caused_the_error_
More_information_about_this_error_may_be_available in_the_server_error_log_
And the fix that saved me from more misery:
Wow! What a simple solution isn't it??? I don't understand how such a small error have brought such a huge problem. *scratching my head again* *sigh* *sigh* *roll eyes* *rejoice*
Hayyyyyyyyy.. Kaya ko to!








