Possible issue with order items not being registered on order
orjansteffensen opened this issue · 8 comments
In short, sometimes an order is registered and payed, but the order item data is not saved on the order.
It is not consistent, and happens seldom. There is not much data to dig into. But when it has happened it has been with Vipps as chosen payment gateway. Due to its seldomness, and since I don't know how to replicate it, I cannot know for sure if this is because of the Vipps plugin, or something else.
Attached screenshot of latest order. (I've removed the customer details from the screenshot.)
The product purchased is a physical product (a book). The price is correct, but the order item itself is missing. Also, the payment has been captured instantly since it probably has been identified as a virtual product.
Bit of an update. It might be coincidental, but one thing all the orders have in common, is that they all use a coupon code. I have tested an order myself with coupon, and couldn't replicate the problem.
Hi
Do you have a Vipps orderId that has failed? We can check our logs for more details.
Christian, Vipps
Well, the orders are successfully charged, but here are some of the orders where the order items have not been registered.
Vipps account: Organized.no 540358
Date: 22.12.2020
Order ID: org626606
Transaction ID: 2395003507
Date: 16.12.2020
Order ID: org626121
Transaction ID: 2848002716
Date: 02.12.2020
Order ID: org625213
Transaction ID: 2505001010
Date: 16.11.2020
Order ID: org624008
Transaction ID: 5815215621
I've also checked the logs for Klarna checkout (default payment gateway where customer enters e-mail and postcode before being able to choose between Klarna and Vipps). The order items are listed correctly in that log.
Some questions:
- Is the order correct except for the actual order item data? That is, there is an order item, with a price and so forth, but no product name, sku etc?
- This does not look like it has been processed with Express Checkout, is this during a regular checkout procedure?
- You mention Klarna - are you processing these orders using the "external payment method" feature of Klarna?
If you are actually getting an order with faulty order item data, something has probably gone pretty wrong during the order creation process; in which case there ought to be some kind of error message in your log files (either Woo's logfiles or the system log).
If this is an Express Checkout order; those are handled a bit differently (because a normal Woo order must have an address), so this distinction is important.
Is the order correct except for the actual order item data? That is, there is an order item, with a price and so forth, but no product name, sku etc?
Yes. All is correct, except for the order items which are blank.
This does not look like it has been processed with Express Checkout, is this during a regular checkout procedure?
Not using express checkout no. We haven't started using it yet.
You mention Klarna - are you processing these orders using the "external payment method" feature of Klarna?
Correct. Using the plugin Klarna Checkout for Woocommerce, with Vipps as external payment method.
Here's an excerpt from the Klarna log where the order items are listed correctly. No error log for Vipps on that date. (It doesn't seem that I have system logs older than 7 days, so I'm not able to check them.)
"order_lines":[{"type":"physical","reference":"9788293428671","name":"*Mine f\u00f8rste \u00e5r \u2013 beige*","quantity":1,"unit_price":39900,"tax_rate":2500,"total_amount":35910,"total_discount_amount":3990,"total_tax_amount":7182,"product_url":"https:\/\/www.organized.no\/produkt\/mine-forste-ar\/?attribute_farge=Beige","image_url":"https:\/\/www.organized.no\/wp-content\/uploads\/2020\/05\/mine-forste-ar-beige-1-600x600.jpg"},{"type":"physical","reference":"4007817308356","name":"*Staedtler pigment liner 6-pack*","quantity":1,"unit_price":15900,"tax_rate":2500,"total_amount":14310,"total_discount_amount":1590,"total_tax_amount":2862,"product_url":"https:\/\/www.organized.no\/produkt\/staedtler-pigment-liner-6-pack\/","image_url":"https:\/\/www.organized.no\/wp-content\/uploads\/2019\/05\/staedler-liner-black-600x600.jpg"},
Correct. Using the plugin Klarna Checkout for Woocommerce, with Vipps as external payment method.
This should really have been a normal checkout situation with a normal order object then.
I would expect there to be some kind of error when this happens; Unfortunately I don't think I can debug it without more information. It seems likely that the "object" of the order item (the product, normally) has been lost so that just the price remains, but I'm not sure what kind of mechanism would do this in the normal checkout function; coupon or no.
I'll keep an eye out for it again and check logs when it happens to a new order.
I've found every order with the problem from back to september. There are two patterns that I can find.
- Payment method: Vipps (as stated earlier)
- Device: iPhone, OS 14_0 / 14_1 / 14_2 > Safari/604.1
While that said, there are also plenty of orders without errors that have those same parameters, so it might mean nothing.
Thank you for looking into it and reporting the issue.