#Syafiq Idrus
1 messages · Page 1 of 1 (latest)
👋 happy to help
if there was a way to trigger a specific event from a specific stripe testing account?
I'm not sure I follow, would you mind elaborating?
I would like the event "invoice.payment_succeed" to be triggered from a specific account. Right now, every time i run the command
stripe trigger invoice.payment_succeeded
It creates a new account instead
By account, i mean a specific customer
do you mean a customer?
ok that makes sense now
first I would like to specify that invoice.paid is a better event to listen to than invoice.payment_succeeded in general
Can you explain the difference between the two?
invoice.paid
Occurs whenever an invoice payment attempt succeeds or an invoice is marked as paid out-of-band.
invoice.payment_succeeded
Occurs whenever an invoice payment attempt succeeds.
Noted
But the question still remains, is there any way to trigger this event from a specific customer?
yes sure
with the already created fixture that's not really possible
but you can get inspired from that fixture to create a custom fixture
you can use this fixture https://github.com/stripe/stripe-cli/blob/master/pkg/fixtures/triggers/invoice.paid.json as the basis
you would remove the customer creation
I see it now
So these are essentially custom steps that i can create using whatever params i want
yes exactly
Ill have a look at it now and play around with it. If i have any questions, should i respond to this thread or create a new one?
yes please come back here
I have another question
sure
If i am trying to track when a subscription is renewed, would checking invoice.paid be the best way to go about it?
Is there a way that i can track days in between payment periods?
what do you mean?
Say the billing cycle was 1 year, is there a way that i can create a webhook that is triggered each month leading up to the payment
From my understanding, the active subscriptions would only be triggered on the day of the payment
if it's a yearly billing cycle why do you need a monthly webhook?
you will have an invoice.upcoming event ahead of the renewal
We have a product (which is a service) where a user pays for a yearly subscription. This service allows the user a certain number of credits each month, that would then needs to be renewed each month
if you really need to do that in Stripe you would have to create another subscription with a monthly price of 0$
but this is not ideal to say the least
What would be the best way to handle this flow
Currently we already have a monthly price, which is working as intended, and this webhook integration would help reset the tokens each month.
The only issue now is the yearly subscription, whereby the tokens should still be reset each month, instead of each year
it's not really possible to do that in Stripe Billing, what you can do instead is create the monthly recurring event on your side and only handling billing on Stripe's side
I see, and i guess this would only be triggered if the billing cycle is set to yearly. else if its a monthly billing cycle, i can still use the webhook
yes
Noted. Thanks for the info. Ill get back to looking at the fixtures for now
someone else might be here to pick up the thread I need to head out now