Woocommerce REST API - 无效参数:HttpClient.php中的属性[rest_invalid_param]

时间:2018-06-08 13:25:15

标签: php wordpress woocommerce wordpress-rest-api

我收到此错误,因为我已将wordpress版本更新到4.9.6和woocommerce版本3.4.2和api版本2

在之前的版本中它运行良好

错误如下

致命错误:未捕获异常'Automattic \ WooCommerce \ HttpClient \ HttpClientException',并在D:\ wamp \ www \ realbakers \ app \ src \ WooCommerce \ HttpClient中显示消息'错误:无效参数:line_items [rest_invalid_param]' \ HttpClient.php

数组如下所示。

Array
(
    [payment_method] => cod
    [payment_method_title] => Store
    [set_paid] => 1
    [customer_note] => 
    [billing] => Array
        (
            [first_name] => Test 
            [last_name] => user
            [address_1] => 
            [address_2] => 
            [email] => test@test.com
            [city] => 
            [state] => MJ
            [postcode] => 
            [country] => LK
            [phone] => 9999999999
        )

    [line_items] => Array
        (
            [0] => Array
                (
                    [product_id] => 979
                    [variation_id] => 1822
                    [quantity] => 1
                    [tax_class] => gst_18
                    [total] => 254.23728813559
                    [meta_data] => Array
                        (
                            [0] => Array
                                (
                                    [key] => Greetings
                                    [value] => Test 
                                )

                            [1] => Array
                                (
                                    [key] => Photo
                                    [value] => 
                                )

                            [2] => Array
                                (
                                    [key] => pa_shape
                                    [value] => Heart
                                )

                        )

                )

        )

    [meta_data] => Array
        (
            [0] => Array
                (
                    [key] => source
                    [value] => store 1
                )

            [1] => Array
                (
                    [key] => store_name
                    [value] => 
                )

            [2] => Array
                (
                    [key] => userId
                    [value] => 
                )

            [3] => Array
                (
                    [key] => userEmail
                    [value] => 
                )

            [4] => Array
                (
                    [key] => dob
                    [value] => 05/Apr/2003
                )

            [5] => Array
                (
                    [key] => doa
                    [value] => 
                )

            [6] => Array
                (
                    [key] => byconsolewooodt_delivery_date
                    [value] => 05/Apr/2018
                )

            [7] => Array
                (
                    [key] => byconsolewooodt_delivery_time
                    [value] => 06:00 pm
                )

            [8] => Array
                (
                    [key] => byconsolewooodt_delivery_type
                    [value] => take_away
                )

            [9] => Array
                (
                    [key] => received_amount
                    [value] => 100.0
                )

            [10] => Array
                (
                    [key] => pending_amount
                    [value] => 200.0
                )

            [11] => Array
                (
                    [key] => delivery_status
                    [value] => later
                )

            [12] => Array
                (
                    [key] => order_receiver_name
                    [value] => operator 1
                )

        )

)   

0 个答案:

没有答案