#heyaco_error

1 messages ¡ Page 1 of 1 (latest)

visual drumBOT
#

👋 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/1270128318032773232

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

exotic marten
#

Hi there

#

Your command should look like this:

#

actually, hold on

#

So, taking a step back

hearty wing
#

ok

exotic marten
#

When you create an Invoice, it's not possible to set a custom billing_reason so this isn't possible

#

@hearty wing let me know if this makes sense!

hearty wing
#

i see. how would i test a failed payment for a renewal period of a subscription? currently i listen for invoice.payment_failed events and if the billing_reason == subscription_cycle i remove the access for that user. my code looks right to me, but i'd like to test this edge case. say they don't have sufficient funds or the card expired or god knows what.

exotic marten
#

You can create a Subscription with collection_method: 'charge_automatically' within a Test Clock where the first invoice is paid with a test card number that reuslts in a successful payment. Then, remove the payment method and advance the time to the next billing cycle to see the invoice payment fail

hearty wing
#

cool. thanks. i'll look into test clocks. didn't know about this.

exotic marten
#

Happy to help!