Friday 09 March 2007 6:16:04 am
When you use the PayPal extension as your payment gateway there are a sequence of things that happen. When you hit "confirm order" ez passes the information about the order in the URL as a sequence of parameters that allows paypal to understand and process the payment. When the order is complete Paypal sends a post back to the ezPublish website in the background. The path is in the list of parameters in the url: "¬ify_url=$localHost" . $indexDir . "/paypal/notify_url/". Or "http://www.mywebsite.com/paypal/notify_url"
Paypal passes back a list of parameters and these are logged in the log files.
BUT there are a few checkers that take place to ensure that the response back from Paypal is legitimate. So ezPublish asks Paypal if it was successful AGAIN. If it's not that's when that annoyed "this could take a while" error message appears as it tries to get the data back from Paypal. Mainly because of the error that came back which does not match exactly with what ezPaypal extension expects. The checks are in the "notify_url.php file". Specifically this line:
if( $checker->requestValidation() && $checker->checkPaymentStatus() )
You can look up the code yourself. For example, when the request comes back I get this log output:
21-12-2006 01-47 payer_status = verified
21-12-2006 01-47 tax = 0.00
21-12-2006 01-47 payer_email = them@gmail.com
21-12-2006 01-47 txn_id = 0G187042LH558894T
21-12-2006 01-47 quantity = 1
21-12-2006 01-47 receiver_email = me@mysite.com
21-12-2006 01-47 first_name = Sam
21-12-2006 01-47 payer_id = 6LZ6NY3M3QH88
21-12-2006 01-47 receiver_id = 3THT9M5SJWBEL
21-12-2006 01-47 item_number =
21-12-2006 01-47 payment_status = Completed
21-12-2006 01-47 payment_fee = 0.59
21-12-2006 01-47 mc_fee = 0.59
21-12-2006 01-47 shipping = 0.00
21-12-2006 01-47 mc_gross = 12.00
21-12-2006 01-47 custom = 3
21-12-2006 01-47 charset = windows-1252
21-12-2006 01-47 notify_version = 2.1
21-12-2006 01-47 requestValidation. response from server is: VERIFIED
21-12-2006 01-47 checkCurrency failed: Order currency (GBP) and received currency (USD).
21-12-2006 14-15 createDataFromPOST
21-12-2006 14-15 payment_date = 06:15:18 Dec 21, 2006 PST
21-12-2006 14-15 txn_type = web_accept
21-12-2006 14-15 last_name = Dossett
21-12-2006 14-15 residence_country = GB
21-12-2006 14-15 item_name = A great product
21-12-2006 14-15 payment_gross = 48.00
21-12-2006 14-15 mc_currency = USD
21-12-2006 14-15 business = me@mysite.com
21-12-2006 14-15 payment_type = instant
Ez looks at this field "payer_status" to see if it's "verified" but ez expects it to read as "VERIFIED" Line 66 of the file called "ezpaypalchecker.php" read as:
if( $response && strcasecmp( $response, 'VERIFIED' ) == 0 )
{
return true;
}
As you can see it expects a lowercase response not an uppercase response. The response above shows that the currency is incorrect but ezPublish does not have multi currency support so it fails. It can also read as "payer_status = unverified" which again will fail. So to track down the problem look in the file looking for the "payer_status" and the " payment_status " fields then ,check the code. I hope that's more helpful.
Regards Stuart
-- Stuart
stuart@grandmore.com
http://www.grandmore.com
|