#chimpTerminal
1 messages · Page 1 of 1 (latest)
hello two shoes
im creating a customer at signup on my flask app with this code
why when the user pays for a subscription on the pricing table does stripe create a new customer and not use the existing customers id?
here is some other relevant code:
You don't need to have a Customer ahead of time if you're just going to be using the pricing table.
hmm really
i need to handle webhook events like subscription cancells and pauses so i can removed users from subscription required services
Yup, I'd recommend familiarizing yourself with these docs on just that: https://stripe.com/docs/billing/subscriptions/webhooks
sure ok so now i have stopped my app making a customer. and now i only get a customer id when i create a subscription.
how do i then apply this cus_Neu4LnguxxiINa to my app database to perform subscription restrictions on app services? could you point me out where in the docs is says this?
because i have been trying for the last 40 hours to get this to work.
You would need to listen for the Subscription's webhooks and update the database once a Subscription was created
is this the passage?
Track active subscriptions
Subscriptions require coordination between your site and Stripe-the success or failure of a customer’s recurring payments determines whether they can continue to access to your product or service.
For typical integrations, you store customers’ credentials and a mapped timestamp value that represents the access expiration date for that customer on your site when a customer subscribes. When the customer logs in, you check whether the timestamp is still in the future. If the timestamp is in the future when the customer logs in, the account is active and the customer should still have access to the service.
When the subscription renews, Stripe bills the customer and tries to collect payment by either automatically charging the payment method on file, or emailing the invoice to customers. Stripe notifies your site of the invoice status through webhooks:
A few days prior to renewal, your site receives an invoice.upcoming event at the webhook endpoint. You can listen for this event to add extra invoice items to the upcoming invoice.
Your site receives an invoice.paid event.
Your webhook endpoint finds the customer the payment was made for.
Your webhook endpoint updates the customer’s access expiration date in your database to the appropriate date in the future (plus a day or two for leeway).