Missing orders after paying with PayPal

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
We are using paypal commerce as our payment gateway and have had several instances where orders are not going trough. Customers are receiving the confirmation from their bank / paypal however the order would remain in their cart.
When cross checking this with the PayPal log we could see that nopCommerce has sent a 200 back to PayPal and as one would guess there would be no errors in the nopCommerce log.
There have also been instances where we find errors in the log "Could not find an order" by a "Guest" customer (which is somewhat strange as we have not enabled Guest checkout

We are using the nopCommerce 4.40.4 with Paypal Commerce 1.10

Short message
Payments.PayPalCommerce error:
Could not find an order c2bdf344-7bba-4f55-9f2e-fdd905595c7c
Full message
Nop.Core.NopException: Could not find an order c2bdf344-7bba-4f55-9f2e-fdd905595c7c
   at Nop.Plugin.Payments.PayPalCommerce.Services.ServiceManager.<>c__DisplayClass37_0.<<HandleWebhookAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Nop.Plugin.Payments.PayPalCommerce.Services.ServiceManager.HandleFunctionAsync[TResult](Func`1 function)
Page URL
plugins/paypalcommerce/webhook
2 years ago
The same has already been reported (starting from here). We'll check this issue shortly.

BTW, are you using any third-party plugins (especially for checkout) or a theme?
2 years ago
RomanovM wrote:
The same has already been reported (starting from here). We'll check this issue shortly.
BTW, are you using any third-party plugins (especially for checkout) or a theme?


I've found out awhile ago that PayPal was sending webhooks just after the user has selected PayPal payment option in nop (during checkout) even through the paypal check out hasn't completed. This unhandled webhook could be trigger a few seconds later or up to 30 mins.

So I just added the line in ServiceManager.cs to ignore the webhook as it serves no purpose to the admin or the customer. This maybe one of the issues but not all, but I haven't had any more problems since.


...
                if (!Guid.TryParse(orderReference, out var orderGuid))
                    throw new NopException($"Could not recognize an order reference '{orderReference}'");

                if (webhookResourceType.Equals("checkout-order"))
                {
                    // there is no more processing for checkout-order webhook. just return true;
                    return true;
                }

                var order = await _orderService.GetOrderByGuidAsync(orderGuid);
                if (order == null)
                    throw new NopException($"Could not find an order {orderGuid}");
...
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.