#hpanseriya_best-practices

1 messages ¡ Page 1 of 1 (latest)

woven coralBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1290257979848917015

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

jovial dagger
#

Hi, let me help you with this.

main granite
#

we do not want to create a stripe customer if payment failures from subscription. How can we achieve that?

jovial dagger
#

A Customer is needed to create a Subscription, but you can't know if the payment succeeds before then. Why you don't want to create a Customer?

main granite
#

Here is the flow which we are following:

  • Create a Customer in Stripe
  • Create a Stripe Subscription
    • Payment will be deducted once subscription create but that time payment failures, In that case we do not want to show customer in stripe. what to do in this case?
jovial dagger
main granite
#

Is it a best practice?

jovial dagger
#

Normally you don't need to delete Customers, but just leave them. Perhaps the customer will want to use a different Payment Method in the future and you will reuse the Customer object for them.

main granite
#

We want to implement it via webhook then how can we know that payment failed for the customer

jovial dagger
#

But if they choose to try a different Payment Method, will you re-create the Customer object?

woven coralBOT
main granite
#

Yes, we will recreate customer

#

For this webhook: invoice.payment_failed
How can we know that we have to delete the customer if subscription payment fails

jovial dagger
#

we have to delete the customer
You don't have to delete the Customer