Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Как правильно создать заказ (Order)? #34

Open
zuf opened this issue Apr 12, 2018 · 1 comment
Open

Как правильно создать заказ (Order)? #34

zuf opened this issue Apr 12, 2018 · 1 comment

Comments

@zuf
Copy link

zuf commented Apr 12, 2018

Подскажите, как правильно создать новый заказ через API?

Например, такой заспрос:

    order = InsalesApi::Order.create! payment_title: "Наличным курьеру",
                                      payment_description: "Наличными курьеру",
                                      delivery_description: "Самовывоз (На пункте выдачи)",

                                      client: {
                                          email: "[email protected]",
                                          name: "TEST",
                                          phone: "+79001234567"
                                      },
                                      order_lines_attributes: [{
                                                                   product_id: product_id,
                                                                   quantity: 1
                                                               }]

Возвращает ошибку: NameError (undefined local variable or method `order_lines' for #<InsalesApi::Order:0x00007f0a3537a758>)

Если вместо :order_lines_attributes использовать order_lines, то возникает другая ошибка: NoMethodError (undefined method `order_lines_attributes' for #<InsalesApi::Client:0x00007f0a35659b40>)

@stap780
Copy link

stap780 commented Jul 12, 2023

Вы нашли решение?
Я форкнул себе и закомментировал методы - order_lines_attributes и to_xml(options = {})

и передаю данные как на api.insales.ru написано

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants