#maks.piechota

1 messages ยท Page 1 of 1 (latest)

grave tendonBOT
supple aspen
#

Hi ๐Ÿ‘‹

#

Yes in that case you would receive Subscription related webhooks

#

There are a number of different webhook events associated with Subscriptions so you can remain informed of changes to a customer's subscription

hushed shadow
#

So if I want to fill up my users account with some tokens, every time the subscription fee is charged, then I should look for what? invoice.paid webhook?

supple aspen
#

The invoice.paid webhook event will be fired each time an Invoice is successfully paid. This event will return the Invoice object so you examine it to find the Customer ID as well as the billing_reason, while will help you keep track of manual invoices, new subscriptions, and subscription renewals

hushed shadow
#

ok great

#

I can see the stripe's customer gets created when checkout is successful, but how would I identify which user of my system this webhook corresponds to?

#

I can see I can pass some reference to createCheckoutSession

#

but I will get this info only in checkout.successs webhook

#

can I create the user manually and assign my custom reference id to this object?

supple aspen
#

That depends on how you configure Checkout. You can pass the customer_email parameter and the Customer object that gets created in Stripe will have that email

hushed shadow
#

and then query for it

hushed shadow
#

but still

#

can I assign some custom reference to the stripe customer obj?

supple aspen
#

Not during the Checkout flow. But you can create the Customer before the Checkout Session and then use the Stripe Customer ID when creating the Checkout Session

hushed shadow
#

yes

#

this is the idea

#

but can I query for the stripe customer using my id?

#

not the stripe customerId

supple aspen
hushed shadow
#

ok

#

but if I provide my own email

#

to the checkout session

#

like you have suggested

#

then I will receive this email value

#

in every consecutive webhook

#

that whould be enough

#

ok that was constructive

#

thanks!

#

another question

#

why CLI command

stripe trigger checkout.session.completed

creates some products in my stripe account? And how do I delete them permanently so I don't receive them in the listProducts call

supple aspen
#

This is because a Checkout Session requires a product. The trigger will create all the necessary objects in order to trigger the event

hushed shadow
#

can I configure it to use one of the existing?

supple aspen
hushed shadow
#

ok

#

so how do I remove those products permanently?

supple aspen
hushed shadow
#

only through api?

#

can't do this through dashboard?

supple aspen
#

Well, wait you can only delete a Product if it has no price associated with it

#

But I think the fixture creates a Price for the Product

#

These are all created in your account in test mode.

hushed shadow
#

I know

#

but they distract me when testing

hushed shadow
#

or api only?

supple aspen
#

You cannot delete the Price

hushed shadow
#

so

#

what can I do

#

will it persist forever?

supple aspen
#

You can clear all test data in one shot but that is the only option

hushed shadow
#

ok

#

how do I do that?

supple aspen
hushed shadow
#

ok I see

#

ok

#

can you explain me one more thing

#

the difference between invoice.paid and invoice.payment_succeeded

supple aspen
#

Invoice paid includes payments that did not go through Stripe. Payment succeeded is for payments processed through Stripe

hushed shadow
#

like what?

#

what are payments that dod not go thorugh stripe?

supple aspen
#

Any invoice you mark as paid_out_of_band

hushed shadow
#

ok I see

#

ok thanks

#

the best support I ever met ๐Ÿ™‚