Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from __future__ import absolute_import
import mws
import time
from datetime import datetime, timedelta
from . import config
from . import util
from . import queries
orders_api = mws.Orders(
access_key=config.access_key,
secret_key=config.secret_key,
account_id=config.seller_id,
auth_token=config.mws_auth_token,
region='US' or config.country_code,
)
yesterday = datetime.now() - timedelta(hours=24)
def get_order_id(order):
return order.get('AmazonOrderId').get('value')
def parse_order_safely(order):
if order.parsed.Orders:
from __future__ import absolute_import
import mws
from . import config
from . import util
orders_api = mws.Orders(
access_key=config.access_key,
secret_key=config.secret_key,
account_id=config.seller_id,
region='US' or config.country_code,
)
def get_order_id(order):
return order.get('AmazonOrderId').get('value')
class Orders(object):
def __init__(self, last_updated_after, marketplace_id=None):
self.api = orders_api
self.marketplace_id = marketplace_id or config.marketplace_id
self.last_updated_after = last_updated_after