Forums / Developer / problem in redirecting from paypal payment to eZ publish

problem in redirecting from paypal payment to eZ publish

Author Message

Rajiv Ranjan

Monday 12 September 2005 10:50:54 pm

Hi all
I am working on paypal payment service.
After chekout the page goes to paypal payment
service and after payment in paypal the page is not redirected to eZ publish.
It gives the error "We did not get a confirmation from the payment server".

Please help me.

Andy Caiger

Thursday 08 March 2007 3:58:52 am

Did you get an answer? I am using ezPublish 3.8.0 and have the same problem with paypal, whether I use the sandbox or live paypal.

EAB - Integrated Internet Success
Offices in England, France & China.
http://www.eab.co.uk http://www.eab-china.com http://www.eab-france.com

Stuart Fenton

Thursday 08 March 2007 4:09:17 am

If you look in the palpal log file you will find the errors. Usually it's a currency mismatch or Paypal ezPublish paypalChecker does not understand the terms coming from paypal. I think paypal says "verified" when ezPublish uses "authorised" of something like that.

There in var/log and are called:
eZPaymentChecker.log
eZPaymentGatewayType.log
eZPaypalType.log
eZPaypal_notify_url.log
eZPaypalChecker.log

Regards
Stuart

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Andy Caiger

Friday 09 March 2007 5:32:45 am

Thanks, that was helpful... up to a point. There was nothing in var/log/eZPaypalChecker.log for the transactions that failed. Any suggestions where else to look?

EAB - Integrated Internet Success
Offices in England, France & China.
http://www.eab.co.uk http://www.eab-china.com http://www.eab-france.com

Stuart Fenton

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:

"&notify_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

jy peps

Thursday 02 August 2007 8:18:52 am

Hello , i'm trying paypal in test environment on my computer and i have this problem too :

i have set up the paypal workflow/trigger successfully but seem to have a problem when paypal redirects me back to my site. Once I pay and paypal redirects to the checkout script I get the following message:

"Waiting for a response from the payment server. This can take some time."
After 3 refreshes it then displays
"We did not get a confirmation from the payment server"

and i haven't this files created in var/log:
eZPaymentChecker.log
eZPaypal_notify_url.log
eZPaypalChecker.log

i have only
eZPaymentGatewayType.log
eZPaypalType.log

it seems ezpaypalchecker.php isn't called :( why ?

paypal sent back the url :
http://127.0.0.1/ez/index.php/shop_site/shop/checkout/?txn_type=web_accept&
payment_date=06%3A52%3A11+Aug+02%2C+2007+PDT&last_name=User&
residence_country=FR&pending_reason=unilateral&item_name=Cube&
payment_gross=&mc_currency=EUR&payment_type=instant&payer_status=unverified&
verify_sign=AC0O5qUUYIVklbv8EyiU6kEHWDlcAwO38UGGzJ.rJOEuzbTQw4gRkWHb&
test_ipn=1&payer_email=xxx@xxx.fr&tax=0.00&txn_id=0&quantity=1&
receiver_email=xxx@xxx.fr&first_name=Test&payer_id=PVFDNKK9FSTE8&
item_number=&payment_status=Pending&shipping=0.00&mc_gross=84.00&
custom=18&charset=windows-1252&notify_version=2.4&merchant_return_link=Retour+chez+le+marchand

help plz :)

André R.

Friday 03 August 2007 12:11:17 am

You really need to read the install file, the only real requirement is that you are on a publicly accessible domain name. 'localhost' is not one of those by a far shoot!

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

christian bencivenni

Tuesday 08 January 2008 3:42:51 am

VERY URGENT
With many difficulties I set up an environment and configured it.
Now I Have the same error message:
"Waiting for a response from the payment server. This can take some time."
And after 3 refreshes it then displays
"We did not get a confirmation from the payment server"

In the logs I can find:

...
08-01-2008 12-29 payment_status = Pending
08-01-2008 12-29 shipping = 0.00
08-01-2008 12-29 mc_gross = 36.00
08-01-2008 12-29 custom = 45
08-01-2008 12-29 charset = windows-1252
08-01-2008 12-29 notify_version = 2.4
08-01-2008 12-29 requestValidation. response from server is: VERIFIED
08-01-2008 12-29 check Field ----
08-01-2008 12-29 ERROR - receiving value doesn't match!!!
08-01-2008 12-29 Field :payment_status
08-01-2008 12-29 Value :Pending
08-01-2008 12-29 Expected value :Completed
08-01-2008 12-29 ----
08-01-2008 12-29 checkPaymentStatus faild

Where is my error?

Horst Lindlbauer

Tuesday 07 October 2008 5:24:24 am

the problem is this:

08-01-2008 12-29 Field :payment_status
08-01-2008 12-29 Value :Pending
08-01-2008 12-29 Expected value :Completed

Your payment gateway expects the value of payment_status to be "Completed" but gets "Pending".
You can either disable accepting "Pending" payments in your paypal (sandbox) account (your test buyer will have to enter credit card data then) or allow "Pending" payments in your extension (not recommended).
If you use ezpaypal this is done in extension/ezpaypal/classes/ezpaypalchecker.php

---------------------------------------
http://www.lbm-services.de