From 2a367871414a06da318565a0d89979cf76d7aa62 Mon Sep 17 00:00:00 2001 From: Molodkovets Bogdan Date: Wed, 4 Mar 2020 01:43:01 +0300 Subject: [PATCH] fix xml generation for order creation --- client.go | 3 ++- order2.go | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client.go b/client.go index ba98550..ec2dc24 100644 --- a/client.go +++ b/client.go @@ -170,7 +170,8 @@ func (cl *Client) CreateOrder(req *CreateOrderRequest) ([]*OrderStatus, error) { }{ operationCreateOrder{ &createOrder{ - req, + Namespace: orderNamespace, + Orders: req, }, }, } diff --git a/order2.go b/order2.go index 6e023da..ff6d3af 100644 --- a/order2.go +++ b/order2.go @@ -103,14 +103,16 @@ type operationCreateOrder struct { } type createOrder struct { - Orders *CreateOrderRequest `xml:"orders,omitempty"` + Namespace string `xml:"xmlns,attr"` + Orders *CreateOrderRequest `xml:"orders,omitempty"` } //CreateOrderRequest CreateOrder request body type CreateOrderRequest struct { - Auth *Auth `xml:"auth,omitempty"` - Header *Header `xml:"header,omitempty"` - Order []*Order `xml:"order,omitempty"` + Namespace string `xml:"xmlns,attr"` + Auth *Auth `xml:"auth,omitempty"` + Header *Header `xml:"header,omitempty"` + Order []*Order `xml:"order,omitempty"` } //Order to creation