Recurly Module not accepting parameters

75 Views Asked by At

Hi I'm attempting to use the Recurly Python library. I have some simple code to return Recurly Transactions:

from datetime import datetime
import recurly
from recurly import Transaction

recurly.SUBDOMAIN = '<company_name>'
recurly.API_KEY = '<api key>'

recurly.DEFAULT_CURRENCY = 'USD'

idx = 0
for transaction in Transaction.all(kwargs={
    "per_page": 200,
    "sort": "updated_at",
    "order": "asc",
    "begin_time": datetime(2019, 1, 2),
    "end_time": datetime(2019, 1, 4)
}):
    # print('Transaction: %s' % transaction)
    idx += 1
    print(transaction.uuid, transaction.updated_at, idx)
    if idx >= 100:
        break

However, the module is ignoring my parameters and returning the most recent transactions, sorted descending by created_at date. I'm somewhat at a loss, and the documentation doesn't provide much help.

Any ideas? This is a link to their library https://github.com/recurly/recurly-client-python

1

There are 1 best solutions below

0
user12375209 On

It looks like maybe your syntax for kwargs is not correct. Try this:

Transaction.all(
    per_page=200,
    sort="updated_at",
    order="asc",
    begin_time=datetime(2019, 1, 2),
    end_time=datetime(2019, 1, 4)
}