• Pricing
  • Blog
  • Docs
  • Payments
  • Download Now
  • Pricing
  • Blog
  • Download Now

create_stripe_customer

October 30, 2022

A supabase function that creates a stripe customer and returns the stripe_customer_id. Steps:

  1. Get the supabase_user_id from the request
  2. Check if stripe_customer_id already exists in the table. If it does, skip the following steps
  3. Create stripe customer and store the stripe_customer_id
  4. Update the table with the stripe_customer_id and return it

Example Code Video Walkthrough


Backlinks

update_subscription_tierA supabase function that is triggered by a database webhook when the stripe_customer_id is created or updated. 1. Check if it's a valid stripe_customer_id by querying subscriptions 1. If subscription is "active" or "trialing", then retrieve the subscription_tier from the metadata of the subscription plan. 1. Otherwise, set the subscription_tier to "free" 1. Update the row of the stripe_customer_id with the new subscription_tier let subscription_tier = 'free'; // Step 1 const sub = await striHow I Migrated 1000+ Users from Firebase to SupabaseWhen beginning my journey as a Flutter developer, I thought Firebase would be the best backend solution for Flutter. Given that both are made by Google, I thought this would be the backend that would be the most stable and flexible. I was wrong. The lack of full native Dart support, slow build times, sketchy workarounds, and no desktop support led me searching for another solution. After many hours of research, I was faced with the choice between two frameworks: Appwrite and Supabase. Both were
Terms · Privacy Policy · FAQ
Subscribe

Get the latest news and articles to your inbox every month.

© Fleeting Notes. All rights reserved.