#ludvig-checkout-event

1 messages · Page 1 of 1 (latest)

oblique remnant
#

@muted merlin that's because the CLI will trigger a session for one-time payments today. It's just to simulate the event and it does the most common use-case

#

you see how it passes payment_intent_data there for one-time payments? You could tweak the whole params hash to make it for a subscription

#

My advice though is to just test this manually in your app and not bother with that specific flow with the CLI

muted merlin
#

Yeah the problem is that real webhooks (even in test mode) of course requires a public accessible ip/domain

#

But I guess thats what I have to live with

#

When I already have you here. Can I ask you when invoice.paid triggers?

#

Because I’m going to use Subscriptions for my users and when they don’t pay the subscription I need to kick them/suspend them

oblique remnant
#

it triggers when an invoice is paid, but you want checkout.session.completed for the first payment

#

and invoice.paid for future cycles yes

muted merlin
#

Ok thank you.

checkout.session.completed = Subscription started

invoice.paid = Subscription renewed

and which webhook is it if the user doesn’t pay the invoice the subscription automatically creats?

#

Because If that is possible then I don’t have to store the subscription end date in my db

oblique remnant
#

there wouldn't be a checkout.session.completed event in that case, the Session just wouldn't work

muted merlin
#

Wdym?

#

and which webhook is it if the user doesn’t pay the invoice the subscription automatically creats? are you refering to this sentence?

oblique remnant
#

yes

muted merlin
#

I mean if the customer doesn't pay their future invoices.

#

The first invoice (which starts the subscription) is already paid if the checkout.session.completed event is triggered as I've understood it

oblique remnant
last gulch
muted merlin
#

Based on what I can find on the pages you sent

last gulch
#

After you create a test checkout session in subscription mode and complete the checkout flow?

#

It really should have a subscription in that case

#

(I'm not talking about using the triggers, i mean creating a session via the API and redirecting yourself, entering a test card etc)

muted merlin
#

Right now I’m using stripe listen —forward-to localhost and stripe trigger checkout.session.completed to simulate that event.

#

How do you mean I can do instead? Sorry I don’t understand

last gulch
#

right, don't use the CLI and trigger

#

I mean, actually create a checkout session with your code or postman, and go through the checkout flow

muted merlin
#

I’m using Stripe Hosted Checkouts

#

So I have no idea what you mean

last gulch
#

How do you send customers through checkout?

muted merlin
#

I have a button on my website that redirects to your stripe buy link

#

and then listening on webhooks from that

last gulch
#

Using Payment Links?

muted merlin
#

Or maybe not. Wait.

last gulch
#

but i mean for you to go through the checkout flow, pay/signup using the 4242 credit card (or any other success test card) and finish checkout

#

you will then get an event in test most which will be sent to your CLI listen and forwarded to your server

muted merlin
#

So I should just go through the checkout process (but with the 4242 card) and everything. And then the event should appear in my stripe listen terminal?

last gulch
#

yep, exactly!

last gulch
#

Did that work for you? I need to step away shortly, but can hand off to a colleague if you need more help