Paypal Ipn Issue With Order Status

Hi,

for some reason from time to time we receive orders paid via PayPal and IPN response first says: "Completed" but some minutes later it says "Transaction cancelled by customer" and obviously the order status changes back to Incomplete although In paypay status is still Completed and payment is received.

Any idea what is going on?

What do you see in the logs for this order? Who changes order status second time?

According to the logs looks like customer changed the order status to Incomplete second time. It happened straight after the status was Processed (same minute).

Normally it is impossible for customers to change the status of the order. But it is also difficult to know which steps customer did in PayPal after payment was done.

"Customer" means that the order status was changed when the user returns to the store. What PayPal service do you use?

Yes you are right. The status changes back to Incomplete when customer return to the store. I just compared with other PayPal orders and when customer does not return to the store everything works well.



We use standard PayPal (initial order status is set to Incomplete)

this happened to me and the 3rd post on here in the past week about same. I have asked CS to check for me and its on going.

Can I ask how do you find in the logs how it changed , is it the logs in cs back end or server logs, I didnt see problems in my normal baclk end logs .

This is the point. From the first sight there is no problem in the logs.

But if you check your CS CART logs and server logs all orders which are changed back to Incomplete have the line that customer returned to the shop.

For example I have it like this:

Orders (change status) = Response from IPN User Time
Order: # 123
Status: Incomplete -> Processed --- 17/08/2018, 19:48

Server log:

POST index?dispatch=payment_notification.paypal_ipn HTTP/1.1

Orders (change status) = Customer returns to the store
Order # 123
Status: Processed -> Incomplete Customer name 17/08/2018, 19:51

Server log:

GET index?dispatch=payment_notification.cancel&payment=paypal&order_id=123 HTTP/2.0

Isn't this then a paypal issue in that the inital response is okay (status == processed) but when IPN sends its response, the result forces cs-cart to mark the order as incomplete. It looks like the IPN GET is saying the order was cancel. I'd look into what paypal is seeing in the order that is causing paypal to cancel the payment. (or to send that notification) I.e. have paypal look into why it is sending a 'cancel' request.

IPN with completed payment is only sent once and it is correct. But looks like the problem comes when customer clicks the button "Return to the store". PayPal still has correct transaction status Completed.

There is some kind of messup between $return_url and $cancel_url. Instead of $return_url Paypal has $cancel_url

I could not reproduce this situation in Paypal sandbox (May be in live it will be different). I mean Return to Shop button after payment is done works ok.

But In PayPal payment window there is button "Cancel and return to the store". Of course when customer press this button/link it sends $cancel_url and reset the order to Incomplete.

Just my guessing, if customer paid by PayPal in second window (second attempt) but still had first attempt payment window still open and after paying in second window returned to first window and pressed this link we could easily get this PAID/INCOMPLETE case.

Could someone solve Paid / Incomplete issue? It was ok for one week, but now appears again. It is a big headache to control all paypal orders manually to double check if order is really incomplete or really paid.

Mine was fine for a while too then other started appearing. I opened a ticket with cs who are looking into it

As far as I see they are changing the status from Open to Paid and then changing it to Open again. This is a double payment situation in general terms. There are two main provisions that allow us to avoid such situations:

- if the customer cancelled the payment, the store allows him to make the payment again, status is not changed to Paid;
- when the payment is complete, the cart is cleared, so there should be no double payments.

This functionality provide by the core of CS-Cart. Your version (4.5.2) is suitable for this as well.

I have tested your system with our test Paypal's account on different browsers and reproduced the issue only the one way:

1. I have submitted the order and proceeded to Paypal processor.

2. When the Paypal is processing the payment I stopped the page loading and clicked go back button. I did not close the page and I logged in to Paypal again to make a payment.

3. After login the Paypal page shows a message that the payment was already done and suggesting us to return to the store.

The Paid status is set on the step 2 and changing again to Open on the step 3 with a message Transaction was canceled by the customer as Paypal protects customer from double payment. Unfortunately I failed to reproduce the issue when I am not clicking any button and stop the payment process.

I suggest you can shorten the payment process by enabling Auto return functionality in your Paypal's account:
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/ProfileAndTools/#auto-return-the-buyer-to-your-website

then after a response from me I got this, so it seems they are looking for more info on browser etc to help understand the situation.

The CS-Cart handles incoming returns and set the status according to them. I can make a suggestion that the auto-return is not working or the whole Paypal process freezes for some users, and they have re-submitting the payment. If there are any details (operating system, browser version), that can help us to understand the situation, we would be grateful.

Thanks for sharing the info.

I also think also that the problem is initially provoked by cancel&return button.

Is $cancel_url only used for that particular button? or there are more buttons in PayPal user account that use cancel url? (I mean may be temporary to comment it in PayPal addon in case of just one button).

When I get more orders like this I will try to collect OS and Browser version and post it here.

Also it is impossible to activate Auto Return functionality in case of several stores in different languages (Ultimate) and one PayPal account since you can introduce only one return domain.

https://example.com/index.php?dispatch=payment_notification.return&payment=paypal

Also it is impossible to activate Auto Return functionality in case of several stores in different languages (Ultimate) and one PayPal account since you can introduce only one return domain.

https://example.com/index.php?dispatch=payment_notification.return&payment=paypal

The return url is passed from the payment method and will utilize the storefront domain from which the order was placed. Did I miss something in the question? Paypal has defaults, but the payment method should be the actual controlling entity.

I believe that you explained standard functionality.

But I was talking about AutoReturn functionality option, which can be activated in PayPal account, what was proposed by CS CART in #12

This is ok if you have only one store. You just activate Auto Return and introduce return url for this domain.

https://docs.cs-cart.com/4.5.x/user_guide/payment_methods/paypal.html?highlight=paypal

But how can you activate Auto Return functionality in case of several domains (on different languages) and one business PayPal account? For example in case of CS Cart Ultimate. There is no option in PayPal to introduce several return url in PayPal.

Additional info for CS CART team.

Just got another Paid/Incomplete order.

This is info regarding user system:

"Mozilla/5.0 (Linux; Android 8.0.0; SM-G950F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36"

This is a serious problem.we have to check incompleted orders all time. Did someone trythe “Auto return” functionality? Is it working?

it is a problem, you have to control daily if everything is fine. If you have only one strore auto return will work fine.

Thanks i'll try auto return.