omise/omise-python

Schedule create raised "on must contain one of these keys: days_of_month, weekday_of_month"

pupubird opened this issue · 2 comments

schedule = omise.Schedule.create(
    every=1,
    period='month',
    on={'days_of_month': 20},
    start_date='2023-11-20',
    end_date='2024-11-19',
    charge={
        "customer": "cust_test_XXXXXXXX",
        "amount": 2000,
        "currency": "myr",
    },
)

Hey, in omise=0.13.0, the above code will raise on must contain one of these keys: days_of_month, weekday_of_month

Hi, can you try the following:

schedule = omise.Schedule.create(
    every=1,
    period='month',
    on={'days_of_month': [20]}, # ← days_of_month must be a list
    start_date='2023-11-20',
    end_date='2024-11-19',
    charge={
        "customer": "cust_test_XXXXXXXX",
        "amount": 2000,
        "currency": "myr",
    },
)