#drakonic_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1252728341371551745
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi there
Do you have an event ID or webhook endpoint ID you can share?
After clicking resend api webhook
Does this mean you clicked "resend" somewhere on the Dashboard?
yes
After clicking "resend" it triggered 108 times (fired every few seconds)
Do you have an event ID you can share?
That was one of several event IDs
I see we tried to deliver this event to two different webhook endpoints. One webhook received it, the other returned a 502 response
Not sure I follow. Events are triggered based on an action that occurs on Stripe. Each unique event ID corresponds to a different event
Where do you see that this event was "triggered 108 times"?
the event was designed to create a subscription within stripe, and 108 subscriptions were made
evt_3PT8u6Iqm66uISY237Qvniuk
evt_3PT8u0Iqm66uISY21aY2rqkl
evt_3PT8txIqm66uISY22suvTuEW
^that's 3 more of the 108
We only clicked the "resend" button one time - and it triggered 108 events (until we disabled the endpoint)
Is this happening because the other webhook listening on the same event is failing?
So it's auto-retrying both endpoints listening to the same payment_intent.succeeded event?
Clicking "Resend" did not trigger the creation of these events
These events were created due to some Node code that made calls to /v1/subscriptions
All three requests were made within a few seconds of each other
The node code was triggered via the payment_intent.succeeded webhook event
No, that's not how this works
?
We deployed an API that creates stripe connect customer subscriptions using node.js code
that api is set to be triggered via the payment_intent.succeeded event
where are we misunderstanding?
I think you have this backwards. Yes, there's some Node code that calls the Stripe API to create Subscriptions. When you're creating a Subscription for this specific customer, we automatically attempt to charge the customer. Since the customer has a saved PaymentMethod (as a value for invoice_settings.default_payment_method), the first invoice is paid. This is what triggers the payment_intent.succeeded event.
Does that make sense?
What we want to do is to trigger the creation of a new subscription WITHOUT billing the card immediately - is that possible?
the payment_intent.succeeded event should remit payment for the pro-rated first month of service
Every month thereafter is billed monthy (using a separte product_id setup for recurring subscription billing)
We want to have the FIRST subscribed charge be the 1st day of the following month
Is this possible using subscriptions?
Or should we switch to creating invoices more manually on our server-side API code?
'more manually' = WITHOUT using Stripe subscription feature (and instead running a CRON job on our backend to generate invoice on the 1st of the month)
I'm not sure I follow this: Every month thereafter is billed monthy (using a separte product_id setup for recurring subscription billing)
What are you trying to test exactly?
This is what we're looking to do:
-
Charge $4.60/day for every day remaining the month buyer signs up
-
On the 1st day of 2nd month, we want to charge $140 per month
-
Every subsequent month, we want to charge $140 per month until buyer explictly cancels
We were trying to test creation of subscriptions using node.js
So, for example, from now until June 30, charge $4.60/day, then on July 1, charge $140 per month?
The node.js endpoint that creates stripe subscriptions is triggered using the 'payment_intent.succeeded' Stripe event
exactly
what is the best way to structure that?
This is probably where you want to start: https://docs.stripe.com/billing/subscriptions/billing-cycle#use-billing-cycle-anchor
You'd create a Subscription now for the monthly price, where billing_cycle_anchor is the day when you want the first full billing cycle to start, and you should pass proration_behavior: create_prorations. The first invoice will be the for the amount between now and the billing cycle anchor date. You should also pass payment_behavior: default_incomplete so we don't immediately try to charge the customer for the first invoice.
I recommend starting there and playing with that first