#crawl_webhooks
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/1260271985259315343
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
hello! you use the same event except the "subscription upgrade/downgrade" case will have previous_attributes hash showing you the old price that was changed and the Event body's items.data[0].price field will have the new price
there's also the Subscription's Invoice's billing_reason field which you can look at to tell what it was for: https://docs.stripe.com/api/invoices/object#invoice_object-billing_reason
okok got it
also is it normal if a checkout session is being created with a trial days, even though we specify no days ?
trial would only be there if you've set up something about a trial, either on the Checkout Session creation or coming from the Price/Plan
seems like we have customer that exploit this,
they cancel there trial before the end and purchase a trial back
we handle this by creating the checkout sessions dynamically based on that
but it's still there
not expected to have a trial if you don't want it to ๐
but it's still there
share the Checkout Session ID and I can tell you why it is happening
My assumption is that we make it empty in the code, but on the plan/price dashboard we have something up
but on the plan/price dashboard we have something up
yep could be
prod_P4iOaJOXU25PJt
price_1OGYy5LM4GHVXwuAzcovj0eZ
can you share the Checkout Session ID too? can have a look
this customer is exploiting
cus_OaHG4bZMKiHKi7
basically start a trial on a card with insuficient fund, that fail once we try to fallback cancel on them
do you have the CheckoutSession ID? Looks like cs_123
but payment will succeed, because he's having a trial he's not suppose to have in the first place
just a sec
cs_live_a12KuDFHCmk0gIuZlfAyOS3Gqt5JArxKfPkSFWqj9L4Ks2fRg1hvgxlTm6
first one session was this one
cs_live_a1Q4Tsu2OzDGlRgOQ3CvNd8yyv7XngCJy9Q7zJVtM9sRZrTgYRdCSbMFhG
basically the same customer
to start, this is the Price creation from your Dashboard, it has trial_period_days: 0 so don't see a trial specified on the Price: https://dashboard.stripe.com/logs/req_0BRei1A2btMF7Q
looking at your Checkout creation requests for those two
yeah
in both those Checkout Session creation requests, see the subscription_data hash, your code is passing trial_period_days no?
even though we specify no days ?
so that part seems incorrect to me based on what your code is passing to Stripe
checking out our prod logs
yep you can open those requests in Stripe Dashboard, that is what your code passes to Stripe
we have
user.paidUser:"false"
user.hadTrial:"true"
....
so we know he already had a trial before creating the checkout session
oh wait
i think i got it
seems like he's doing a edge case tricks, to bypass our checks ahahah
just need to confirm, but if it's the case, then he's really smart
yeah you'd need to check if they have/had a trial in the past say within the last n months so they don't exploit it this way
we do have this, but we forgot about an case
checking the month seems to solve this issue
thanks for the help on those 2, i appreciate that
will go test the solution and come back
glad to collaborate! ๐ค