#MYoussef-Discount
1 messages · Page 1 of 1 (latest)
i applied a coupon on subscription
and when check stripe dashboard
i found the discount removed
and when check events
i found this event called "customer.discount.deleted"
although i didnot call it from my code
can you help on that ?
Can you share with me the customer ID?
cus_LrqePKL8BHDBOg
Thanks. I saw there are two discount DELETE requests in the log
yes, i created two subscriptions with discount and the discount delete called for the 2 subscriptions
OK, that explains the "customer.discount.deleted" events.
why it is called automatically? and how to fix that ?
This is the expected behaviour. If you read the doc https://stripe.com/docs/api/events/types#event_types-customer.discount.deleted customer.discount.deleted occurs whenever a coupon is removed from a customer.
You made request to remove the discount and that's why the event happened.
thanks, i got you
is there any way to delete all cancelled subscriptions from test mode ?
you can call this API https://stripe.com/docs/api/subscriptions/list to list the subscriptions, and this API https://stripe.com/docs/api/subscriptions/cancel to cancel it.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
also what is the benefits of Publishable key
?
i am using secret key and the integration is working fine
i mean delete the cancelled subscriptions (already cancelled, because i want to make it disappear from dashboard)
There is no API to delete subscriptions.
thanks
what about this question ?
You use publishable key in your frontend integration, so that Stripe knows the request is coming from your account.
so since my integration is at backend, then no need for publish key at my case ?
No need
perfect
sorry for disturb , another question
when i move to live mode, then just i want to use the live secret key and register the webhook in test mode in live mode, is that correct ?
In live mode, you should use both live mode secret key and live mode webhook secret in your integration.
in webhook case, do you mean the code under this comment
// This is your Stripe CLI webhook secret for testing your endpoint locally.
i use this code locally to test webhook and it is working fine, so i should the same one in live mode
is that correct ?
Hi! I'm taking over this thread.
i use this code locally to test webhook and it is working fine, so i should the same one in live mode
is that correct ?
Yes the code should be the same, only the API keys and webhook secret should be different.
when i move to live mode, i found that the webhook secret is the same in testing mode
is that correct ?
Are you using the Stripe CLI for the webhook? We recommend creating a real webhook endpoint when in live mode: https://dashboard.stripe.com/webhooks