FIX connector_walmart Order Acknowledge in API

This commit is contained in:
Jared Kipe
2019-08-22 14:46:16 -07:00
parent a84903870a
commit 6662e3496a
2 changed files with 5 additions and 4 deletions

View File

@@ -389,12 +389,12 @@ class Orders(Resource):
def acknowledge(self, id): def acknowledge(self, id):
url = self.url + '/%s/acknowledge' % id url = self.url + '/%s/acknowledge' % id
return self.send_request(method='POST', url=url) return self.connection.send_request(method='POST', url=url)
def cancel(self, id, lines): def cancel(self, id, lines):
url = self.url + '/%s/cancel' % id url = self.url + '/%s/cancel' % id
return self.send_request( return self.connection.send_request(
method='POST', url=url, data=self.get_cancel_payload(lines)) method='POST', url=url, body=self.get_cancel_payload(lines))
def get_cancel_payload(self, lines): def get_cancel_payload(self, lines):
element = ElementMaker( element = ElementMaker(

View File

@@ -172,7 +172,8 @@ class SaleOrderAdapter(Component):
if not 'list' in orders_response: if not 'list' in orders_response:
return [] return []
next = orders_response['list']['meta']['nextCursor'] # 'meta' may not be there (though it is in the example on the API docs even when nextCursor is none)
next = orders_response.get('list', {}).get('meta', {}).get('nextCursor')
if next: if next:
self.env[self._apply_on].with_delay().import_batch( self.env[self._apply_on].with_delay().import_batch(
self.backend_record, self.backend_record,