ShopifySharp icon indicating copy to clipboard operation
ShopifySharp copied to clipboard

CheckoutService data type conversion exception

Open siuhleung7 opened this issue 2 years ago • 1 comments

Hello, I use the CheckoutService to get the checkout list but showing the below error:

"864bd796bee92338a07275460b7f27b2" to type 'system.nullable`1[system.int64]'. path 'checkouts[0].line_items[0].id'.

The line item Id may not be in long format..

siuhleung7 avatar Dec 02 '21 05:12 siuhleung7

Thanks for the bug report! It looks like CheckoutLineItem will need to stop extending LineItem and ShopifyObject by extension, and instead move most of the LineItem properties into CheckoutLineItem. That'll require a small bit of work (mostly looking up the documentation and making sure each property gets copied over). Were you able to work around this? If not, the quickest solution would probably be overriding the CheckoutService methods to return your own custom line item class that have a string id instead of a long id.

nozzlegear avatar Jan 11 '22 15:01 nozzlegear