#bennn
1 messages · Page 1 of 1 (latest)
Hi there, if you don't want to use webhook, you can also retrieve the checkout session https://stripe.com/docs/api/checkout/sessions/retrieve#retrieve_checkout_session and check its status.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okay thanks
and how would i make sure they pay the next payment?
Next payment? do you mean the upcoming invoice of the subscription?
uhh
im confused
i thought we are talking about checkouts not invoices?
Can you tell me more about the scenario of the next payment?
like
its a monthly subscription
so i need to make sure they pay for the next month
im handling cancelling subs
but if their card is declined or smth i need to remove them
OK, so it's about invoices of the subscription, am I correct?
wait
So the initial subscription is a checkout session?
And future payments are thru invoices?
Let me walk you through:
- When you customer complete a
subscriptionmode checkout session, Stripe will create a subscription behind the scene. - The subscription generate invoices periodically based on the billing schedule (i.e., weekly, monthly, annually)
- Once an invoice is created, depends on the
collection_method, Stripe will either send an invoice to the customer, or charge them automatically.
oh okay
so the collection method is automatic by default?
oh wait
can I make a subscription that doesn’t charge automatically?
bc that would probably be better than my one time payments
For one time payment you should just use payment mode checkout session instead of subscription mode.
oh okay
is that better than just making invoices?
or no different
idk what I should do
Can you tell me what you want to achieve?
It is an one-time payment or recurring payments (i.e., subscription)
I offer both
Whichever the user prefers
Then you should just use Checkout, either subscription mode and/or payment mode.
okay
and do u mind saying about the other question
how do i make sure they pay
like card didnt get closed or smth
declined *
when they have auto payments
Card declines are very common and there's no way to prevent them from happening. This is the guide (https://stripe.com/docs/declines) that I'd suggest to read through so that you know how to handle declines in your integration.
nah im cool with decliens
i just need to terminate their service
if they dont pay for whatever reason
how would i check that? what am i checking?
By termination I assume you mean subscription cancelation? https://stripe.com/docs/billing/subscriptions/cancel
nah like
if the card gets declined
how would i check for that
not on the first payment
lets say for the first 2 months they pay
but the third month their card is declined
how would i check that and terminate them
https://stripe.com/docs/billing/subscriptions/webhooks#payment-failures you can listen to the webhook event and cancel the subscription if you wish to.
im trying to avoid doing event listening
in case of bot downtime
my idea is run a task every 12-24 hours
to check all payments and subscriptions
I'd strongly suggest using webhook, it's more efficient than polling.