Closed enesbehlul closed 4 years ago
I believe you had some sort of similar code while creating your order. In case not, this is a working sample of mine. It's true that current version of prestasharp isn't of much help when dealing with error.
var order = await orderFactory.AddAsync(new order()
{
id_cart = cart.id,
id_address_delivery = cart.id_address_delivery,
id_address_invoice = cart.id_address_invoice,
id_currency = euroCurrency.id,
id_customer = cart.id_customer,
id_lang = languageFr.id,
id_carrier = defaultCarrier.id,
total_paid = input.TotalTTC,
total_products_wt = input.TotalTTC,
total_shipping_tax_incl = input.TotalShippingTTC,
payment = "TPE",
module = "ps_wirepayment",
//state
});
@oromand i tried this way but i got same result. thanks anyway
I found my problem, it was about creating cart actually. when i was adding a product to cart, in cart_rows list, i gave product_attribute_id = 1 for every product. that was the problem. it should be zero.
I am using prestasharp v1.2.8 and prestashop v1.7.6.8
trying to add order to order factory by using default pre created products
No problem with,
when i try to add new order with a different product, prestasharp returns exception (different product is also a default product)
debug mode exception : Object reference not set to an instance of an object. null reference exception debug off exception : Prestashop failed to serve XML response instead got text: HttpStatusCode: InternalServerError Bukimedia.PrestaSharp.PrestaSharpException"