#Wik

1 messages · Page 1 of 1 (latest)

reef flareBOT
real tartan
#

👋 happy to help

#

what changes have you made?

tough vector
#

I'm sorry, I don't remember them all. Some to sending invoice

#

I can see that other events are fired and delivered to me correctly (e.g. subscription creation) but invoice.created simply stopped working

real tartan
#

would you mind sharing your account ID?

#

maybe you changed the webhook endpoint's events

tough vector
#

acct_1F0L3fJA8pMPzFjl

real tartan
#

you're not listening to the invoice.created events

tough vector
#

The problem is invoice.upcoming, not invoice.created event

real tartan
#

I can see that other events are fired and delivered to me correctly (e.g. subscription creation) but invoice.created simply stopped working
...

tough vector
#

I want to handle invoice.upcoming event in my code.

#

Apologies for the confusion, it's invoice.upcoming that I am. interested in

#

What is more, I might not be listening to it, but if I create a monthly subscription in test clock and then forward the time, shouldn't the event fire and be visible in the list of events?

real tartan
#

it should but it depends on your subscription interval and the settings in your dashboard

tough vector
#

which setting?

real tartan
#

under Upcoming renewal events

tough vector
#

I had a monthly sub and forwarded the time a month and a bit. I have Upcoming renewal events set to 7 days

real tartan
#

you should forward only by 3 weeks

#

in test mode the invoice.upcoming doesn't get triggered if the invoice is to be created

tough vector
#

checking

#

unless - will invoice.upcoming fire if the previous invoice is still open?

real tartan
#

yes that might be the issue

#

would you mind starting over

tough vector
#

sure, let me do it

real tartan
#

create a new test clock, new customer, new subscription

tough vector
#

I need to test a situation where a user can pay manually. How I can simulate this in test env? "email invoice to your customer to pay manually"

real tartan
#

try advancing 1 hour at a time

tough vector
#

ok

#

nothing

reef flareBOT
tough vector
#

it works if I choose payment by cc

#

but I need to test emailing invoice to your customer to pay manually

#

how can I do it?

#

I tried marking the invoice paid or paying it via cc and it didn't work

late fog
#

to be clear we don't send any emails to the customer in test mode

#

not 100% understanding the specific issue you're facing, could you elaborate?

tough vector
#

email won't be sent, but I'll see invoice.sent event

#

right?

late fog
#

not sure but I think so

tough vector
#

What I'm trying to do: I want to handle invoice.upcoming in my code, so when I see it, we use Stripe::Invoice.send_invoice. I know the email won't be sent in test mode, but I should see invoice.sent in the events list.

However, Stripe::Invoice.send_invoice on;y works for subscriptions with manual collection methods. So I need to create a subscription with a manual collection method (I think email invoice to customer to pay manually is the only option?). However, when I do it and forward the time, invoice.upcoming does not fire for such a subscription.

late fog
#

it doesn't make sense to me what you're doing. You can't send the upcoming invoice, the invoice doesn't exist yet

tough vector
#

oh, so invoice.upcoming fires before the invoice is created. Right, I misunderstood the docs. Is there a way to send an invoice to an annual customer 30 days before it's due?

#

I know in settings we can set an invoice to be sent 10 days before it's due but we want to do it 30 days before it's to be paid.

late fog
#

the only way to really send it early is to reset the billing_cycle_anchor to "now"

#

but yeah for the send_invoice method you can only send those "please pay the invoice" emails in the intervals we have in the settings

tough vector
#

if I wanted to send it 10 days in advance, then I'd be able to use the send_invoice method?

#

is there a way to generate an invoice for a subscription earlier?

late fog