Jump to content

Webservice Order Validate error


rzvngbrl

Recommended Posts

Hi guys,

It's been almost two days since I try to figure it out the best way I can...

 

Here is what what i'm doing:

 

IonicApp - using POST method with the following:

 

this.cart = {
  order_id: orderID,
  allow_seperated_package: 0,
  associations: {cart_rows: {element[spam-filter],
  id_address_delivery: 2070,
  id_address_invoice: 2070,
  id_carrier: 0,
  id_currency: 3,
  id_customer: this.userProvider.user.id,
  id_guest: 0,
  id_lang: 3,
  id_shop: 1,
  id_shop_group: 1,
}

[app-scripts] [12:07:09]  console.log: ---- RESPONSE: 
[app-scripts]             {"_body":"{\"cart\":{\"id\":\"18382\",\"id_address_delivery\":\"2070\",\"id_address_invoice\":\"2070\",\"id_currency\":\"3\",\"id_customer\":\"1808\",\"id_guest\":\"0\",\"id_lang\":\"3\",\"id_shop_group\":\"1\",\"id_shop\":\"1\",\"id_carrier\":\"0\",\"recyclable\":null,\"gift\":null,\"gift_message\":null,\"mobile_theme\":null,\"delivery_option\":null,\"secure_key\":null,\"allow_seperated_package\":\"0\",\"date_add\":\"2018-10-18
[app-scripts]             12:07:09\",\"date_upd\":\"2018-10-18 
[app-scripts]             12:07:09\",\"associations\":{\"cart_rows\":[{\"id_product\":\"174\",\"id_product_attribute\":\"1327\",\"id_address_delivery\":\"0\",\"quantity\":\"1\"}][spam-filter]}","status":201,"ok":true,"statusText":"Created","headers":{"date":["Thu","
[app-scripts]             18 Oct 2018 09:07:09 
[app-scripts]             GMT"] 

 

I get the CART ID as soon as I add it to the cart in this case the ID of the cart is 18382

 

this.order = {
  id_cart: responseData.cart.id,
  id_address_delivery: (formValues.deliveryType == 76 ? formValues.deliveryAddresses : 0),
  id_address_invoice: 0,
  id_carrier: 0,
  id_currency: 3,
  id_customer: this.userProvider.user.id,
  id_guest: 0,
  id_lang: 3,
  id_shop: 1,
  id_shop_group: 1,
  valid: 1,
  current_state: 3,
  module: 'cashondelivery',
  payment: 'Numerar',
  total_paid: Math.round(this.totalCart  * 100) / 100,
  total_paid_real: Math.round(this.totalCart * 100) / 100,
  total_products: this.totalItems,
  total_products_wt: 0,
  conversion_rate: 0,
};

 

this is the output XML:

 

[app-scripts] [12:07:09]  console.log: --- orderObject <root> <orders> <id_cart>18382</id_cart> 
[app-scripts]             <id_address_delivery>2468</id_address_delivery> <id_address_invoice>0</id_address_invoice> 
[app-scripts]             <id_carrier>0</id_carrier> <id_currency>3</id_currency> <id_customer>1808</id_customer> 
[app-scripts]             <id_guest>0</id_guest> <id_lang>3</id_lang> <id_shop>1</id_shop> <id_shop_group>1</id_shop_group> 
[app-scripts]             <valid>1</valid> <current_state>3</current_state> <module>cashondelivery</module> <payment>Numerar</payment> 
[app-scripts]             <total_paid>84</total_paid> <total_paid_real>84</total_paid_real> <total_products>1</total_products> 
[app-scripts]             <total_products_wt>0</total_products_wt> <conversion_rate>0</conversion_rate> </orders> </root> 
 

 

and this is the error:

 

[app-scripts] [12:07:09]  console.log: ---- RESPONSE: {"_body":"\nFatal error: Uncaught PrestaShopException: Can't save Order in 
[app-scripts]             /var/www/origini.com.ro/live/classes/PaymentModule.php:350\nStack trace:\n#0 
[app-scripts]             /var/www/origini.com.ro/live/classes/order/Order.php(1572): PaymentModuleCore->validateOrder('18382', '12', 
[app-scripts]             84, 'Numerar', NULL, Array, NULL, false, '')\n#1 
[app-scripts]             /var/www/origini.com.ro/live/classes/webservice/WebserviceRequest.php(1478): OrderCore->addWs()\n#2 
[app-scripts]             /var/www/origini.com.ro/live/classes/webservice/WebserviceRequest.php(1292): 
[app-scripts]             WebserviceRequestCore->saveEntityFromXml(201)\n#3 
[app-scripts]             /var/www/origini.com.ro/live/classes/webservice/WebserviceRequest.php(518): 
[app-scripts]             WebserviceRequestCore->executeEntityPost()\n#4 /var/www/origini.com.ro/live/webservice/dispatcher.php(87): 
[app-scripts]             WebserviceRequestCore->fetch('72APUNKDX6C29TX...', 'POST', 'orders', Array, false, '<root>\\n <ord...')\n#5 
[app-scripts]             {main}\n thrown in /var/www/origini.com.ro/live/classes/PaymentModule.php on line 
[app-scripts]             350\n","status":200,"ok":true,"statusText":"OK","headers":{"date":["Thu"," 18 Oct 2018 09:07:09 
[app-scripts]             GMT"],"content-encoding":["gzip"],"server":["nginx"],"x-powered-by":["PHP/7.0.28-0ubuntu0.16.04.1"],"vary":["Accept-Encoding"],"content-type":["text/html;
[app-scripts]             charset=utf-8"],"transfer-encoding":["chunked"],"connection":["keep-alive"],"keep-alive":["timeout=20"]}

 

Any help or hints here please?

 

Thank you,

Razvan

Link to comment
Share on other sites

Hello:

Are you sure that "Numerar" is a valid payment module/method?

To be sure what is wrong in your data you must validate the $order object before try to added. You can do it using:

$order->validateFields(false, true);

on PaymentModule line 340 and this method will return an error message from $order entity validation.

Regards

Link to comment
Share on other sites

18 hours ago, Rolige said:

Hello:

Are you sure that "Numerar" is a valid payment module/method?

To be sure what is wrong in your data you must validate the $order object before try to added. You can do it using:


$order->validateFields(false, true);

on PaymentModule line 340 and this method will return an error message from $order entity validation.

Regards

 

hell if I can see the error:

 

Order Object
(
    [id_address_delivery] => 2070
    [id_address_invoice] => 2070
    [id_shop_group] => 1
    [id_shop] => 1
    [id_cart] => 18695
    [id_currency] => 3
    [id_lang] => 3
    [id_customer] => 1808
    [id_carrier] => 79
    [current_state] => 
    [secure_key] => 
    [payment] => Numerar
    [module] => cashondelivery
    [conversion_rate] => 1.000000
    [recyclable] => 0
    [gift] => 0
    [gift_message] => 
    [mobile_theme] => 0
    [shipping_number] => 
    [total_discounts] => 0
    [total_discounts_tax_incl] => 0
    [total_discounts_tax_excl] => 0
    [total_paid] => 112.4
    [total_paid_tax_incl] => 112.4
    [total_paid_tax_excl] => 104.77
    [total_paid_real] => 0
    [total_products] => 84.77
    [total_products_wt] => 92.4
    [total_shipping] => 20
    [total_shipping_tax_incl] => 20
    [total_shipping_tax_excl] => 20
    [carrier_tax_rate] => 0
    [total_wrapping] => 0
    [total_wrapping_tax_incl] => 0
    [total_wrapping_tax_excl] => 0
    [invoice_number] => 
    [delivery_number] => 
    [invoice_date] => 0000-00-00 00:00:00
    [delivery_date] => 0000-00-00 00:00:00
    [valid] => 
    [date_add] => 
    [date_upd] => 
    [reference] => LTMWJKUTX
    [round_mode] => 4
    [round_type] => 1
    [webserviceParameters:protected] => Array
        (
            [objectMethods] => Array
                (
                    [add] => addWs
                )

            [objectNodeName] => order
            [objectsNodeName] => orders
            [fields] => Array
                (
                    [id_address_delivery] => Array
                        (
                            [xlink_resource] => addresses
                        )

                    [id_address_invoice] => Array
                        (
                            [xlink_resource] => addresses
                        )

                    [id_cart] => Array
                        (
                            [xlink_resource] => carts
                        )

                    [id_currency] => Array
                        (
                            [xlink_resource] => currencies
                        )

                    [id_lang] => Array
                        (
                            [xlink_resource] => languages
                        )

                    [id_customer] => Array
                        (
                            [xlink_resource] => customers
                        )

                    [id_carrier] => Array
                        (
                            [xlink_resource] => carriers
                        )

                    [current_state] => Array
                        (
                            [xlink_resource] => order_states
                            [setter] => setWsCurrentState
                        )

                    [module] => Array
                        (
                            [required] => 1
                        )

                    [invoice_number] => Array
                        (
                        )

                    [invoice_date] => Array
                        (
                        )

                    [delivery_number] => Array
                        (
                        )

                    [delivery_date] => Array
                        (
                        )

                    [valid] => Array
                        (
                        )

                    [date_add] => Array
                        (
                        )

                    [date_upd] => Array
                        (
                        )

                    [shipping_number] => Array
                        (
                            [getter] => getWsShippingNumber
                            [setter] => setWsShippingNumber
                        )

                )

            [associations] => Array
                (
                    [order_rows] => Array
                        (
                            [resource] => order_row
                            [setter] => 
                            [virtual_entity] => 1
                            [fields] => Array
                                (
                                    [id] => Array
                                        (
                                        )

                                    [product_id] => Array
                                        (
                                            [required] => 1
                                        )

                                    [product_attribute_id] => Array
                                        (
                                            [required] => 1
                                        )

                                    [product_quantity] => Array
                                        (
                                            [required] => 1
                                        )

                                    [product_name] => Array
                                        (
                                            [setter] => 
                                        )

                                    [product_reference] => Array
                                        (
                                            [setter] => 
                                        )

                                    [product_ean13] => Array
                                        (
                                            [setter] => 
                                        )

                                    [product_upc] => Array
                                        (
                                            [setter] => 
                                        )

                                    [product_price] => Array
                                        (
                                            [setter] => 
                                        )

                                    [unit_price_tax_incl] => Array
                                        (
                                            [setter] => 
                                        )

                                    [unit_price_tax_excl] => Array
                                        (
                                            [setter] => 
                                        )

                                )

                        )

                )

        )

    [_taxCalculationMethod:protected] => 0
    [cacheCustomer:protected] => 
    [id] => 
    [id_shop_list] => 
    [get_shop_from_context:protected] => 1
    [table:protected] => orders
    [identifier:protected] => id_order
    [fieldsRequired:protected] => Array
        (
            [0] => id_address_delivery
            [1] => id_address_invoice
            [2] => id_cart
            [3] => id_currency
            [4] => id_lang
            [5] => id_customer
            [6] => id_carrier
            [7] => payment
            [8] => module
            [9] => total_paid
            [10] => total_paid_real
            [11] => total_products
            [12] => total_products_wt
            [13] => conversion_rate
        )

    [fieldsSize:protected] => Array
        (
        )

    [fieldsValidate:protected] => Array
        (
            [id_address_delivery] => isUnsignedId
            [id_address_invoice] => isUnsignedId
            [id_cart] => isUnsignedId
            [id_currency] => isUnsignedId
            [id_shop_group] => isUnsignedId
            [id_shop] => isUnsignedId
            [id_lang] => isUnsignedId
            [id_customer] => isUnsignedId
            [id_carrier] => isUnsignedId
            [current_state] => isUnsignedId
            [secure_key] => isMd5
            [payment] => isGenericName
            [module] => isModuleName
            [recyclable] => isBool
            [gift] => isBool
            [gift_message] => isMessage
            [mobile_theme] => isBool
            [total_discounts] => isPrice
            [total_discounts_tax_incl] => isPrice
            [total_discounts_tax_excl] => isPrice
            [total_paid] => isPrice
            [total_paid_tax_incl] => isPrice
            [total_paid_tax_excl] => isPrice
            [total_paid_real] => isPrice
            [total_products] => isPrice
            [total_products_wt] => isPrice
            [total_shipping] => isPrice
            [total_shipping_tax_incl] => isPrice
            [total_shipping_tax_excl] => isPrice
            [carrier_tax_rate] => isFloat
            [total_wrapping] => isPrice
            [total_wrapping_tax_incl] => isPrice
            [total_wrapping_tax_excl] => isPrice
            [round_mode] => isUnsignedId
            [round_type] => isUnsignedId
            [shipping_number] => isTrackingNumber
            [conversion_rate] => isFloat
            [date_add] => isDate
            [date_upd] => isDate
        )

    [fieldsRequiredLang:protected] => Array
        (
        )

    [fieldsSizeLang:protected] => Array
        (
        )

    [fieldsValidateLang:protected] => Array
        (
        )

    [tables:protected] => Array
        (
        )

    [image_dir:protected] => 
    [image_format:protected] => jpg
    [def:protected] => Array
        (
            [table] => orders
            [primary] => id_order
            [fields] => Array
                (
                    [id_address_delivery] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_address_invoice] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_cart] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_currency] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_shop_group] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [id_shop] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [id_lang] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_customer] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_carrier] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [current_state] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [secure_key] => Array
                        (
                            [type] => 3
                            [validate] => isMd5
                        )

                    [payment] => Array
                        (
                            [type] => 3
                            [validate] => isGenericName
                            [required] => 1
                        )

                    [module] => Array
                        (
                            [type] => 3
                            [validate] => isModuleName
                            [required] => 1
                        )

                    [recyclable] => Array
                        (
                            [type] => 2
                            [validate] => isBool
                        )

                    [gift] => Array
                        (
                            [type] => 2
                            [validate] => isBool
                        )

                    [gift_message] => Array
                        (
                            [type] => 3
                            [validate] => isMessage
                        )

                    [mobile_theme] => Array
                        (
                            [type] => 2
                            [validate] => isBool
                        )

                    [total_discounts] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_discounts_tax_incl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_discounts_tax_excl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_paid] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                            [required] => 1
                        )

                    [total_paid_tax_incl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_paid_tax_excl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_paid_real] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                            [required] => 1
                        )

                    [total_products] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                            [required] => 1
                        )

                    [total_products_wt] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                            [required] => 1
                        )

                    [total_shipping] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_shipping_tax_incl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_shipping_tax_excl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [carrier_tax_rate] => Array
                        (
                            [type] => 4
                            [validate] => isFloat
                        )

                    [total_wrapping] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_wrapping_tax_incl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_wrapping_tax_excl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [round_mode] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [round_type] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [shipping_number] => Array
                        (
                            [type] => 3
                            [validate] => isTrackingNumber
                        )

                    [conversion_rate] => Array
                        (
                            [type] => 4
                            [validate] => isFloat
                            [required] => 1
                        )

                    [invoice_number] => Array
                        (
                            [type] => 1
                        )

                    [delivery_number] => Array
                        (
                            [type] => 1
                        )

                    [invoice_date] => Array
                        (
                            [type] => 5
                        )

                    [delivery_date] => Array
                        (
                            [type] => 5
                        )

                    [valid] => Array
                        (
                            [type] => 2
                        )

                    [reference] => Array
                        (
                            [type] => 3
                        )

                    [date_add] => Array
                        (
                            [type] => 5
                            [validate] => isDate
                        )

                    [date_upd] => Array
                        (
                            [type] => 5
                            [validate] => isDate
                        )

                )

            [classname] => Order
        )

    [update_fields:protected] => 
    [force_id] => 
    [product_list] => Array
        (
            [0] => Array
                (
                    [id_product_attribute] => 1333
                    [id_product] => 174
                    [cart_quantity] => 1
                    [id_shop] => 1
                    [name] => Pui pentru gătit
                    [is_virtual] => 0
                    [description_short] =>
<p>
    <span>Pui natural, crescut la sol şi hrănit cu furaje naturale la 
        <a href="/content/10-ferma-lui-tane">Ferma lui Ţane</a>
    </span>
</p>
<br />
<p>
    <span lang="FR">Creștem puii fără să-i grăbim și-i avem disponibili pe măsura cererii. Aşa se face că avem pui mai mari de 120 zile, când nu mai sunt aşa de fragezi. Aceştia sunt puii de gătit pe care-i recomandăm pentru supă şi preparate fierte. Sunt pregătiţi cu 24 de ore înainte de livrare şi ajung la tine vidaţi - refrigeraţi.
        <o:p></o:p>
    </span>
</p>
                    [available_now] => Disponibil
                    [available_later] => Disponibil la cerere
                    [id_category_default] => 204
                    [id_supplier] => 1
                    [id_manufacturer] => 8
                    [on_sale] => 0
                    [ecotax] => 0.000000
                    [additional_shipping_cost] => 0.00
                    [available_for_order] => 1
                    [price] => 84.770642
                    [active] => 1
                    [unity] => 2.2 kg.
                    [unit_price_ratio] => 0.000000
                    [quantity_available] => 35
                    [width] => 0.000000
                    [height] => 0.000000
                    [depth] => 0.000000
                    [out_of_stock] => 2
                    [weight] => 0
                    [date_add] => 2016-01-09 16:16:09
                    [date_upd] => 2018-10-25 08:34:10
                    [quantity] => 1
                    [link_rewrite] => pui-de-curte-de-la-ferma
                    [category] => pasari-de-curte
                    [unique_id] => 000000017400000013330
                    [id_address_delivery] => 2070
                    [advanced_stock_management] => 0
                    [supplier_reference] => 
                    [customization_quantity] => 
                    [id_customization] => 
                    [price_attribute] => 0.000000
                    [ecotax_attr] => 0.000000
                    [reference] => 0900
                    [weight_attribute] => 0.000000
                    [ean13] => 0
                    [upc] => 
                    [minimal_quantity] => 1
                    [wholesale_price] => 15.300000
                    [id_image] => 174-645
                    [legend] => Pui fraged
                    [reduction_type] => 0
                    [stock_quantity] => 35
                    [price_without_reduction] => 92.4
                    [price_with_reduction] => 92.4
                    [price_with_reduction_without_tax] => 84.770642
                    [total] => 84.77
                    [total_wt] => 92.4
                    [price_wt] => 92.4
                    [reduction_applies] => 
                    [quantity_discount_applies] => 
                    [allow_oosp] => 0
                    [features] => Array
                        (
                            [0] => Array
                                (
                                    [id_feature] => 11
                                    [id_product] => 174
                                    [id_feature_value] => 80
                                )

                            [1] => Array
                                (
                                    [id_feature] => 13
                                    [id_product] => 174
                                    [id_feature_value] => 64
                                )

                            [2] => Array
                                (
                                    [id_feature] => 14
                                    [id_product] => 174
                                    [id_feature_value] => 40
                                )

                            [3] => Array
                                (
                                    [id_feature] => 15
                                    [id_product] => 174
                                    [id_feature_value] => 76
                                )

                        )

                    [attributes] => Ambalaj : întreg 2.2 kg.
                    [attributes_small] => întreg 2.2 kg.
                    [rate] => 9
                    [tax_name] => TVA RO 9%
                    [warehouse_list] => Array
                        (
                            [0] => 0
                        )

                    [in_stock] => 1
                    [carrier_list] => Array
                        (
                            [80] => 80
                            [79] => 79
                        )

                )

        )

)

Link to comment
Share on other sites

5 hours ago, rzvngbrl said:

 

hell if I can see the error:

 

Order Object
(
    [id_address_delivery] => 2070
    [id_address_invoice] => 2070
    [id_shop_group] => 1
    [id_shop] => 1
    [id_cart] => 18695
    [id_currency] => 3
    [id_lang] => 3
    [id_customer] => 1808
    [id_carrier] => 79
    [current_state] => 
    [secure_key] => 
    [payment] => Numerar
    [module] => cashondelivery
    [conversion_rate] => 1.000000
    [recyclable] => 0
    [gift] => 0
    [gift_message] => 
    [mobile_theme] => 0
    [shipping_number] => 
    [total_discounts] => 0
    [total_discounts_tax_incl] => 0
    [total_discounts_tax_excl] => 0
    [total_paid] => 112.4
    [total_paid_tax_incl] => 112.4
    [total_paid_tax_excl] => 104.77
    [total_paid_real] => 0
    [total_products] => 84.77
    [total_products_wt] => 92.4
    [total_shipping] => 20
    [total_shipping_tax_incl] => 20
    [total_shipping_tax_excl] => 20
    [carrier_tax_rate] => 0
    [total_wrapping] => 0
    [total_wrapping_tax_incl] => 0
    [total_wrapping_tax_excl] => 0
    [invoice_number] => 
    [delivery_number] => 
    [invoice_date] => 0000-00-00 00:00:00
    [delivery_date] => 0000-00-00 00:00:00
    [valid] => 
    [date_add] => 
    [date_upd] => 
    [reference] => LTMWJKUTX
    [round_mode] => 4
    [round_type] => 1
    [webserviceParameters:protected] => Array
        (
            [objectMethods] => Array
                (
                    [add] => addWs
                )

            [objectNodeName] => order
            [objectsNodeName] => orders
            [fields] => Array
                (
                    [id_address_delivery] => Array
                        (
                            [xlink_resource] => addresses
                        )

                    [id_address_invoice] => Array
                        (
                            [xlink_resource] => addresses
                        )

                    [id_cart] => Array
                        (
                            [xlink_resource] => carts
                        )

                    [id_currency] => Array
                        (
                            [xlink_resource] => currencies
                        )

                    [id_lang] => Array
                        (
                            [xlink_resource] => languages
                        )

                    [id_customer] => Array
                        (
                            [xlink_resource] => customers
                        )

                    [id_carrier] => Array
                        (
                            [xlink_resource] => carriers
                        )

                    [current_state] => Array
                        (
                            [xlink_resource] => order_states
                            [setter] => setWsCurrentState
                        )

                    [module] => Array
                        (
                            [required] => 1
                        )

                    [invoice_number] => Array
                        (
                        )

                    [invoice_date] => Array
                        (
                        )

                    [delivery_number] => Array
                        (
                        )

                    [delivery_date] => Array
                        (
                        )

                    [valid] => Array
                        (
                        )

                    [date_add] => Array
                        (
                        )

                    [date_upd] => Array
                        (
                        )

                    [shipping_number] => Array
                        (
                            [getter] => getWsShippingNumber
                            [setter] => setWsShippingNumber
                        )

                )

            [associations] => Array
                (
                    [order_rows] => Array
                        (
                            [resource] => order_row
                            [setter] => 
                            [virtual_entity] => 1
                            [fields] => Array
                                (
                                    [id] => Array
                                        (
                                        )

                                    [product_id] => Array
                                        (
                                            [required] => 1
                                        )

                                    [product_attribute_id] => Array
                                        (
                                            [required] => 1
                                        )

                                    [product_quantity] => Array
                                        (
                                            [required] => 1
                                        )

                                    [product_name] => Array
                                        (
                                            [setter] => 
                                        )

                                    [product_reference] => Array
                                        (
                                            [setter] => 
                                        )

                                    [product_ean13] => Array
                                        (
                                            [setter] => 
                                        )

                                    [product_upc] => Array
                                        (
                                            [setter] => 
                                        )

                                    [product_price] => Array
                                        (
                                            [setter] => 
                                        )

                                    [unit_price_tax_incl] => Array
                                        (
                                            [setter] => 
                                        )

                                    [unit_price_tax_excl] => Array
                                        (
                                            [setter] => 
                                        )

                                )

                        )

                )

        )

    [_taxCalculationMethod:protected] => 0
    [cacheCustomer:protected] => 
    [id] => 
    [id_shop_list] => 
    [get_shop_from_context:protected] => 1
    [table:protected] => orders
    [identifier:protected] => id_order
    [fieldsRequired:protected] => Array
        (
            [0] => id_address_delivery
            [1] => id_address_invoice
            [2] => id_cart
            [3] => id_currency
            [4] => id_lang
            [5] => id_customer
            [6] => id_carrier
            [7] => payment
            [8] => module
            [9] => total_paid
            [10] => total_paid_real
            [11] => total_products
            [12] => total_products_wt
            [13] => conversion_rate
        )

    [fieldsSize:protected] => Array
        (
        )

    [fieldsValidate:protected] => Array
        (
            [id_address_delivery] => isUnsignedId
            [id_address_invoice] => isUnsignedId
            [id_cart] => isUnsignedId
            [id_currency] => isUnsignedId
            [id_shop_group] => isUnsignedId
            [id_shop] => isUnsignedId
            [id_lang] => isUnsignedId
            [id_customer] => isUnsignedId
            [id_carrier] => isUnsignedId
            [current_state] => isUnsignedId
            [secure_key] => isMd5
            [payment] => isGenericName
            [module] => isModuleName
            [recyclable] => isBool
            [gift] => isBool
            [gift_message] => isMessage
            [mobile_theme] => isBool
            [total_discounts] => isPrice
            [total_discounts_tax_incl] => isPrice
            [total_discounts_tax_excl] => isPrice
            [total_paid] => isPrice
            [total_paid_tax_incl] => isPrice
            [total_paid_tax_excl] => isPrice
            [total_paid_real] => isPrice
            [total_products] => isPrice
            [total_products_wt] => isPrice
            [total_shipping] => isPrice
            [total_shipping_tax_incl] => isPrice
            [total_shipping_tax_excl] => isPrice
            [carrier_tax_rate] => isFloat
            [total_wrapping] => isPrice
            [total_wrapping_tax_incl] => isPrice
            [total_wrapping_tax_excl] => isPrice
            [round_mode] => isUnsignedId
            [round_type] => isUnsignedId
            [shipping_number] => isTrackingNumber
            [conversion_rate] => isFloat
            [date_add] => isDate
            [date_upd] => isDate
        )

    [fieldsRequiredLang:protected] => Array
        (
        )

    [fieldsSizeLang:protected] => Array
        (
        )

    [fieldsValidateLang:protected] => Array
        (
        )

    [tables:protected] => Array
        (
        )

    [image_dir:protected] => 
    [image_format:protected] => jpg
    [def:protected] => Array
        (
            [table] => orders
            [primary] => id_order
            [fields] => Array
                (
                    [id_address_delivery] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_address_invoice] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_cart] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_currency] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_shop_group] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [id_shop] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [id_lang] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_customer] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [id_carrier] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                            [required] => 1
                        )

                    [current_state] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [secure_key] => Array
                        (
                            [type] => 3
                            [validate] => isMd5
                        )

                    [payment] => Array
                        (
                            [type] => 3
                            [validate] => isGenericName
                            [required] => 1
                        )

                    [module] => Array
                        (
                            [type] => 3
                            [validate] => isModuleName
                            [required] => 1
                        )

                    [recyclable] => Array
                        (
                            [type] => 2
                            [validate] => isBool
                        )

                    [gift] => Array
                        (
                            [type] => 2
                            [validate] => isBool
                        )

                    [gift_message] => Array
                        (
                            [type] => 3
                            [validate] => isMessage
                        )

                    [mobile_theme] => Array
                        (
                            [type] => 2
                            [validate] => isBool
                        )

                    [total_discounts] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_discounts_tax_incl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_discounts_tax_excl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_paid] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                            [required] => 1
                        )

                    [total_paid_tax_incl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_paid_tax_excl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_paid_real] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                            [required] => 1
                        )

                    [total_products] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                            [required] => 1
                        )

                    [total_products_wt] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                            [required] => 1
                        )

                    [total_shipping] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_shipping_tax_incl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_shipping_tax_excl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [carrier_tax_rate] => Array
                        (
                            [type] => 4
                            [validate] => isFloat
                        )

                    [total_wrapping] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_wrapping_tax_incl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [total_wrapping_tax_excl] => Array
                        (
                            [type] => 4
                            [validate] => isPrice
                        )

                    [round_mode] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [round_type] => Array
                        (
                            [type] => 1
                            [validate] => isUnsignedId
                        )

                    [shipping_number] => Array
                        (
                            [type] => 3
                            [validate] => isTrackingNumber
                        )

                    [conversion_rate] => Array
                        (
                            [type] => 4
                            [validate] => isFloat
                            [required] => 1
                        )

                    [invoice_number] => Array
                        (
                            [type] => 1
                        )

                    [delivery_number] => Array
                        (
                            [type] => 1
                        )

                    [invoice_date] => Array
                        (
                            [type] => 5
                        )

                    [delivery_date] => Array
                        (
                            [type] => 5
                        )

                    [valid] => Array
                        (
                            [type] => 2
                        )

                    [reference] => Array
                        (
                            [type] => 3
                        )

                    [date_add] => Array
                        (
                            [type] => 5
                            [validate] => isDate
                        )

                    [date_upd] => Array
                        (
                            [type] => 5
                            [validate] => isDate
                        )

                )

            [classname] => Order
        )

    [update_fields:protected] => 
    [force_id] => 
    [product_list] => Array
        (
            [0] => Array
                (
                    [id_product_attribute] => 1333
                    [id_product] => 174
                    [cart_quantity] => 1
                    [id_shop] => 1
                    [name] => Pui pentru gătit
                    [is_virtual] => 0
                    [description_short] =>
<p>
    <span>Pui natural, crescut la sol şi hrănit cu furaje naturale la 
        <a href="/content/10-ferma-lui-tane">Ferma lui Ţane</a>
    </span>
</p>
<br />
<p>
    <span lang="FR">Creștem puii fără să-i grăbim și-i avem disponibili pe măsura cererii. Aşa se face că avem pui mai mari de 120 zile, când nu mai sunt aşa de fragezi. Aceştia sunt puii de gătit pe care-i recomandăm pentru supă şi preparate fierte. Sunt pregătiţi cu 24 de ore înainte de livrare şi ajung la tine vidaţi - refrigeraţi.
        <o:p></o:p>
    </span>
</p>
                    [available_now] => Disponibil
                    [available_later] => Disponibil la cerere
                    [id_category_default] => 204
                    [id_supplier] => 1
                    [id_manufacturer] => 8
                    [on_sale] => 0
                    [ecotax] => 0.000000
                    [additional_shipping_cost] => 0.00
                    [available_for_order] => 1
                    [price] => 84.770642
                    [active] => 1
                    [unity] => 2.2 kg.
                    [unit_price_ratio] => 0.000000
                    [quantity_available] => 35
                    [width] => 0.000000
                    [height] => 0.000000
                    [depth] => 0.000000
                    [out_of_stock] => 2
                    [weight] => 0
                    [date_add] => 2016-01-09 16:16:09
                    [date_upd] => 2018-10-25 08:34:10
                    [quantity] => 1
                    [link_rewrite] => pui-de-curte-de-la-ferma
                    [category] => pasari-de-curte
                    [unique_id] => 000000017400000013330
                    [id_address_delivery] => 2070
                    [advanced_stock_management] => 0
                    [supplier_reference] => 
                    [customization_quantity] => 
                    [id_customization] => 
                    [price_attribute] => 0.000000
                    [ecotax_attr] => 0.000000
                    [reference] => 0900
                    [weight_attribute] => 0.000000
                    [ean13] => 0
                    [upc] => 
                    [minimal_quantity] => 1
                    [wholesale_price] => 15.300000
                    [id_image] => 174-645
                    [legend] => Pui fraged
                    [reduction_type] => 0
                    [stock_quantity] => 35
                    [price_without_reduction] => 92.4
                    [price_with_reduction] => 92.4
                    [price_with_reduction_without_tax] => 84.770642
                    [total] => 84.77
                    [total_wt] => 92.4
                    [price_wt] => 92.4
                    [reduction_applies] => 
                    [quantity_discount_applies] => 
                    [allow_oosp] => 0
                    [features] => Array
                        (
                            [0] => Array
                                (
                                    [id_feature] => 11
                                    [id_product] => 174
                                    [id_feature_value] => 80
                                )

                            [1] => Array
                                (
                                    [id_feature] => 13
                                    [id_product] => 174
                                    [id_feature_value] => 64
                                )

                            [2] => Array
                                (
                                    [id_feature] => 14
                                    [id_product] => 174
                                    [id_feature_value] => 40
                                )

                            [3] => Array
                                (
                                    [id_feature] => 15
                                    [id_product] => 174
                                    [id_feature_value] => 76
                                )

                        )

                    [attributes] => Ambalaj : întreg 2.2 kg.
                    [attributes_small] => întreg 2.2 kg.
                    [rate] => 9
                    [tax_name] => TVA RO 9%
                    [warehouse_list] => Array
                        (
                            [0] => 0
                        )

                    [in_stock] => 1
                    [carrier_list] => Array
                        (
                            [80] => 80
                            [79] => 79
                        )

                )

        )

)

But you print the entire $order object and not the result of function:

$order->validateFields(false, true);
Link to comment
Share on other sites

Sorry, I was AFK for a few days ...

 

so,

var_dump($order->validateFields(false, true)); die();

returns this:

/home/admin/web/origini.com.ro/public_html/classes/PaymentModule.php:342: bool(true)

 

if I remove the die from the line, now I get this:

 

Fatal error: Uncaught exception 'PrestaShopException' with message 'Property OrderDetail->id_order is empty' in /home/admin/web/origini.com.ro/public_html/classes/ObjectModel.php on line 909

PrestaShopException: Property OrderDetail->id_order is empty in /home/admin/web/origini.com.ro/public_html/classes/ObjectModel.php on line 909

Call Stack:
    0.0066     266056   1. {main}() /home/admin/web/origini.com.ro/public_html/webservice/dispatcher.php:0
    0.4480    8662424   2. WebserviceRequestCore->fetch() /home/admin/web/origini.com.ro/public_html/webservice/dispatcher.php:87
    0.5188    9753120   3. WebserviceRequestCore->executeEntityPost() /home/admin/web/origini.com.ro/public_html/classes/webservice/WebserviceRequest.php:518
    0.5189    9754440   4. WebserviceRequestCore->saveEntityFromXml() /home/admin/web/origini.com.ro/public_html/classes/webservice/WebserviceRequest.php:1292
    0.5207    9760576   5. OrderCore->addWs() /home/admin/web/origini.com.ro/public_html/classes/webservice/WebserviceRequest.php:1478
    0.5616   11263824   6. PaymentModuleCore->validateOrder() /home/admin/web/origini.com.ro/public_html/classes/order/Order.php:1572
    1.6521   19231400   7. OrderDetailCore->createList() /home/admin/web/origini.com.ro/public_html/classes/PaymentModule.php:362
    1.6525   19233400   8. OrderDetailCore->create() /home/admin/web/origini.com.ro/public_html/classes/order/OrderDetail.php:678
    1.7633   20008400   9. ObjectModelCore->save() /home/admin/web/origini.com.ro/public_html/classes/order/OrderDetail.php:653
    1.7633   20008592  10. OrderDetailCore->add() /home/admin/web/origini.com.ro/public_html/classes/ObjectModel.php:445
    1.7777   20027048  11. ObjectModelCore->add() /home/admin/web/origini.com.ro/public_html/classes/order/OrderDetail.php:802
    1.7779   20027248  12. ObjectModelCore->getFields() /home/admin/web/origini.com.ro/public_html/classes/ObjectModel.php:487
    1.7779   20027376  13. ObjectModelCore->validateFields() /home/admin/web/origini.com.ro/public_html/classes/ObjectModel.php:246

 

.... i'm losing my mind - why would it be empty now ?

 

Thanks,

R.

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...