Change Order Status from Paypal

Phoca Cart - complex e-commerce extension
Rmendez
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 31 Aug 2021, 15:40

Change Order Status from Paypal

Post by Rmendez »

Hello:

I have instaled phocar cart. Really its an exceptional extension.
But redirecting from paypal to change the order status work fine when cart has only 1 item, but dont change the order status when cart has more than one item.

Is that en error??

Thanks....

Rafael
Cliffdiver
Phoca Member
Phoca Member
Posts: 25
Joined: 05 Apr 2020, 09:10

Re: Change Order Status from Paypal

Post by Cliffdiver »

Hello,

I have nearly the same problem. Sometimes the order status changes after successfull paypal payment, and somethimes not. It is not really easy to find out, why. The IPN of paypal says 200, so it means everything went fine. Also the infopage says everything ok, only the order status doesn't change.
It doesn't matter if there are one or more items in the cart, with or withount discounts...
At the moment I solve this problem by manually checking the paypal emails and the orders, but in future i should work automatically.

Greatings
Chris
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Change Order Status from Paypal

Post by Jan »

Hi,

do you get some information in Logs (you can enable logging in Phoca Cart options and if PayPal conacts your server, there will be added an entry to log with information)

The problem is, when this happens sometimes, means, the code should be Ok, because it works and the question is if paypal contacts the server properly :idea:

Jan
If you find Phoca extensions useful, please support the project
Cliffdiver
Phoca Member
Phoca Member
Posts: 25
Joined: 05 Apr 2020, 09:10

Re: Change Order Status from Paypal

Post by Cliffdiver »

PayPal contacts the server properly.
In the logs i find some "ERRORs" telling me the following

Order Id: 153
Txn Id: 5A5690810N0692416
Message: Total amount does not match
Total amount in eshop: 59.33
Total amount on PayPal: 59.28 .... (some further information)

another error message is

"No order id or payment status found in payment response, User: Anonymous"

Very rare is the case, that the paypal payment is successful, also the log is saying that it was, but the order status changes to canceled. Also the history of this order says, that the payment was successfully.

I can't rebuild the error to fix the problem, but it happens again and again.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Change Order Status from Paypal

Post by Jan »

Hi, hmmm, these are in fact fatal errors - if PayPal send to your server wrong information like wrong amount or information without order ID, then of course the shop cannot manage this answer and cannot e.g. change the status if the information does not fit.

Do you get more detailed information. Try to see why the amount is different - what is displayed on eshop, what in Paypal account, why there is anohter amount. Try to see the error with no order id and try to compare it with help of time with some order.

When the total amount does not match - then nothing will be done - so in such case, status will be not changed
The same with ID - if the server does not get info about order ID, stats will be not changed

Jan
If you find Phoca extensions useful, please support the project
Rmendez
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 31 Aug 2021, 15:40

Re: Change Order Status from Paypal

Post by Rmendez »

Hi....

Jan but....what's the solution for this error?

Rafael
Cliffdiver
Phoca Member
Phoca Member
Posts: 25
Joined: 05 Apr 2020, 09:10

Re: Change Order Status from Paypal

Post by Cliffdiver »

HY Jan,

i found several things, which are not working properly.
The biggest problem is, which i think is leading to the fact, that the status is not changed: If the eshop order contains a price rounding it's leading to the Error with the different prices. I also found out why.

EShop calculates the following: Sum of netto prices - discounts + tax + rounding = brutto price
PayPal calculates the following: Sum of nettor prices - discounts + tax = brutto prices.

The sum of netto prices on paypal includes the rounding, but the tax is calculated without that rounding, so it leads to a different brutto total sum.

There are also cases, where the tax is calculated wrongly by the eshop. I can't figure it really out, but it's a big problem.

https://shared-assets.adobe.com/link/04 ... 564ec3ddc0
https://shared-assets.adobe.com/link/33 ... 149a07e056
https://shared-assets.adobe.com/link/2c ... 477be0a969
Cliffdiver
Phoca Member
Phoca Member
Posts: 25
Joined: 05 Apr 2020, 09:10

Re: Change Order Status from Paypal

Post by Cliffdiver »

Hallo again,

it has definitely something to do with the rounding process.
If i configure the phocashop to "round downwards", then everything wents fine. It's not 100% correct, as you give a little to less discount, but in my case this are some € 0,02 to € 0,05. I will test some more cases, but at the moment it works for me.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Change Order Status from Paypal

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply