#MYoussef-Discount

1 messages · Page 1 of 1 (latest)

maiden storm
#

Hi there, how can I help?

static linden
#

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 ?

maiden storm
#

Can you share with me the customer ID?

static linden
#

cus_LrqePKL8BHDBOg

maiden storm
static linden
#

yes, i created two subscriptions with discount and the discount delete called for the 2 subscriptions

maiden storm
#

OK, that explains the "customer.discount.deleted" events.

static linden
#

why it is called automatically? and how to fix that ?

maiden storm
#

You made request to remove the discount and that's why the event happened.

static linden
#

thanks, i got you

#

is there any way to delete all cancelled subscriptions from test mode ?

maiden storm
#

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.

static linden
#

also what is the benefits of Publishable key
?

i am using secret key and the integration is working fine

static linden
maiden storm
#

There is no API to delete subscriptions.

static linden
maiden storm
#

You use publishable key in your frontend integration, so that Stripe knows the request is coming from your account.

static linden
#

so since my integration is at backend, then no need for publish key at my case ?

maiden storm
#

No need

static linden
#

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 ?

maiden storm
#

In live mode, you should use both live mode secret key and live mode webhook secret in your integration.

static linden
#

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 ?

terse adder
#

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.

static linden
#

when i move to live mode, i found that the webhook secret is the same in testing mode

#

is that correct ?

terse adder