Who is stupid: Me or Paypal?

26 Jun 2008

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:

PHP:
  1. (
  2.     [USER] => xxxx
  3.     [PWD] => xxx
  4.     [VERSION] => 3.2
  5.     [SIGNATURE] => xxx
  6.     [METHOD] => DoExpressCheckoutPayment
  7.     [TOKEN] => EC-xxx
  8.     [PAYMENTACTION] => Sale
  9.     [PAYERID] => xxx
  10.     [AMT] => 9.0000
  11.     [CURRENCYCODE] => USD
  12.     [BUTTONSOURCE] => paypal_express
  13. )

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:

PHP:
  1. (
  2.     [AMT] => 9.00
  3. )

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!

Design by: primerg | Images by: vikifloki | PETIXE.COM © 2007