#.suryamani

1 messages ยท Page 1 of 1 (latest)

scarlet flameBOT
sullen cobalt
#

๐Ÿ‘‹ What is the issue you're facing?

wary zodiac
#

I have test it in local by using endpoint

#

When i create new subscription, So many events are generated in this stripeEventType. I have sent email by using if condition based on the event generated based on user activity when do subscription. The issue i have faced is many events generates when do subscription it goes in if condition but skip to go inside the condition because of many events, How will sort it out?

#

Is any way to restrict unwanted events not to generate while subscribing

sullen cobalt
wary zodiac
#

Not only for test in local i need to restrict while using in live

#

The code i have is I'm using for listen webhook events While I'm usimg my live application to test this When i subscribe i have not received the mail but i got mail when i update plan or cancel plan

sullen cobalt
#

Yes! When creating the live Webhook endpoint in Dashboard, it also allows limiting to the events you would like to listen to

wary zodiac
#

Can you explain breifly?

sullen cobalt
wary zodiac
#

If i select particular events here then only selected events are generates while subscribing, I'm i right?

sullen cobalt
wary zodiac
#

I need to generate only selected event how will i do that?

sullen cobalt
#

Stripe will create all the events, but Webhook configuration can only listen to those that are required. It can be done by selecting those event types in the screenshot you shared

#

Only those events you subscribed will be sent to your Webhook endpoints

wary zodiac
#

here i will select only 7 events but i got other events also

sullen cobalt
#

Dashboard webhook and local webhook are two independent endpoints

#

You'd need to turn off forwarding events in local CLI

wary zodiac
#

How will i configure for local webhook like dashboard webhook

sullen cobalt
#

This is for local forwarding

wary zodiac
#

stripe listen --events=payment_intent.succeeded if i give what event i need like this only that events are generate ,I'm i right?

sullen cobalt
#

This means that only the specified events will be sent to this webhook

wary zodiac
#

ok when should i give listen --event before or after this line stripe listen --forward-to http://localhost:4242?

sullen cobalt
#

it should be in the same line

wary zodiac
#

ok

#

stripe listen --forward-to https://localhost:7150/api/Stripe/WebhookEvent --event customer.subscription.created customer.subscription.deleted customer.subscription.pending_update_expired customer.subscription.updated invoice.paidinvoice.payment_failed invoice.payment_succeeded

#

is this is correct?

sullen cobalt
#

It looks right to me. Can you try?

wary zodiac
#

stripe listen does not take any positional arguments. See stripe listen --help for supported flags and usage

#

it shows like this

sullen cobalt
#

you miss one s behind event. It should be --events

wary zodiac
#

yes i add it after it shows like this

scarlet flameBOT
nova prawn
#

Hi! I'm taking over this thread.

#

Can you summarize your latest question?

wary zodiac
#

stripe listen --forward-to https://localhost:7150/api/Stripe/WebhookEvent --events customer.subscription.created customer.subscription.deleted customer.subscription.pending_update_expired customer.subscription.updated invoice.paidinvoice.payment_failed invoice.payment_succeeded

#

this is corect or not?

nova prawn
#

no there are two mistakes:

  • It's not --event but --events (missing the s)
  • The events need to be separated by commas , and not spaces
#

The correct version:

stripe listen --forward-to https://localhost:7150/api/Stripe/WebhookEvent --events customer.subscription.created,customer.subscription.deleted,customer.subscription.pending_update_expired,customer.subscription.updated,invoice.paidinvoice.payment_failed,invoice.payment_succeeded