#xu_code

1 messages ¡ Page 1 of 1 (latest)

glad pawnBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1263128673888768000

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

woeful rock
#

sorry, the complete code was not included

#

backdated_start_date = datetime.now().timestamp() - timedelta(days=180).total_seconds()
start_date = datetime.now().timestamp() + timedelta(hours=24).total_seconds()
billing_cycle_anchor = start_date + timedelta(days=3).total_seconds()
price = "plan_Q1zUMl3X24Dl0T"
stripe.SubscriptionSchedule.create(
customer="cus_QUWpjUEcsdfiCa",
start_date=int(backdated_start_date),
end_behavior="release",
phases=[
{
"items": [{"price": price, "quantity": 0, }],
"end_date": int(start_date)
},
{
"items": [{"price": price, "quantity": 1, }],
"metadata": {"CO_order_id": "111111", "migrated": "vimondhmm"},
"proration_behavior": "none",
"default_tax_rates": ["txr_1H2GP0KzUvCzCIV4a2Fl0Xcy"],
"end_date": int(billing_cycle_anchor),
"default_payment_method": "pm_1PdXmtKzUvCzCIV4DexGXE9A"
},
{
"items": [{"price": price, "quantity": 1, }],
"proration_behavior": "always_invoice",
"default_tax_rates": ["txr_1H2GP0KzUvCzCIV4a2Fl0Xcy"],
"billing_cycle_anchor": "phase_start",
},
],
metadata={"CO_order_id": "999999", "migrated": "vimond"},
default_settings={
"automatic_tax": {"enabled": False},
"collection_method": "charge_automatically",
}
)

fair salmon
#

Hello
One of the things I've found work for me in the past is, taking out all phases and try to add them back one at a time.

woeful rock
#

Ok, I'll try it out

#

You are talking about taking them out of the code right? to see what phase is causing the error?

fair salmon
#

Yup

#

I'm looking too but above might be faster

woeful rock
#

Seems to be the first one

#

Commented out the 2 last phases, but error still persists

fair salmon
#

Interesting.. I tried to create a schedule with the same timestamps and it works

#

Ah are you using test clocks?

#

If so, what's the current time at?

#

I see a test clock associated with your creation request and clock time seems to be 2024-08-25 13:27:00 so the error is correct

woeful rock
#

Ahhh okay

#

of course

#

I didn't catch that

#

thanks