Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in PayPal Express #145

Open
villagedefrance opened this issue Mar 3, 2018 · 16 comments
Open

Possible bug in PayPal Express #145

villagedefrance opened this issue Mar 3, 2018 · 16 comments

Comments

@villagedefrance
Copy link
Owner

It has been reported in the Forum that an issue could exist in PayPal Express payment.
Reference: http://forum.villagedefrance.net/showthread.php?tid=14&pid=98#pid98

DavidB had no issues with it in v1.8.4 but PP Express has been updated since.
I will investigate but I am unable to test it.

@gob33 Do you have a working version? Any chance you could have a look at this for us?

@gob33
Copy link
Contributor

gob33 commented Mar 3, 2018

I saw DavidB post.
I made some changes in the admin part, not the catalog part so i doubt i introduced a bug.
Reinstalling or changing API does nothing, better to see the log if transaction succeeded but not the return in shop.
Suspect the if() tests for redirection in catalog controller to be bad.
Unable to test in real even in sand box since they passed to TLS1.2
All Paypal payments in OC run approximatively, when there is problem noboby know where to look at.

@villagedefrance
Copy link
Owner Author

I possibly changed something after your last PR, something to do with "Token_id" if I remember correctly, but it has been a while ...

Would it be possible for you to create a new PR with your last known good version?
If I have made changes then they will be obvious to see and I will then remove them.

FYI, I have also published a patch with the old PP Express v1.8.4 version, but I don't really want to commit that if we can find an answer.

@gob33
Copy link
Contributor

gob33 commented Mar 3, 2018

I visualy compared catalog controler PP Express v1.8.4 with mine current line by line but saw nothing important, the code is better in recent version dealing with possible functions failure.
My PPexpress version is same as 1.10.2
The improved log file should show more if it has not been deleted.
It is possible to test without Paypal by manualy simulating $response value in code.
Whereas:

2018-03-02 20:32:56 - PHP Notice: Undefined index: paypal in /var/www/web/catalog/controller/payment/pp_express.php on line 1355
2018-03-02 20:32:56 - PHP Notice: Undefined index: PAYERID in /var/www/web/catalog/controller/payment/pp_express.php on line 1360
2018-03-02 20:32:56 - PHP Notice: Undefined index: order_id in /var/www/web/catalog/controller/payment/pp_express.php on line 1363
2018-03-02 20:32:56 - PHP Notice: Undefined index: token in /var/www/web/catalog/controller/payment/pp_express.php on line 1366 

refer to $this->session->data['paypal'] not defined in function checkoutReturn().
A session problem ? Or one page checkout problem ?

@gob33
Copy link
Contributor

gob33 commented Mar 4, 2018

I found a "$paypal_fee_fee" not defined in .tpl
The call() doesnt return false on curl error for catalog/model, it is different of admin/model call() for some reason ? Has it been overrided, i dont know, except these functions should be equal.

@villagedefrance
Copy link
Owner Author

Yes, "$paypal_fee_fee" is a "Total" extension, to add an extra fee for customers choosing any one of the Paypal payment options at Checkout. It only adds to the total amount to pay and shouldn't affect the processing.

I had a look at both call() functions in the Model files, Admin vs Catalog, and they are indeed different. Do you know which one is the good one and which one needs updating?

I am going to investigate on my side, comparing with OC main code.
Thank you for looking into this for us.

villagedefrance added a commit that referenced this issue Mar 4, 2018
Added INR currency and minor code updates - no fix yet
@villagedefrance
Copy link
Owner Author

OC v3.1.0.0b seems to be using 2 different version in Admin and in Catalog, 84 and 109 respectively.
No real other clues apart from that.

@gob33
Copy link
Contributor

gob33 commented Mar 4, 2018

The good call() is in admin, it returns false when curl fails so that it is tested in controller
if ($response === false)........
Api version is unsafe, it varies with the country and even by Paypal merchant account.

If someone can explain me the real utility of RESEND button and call_data ??
Why resending saved data after a failure instead of re-cliking again on a CAPTURE / REFUND / VOID button ? Why they did that ??

@gob33
Copy link
Contributor

gob33 commented Mar 4, 2018

I searched in closed pull requests and effectively I did a commit 331d107 for new Paypal Express but my changes in the catalog part seem have been all overwrited by old version.

@villagedefrance
Copy link
Owner Author

I don't remember making such big changes in the Catalog. I probably made some minor code standards adjustments but not changing an entire function like $call().

Any chance you could make a new PR? or send me your files so I can commit them back myself.

Regarding the RESEND button, yeah, that's weird because browser generally don't like that, and this is also potentially unsafe. No idea why it is in there.

@gob33
Copy link
Contributor

gob33 commented Mar 5, 2018

I can do a new pull request starting from 331d107 and comparing but it will take some time as i go slowly on spare time.

@gob33
Copy link
Contributor

gob33 commented Mar 6, 2018

For the moment i get an SSL error with github connexion
"error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version".
Unable to do something with that fucking github.

@gob33
Copy link
Contributor

gob33 commented Mar 6, 2018

Solved by upgrading git for windows from 1.9.5 to 2.10.0. But I am limit of windows xp. Need win 7 but too long to prepare.

@villagedefrance
Copy link
Owner Author

Thank you for your efforts. they are much appreciated.
If you can't get Github working, you could just send me the files by email to commit, if that helps.

@gob33
Copy link
Contributor

gob33 commented Mar 6, 2018

So i inspected PPExpress and only saw the catalog call() which should be rewritten as the admin call()
The rest seems ok using comparison tool.
I dont know how it has changed.

villagedefrance added a commit that referenced this issue Mar 6, 2018
Call() function updated in catalog as possible fix. ... needs testing.
@gob33
Copy link
Contributor

gob33 commented Mar 7, 2018

Seems recurring payment doesnt work in OC PPExpress: opencart/opencart#5084
Needs testing.

@gob33
Copy link
Contributor

gob33 commented Jun 26, 2018

I have read the Paypal NVP code in OC deeply and i can tell that all errors reported by merchants do not surprise me. The code is approximative, not bullet proof, taken from a free extension which has not been updated since long time. The transaction view is incomprehensible with a formatRow() function comming from transaction search. The resend is idiot. They added a debug field to trace hazardous response. And nobody at OC cares about the code since 1.5.6 at least as it has not changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants