Example #1
0
                'DetailLevel': 'ReturnAll',
                'OrderRole': self.opts.OrderRole,
                'OrderStatus': self.opts.OrderStatus,
                'Pagination': {
                    'EntriesPerPage': 25,
                    'PageNumber': 1,
                },
                'ModTimeFrom': from_time.strftime('%Y-%m-%dT%H:%M:%S.000Z'),
                'ModTimeTo': to_time.strftime('%Y-%m-%dT%H:%M:%S.000Z'),
            }, None)

            for resp in ebay_api.pages():

                if resp.reply.OrderArray:

                    for order in resp.reply.OrderArray.Order:
                        if self.storage:
                            self.storage.set(order)
                        else:
                            log.debug("storage object not defined")
                else:
                    log.debug("no orders to process")


if __name__ == '__main__':
    (opts, args) = parse_args(
        "usage: python -m ebaysdk.poller.orders [options]")

    poller = Poller(opts, Storage())
    poller.run()
Example #2
0
# -*- coding: utf-8 -*-
'''
© 2012-2013 eBay Software Foundation
Authored by: Tim Keefer
Licensed under CDDL 1.0
'''

from ebaysdk.poller.orders import Poller
from ebaysdk.poller import parse_args


class CustomStorage(object):
    def set(self, order):
        try:
            print(order.OrderID)
            print(order.OrderStatus)
            print(order.SellerEmail)

            for txn in order.TransactionArray.Transaction:
                print("%s: %s" % (txn.TransactionID, txn.Item.Title))

        except Exception as e:
            pass
            #from IPython import embed; embed()

if __name__ == '__main__':
    (opts, args) = parse_args("usage: python -m samples.poller [options]")

    poller = Poller(opts, CustomStorage())
    poller.run()
Example #3
0
                    ]

                    if order.TransactionArray.Transaction.get('Variation', None):
                        data.append(("SKU", order.TransactionArray.Transaction.Variation.SKU)),

                    data.extend([
                        ("Shipped Time", order.ShippedTime),
                        ("Shipping Service", order.ShippingServiceSelected)
                    ])
            
                    if order.ShippingDetails.get('ShipmentTrackingDetails', None):
                        data.extend([
                            ("Min Shipping Days", order.ShippingDetails.ShippingServiceOptions.ShippingTimeMin),
                            ("Max Shipping Days", order.ShippingDetails.ShippingServiceOptions.ShippingTimeMax),
                            ("Tracking", order.ShippingDetails.ShipmentTrackingDetails.ShipmentTrackingNumber),
                            ("Carrier", order.ShippingDetails.ShipmentTrackingDetails.ShippingCarrierUsed),
                            ("Cost", (order.ShippingDetails.ShippingServiceOptions.ShippingServiceCost._currencyID, order.ShippingDetails.ShippingServiceOptions.ShippingServiceCost.value))
                        ])

                    values_array = map((lambda x: "%s=%s" % (x[0], x[1])), data)
                    log.debug(", ".join(values_array))

                    # execute SQL here

            else:
                log.debug("no orders to process")


if __name__ == '__main__':
    (opts, args) = parse_args("usage: python -u -m ebaysdk.poller.orders [options]")
    main(opts)
Example #4
0
'''
Copyright 2012-2019 eBay Inc.
Authored by: Tim Keefer
Licensed under CDDL 1.0
'''

from ebaysdk.poller.orders import Poller
from ebaysdk.poller import parse_args


class CustomStorage(object):
    def set(self, order):
        try:
            print(order.OrderID)
            print(order.OrderStatus)
            print(order.SellerEmail)

            for txn in order.TransactionArray.Transaction:
                print("%s: %s" % (txn.TransactionID, txn.Item.Title))

        except Exception as e:
            pass
            #from IPython import embed; embed()


if __name__ == '__main__':
    (opts, args) = parse_args("usage: python -m samples.poller [options]")

    poller = Poller(opts, CustomStorage())
    poller.run()