Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

billing #422

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

billing #422

wants to merge 7 commits into from

Conversation

rostyslavvnahornyi
Copy link
Collaborator

@rostyslavvnahornyi rostyslavvnahornyi commented May 3, 2024

hello @kfarr , there is first version of billing.
this branch needs to be tested locally only and if everything will be fine, i propose to call with you to set up all permissions, accesses, for stripe, google map api, google console, firebase functions to push branch into 'master'.

if there will be problems - let me know, i fix as soon as possible. And i want to talk about design because there are some disavtanges of billing that i met.

Test card: 4242 4242 4242 4242 |||| 12/34 |||| 567.

Copy link

netlify bot commented May 3, 2024

Deploy Preview for 3dstreet-editor-builds failed.

Name Link
🔨 Latest commit 80645b1
🔍 Latest deploy log https://app.netlify.com/sites/3dstreet-editor-builds/deploys/663cf62f4bb6b00008509cdf

@kfarr
Copy link
Contributor

kfarr commented May 3, 2024

thanks @rostyslavvnahornyi confirming receipt and will begin review

@kfarr
Copy link
Contributor

kfarr commented May 8, 2024

Some notes on first review:

  • Missing or insufficient permissions. --> I'm guessing this relates to isUserPro check and access to orders DB table? (YES, is it possible that we don't need this table and instead use claims?)
  • Create Stripe API session -> https://us-central1-dev-3dstreet.cloudfunctions.net/createStripeSession --> needs function deployed (KF can try)
  • Google maps API key is hard coded -- in theory API key is the same as our FIREBASE_API_KEY does not need to be different (KF can fix)
  • Stripe API keys hardcoded in cf1a3a832d453b7fecd710a95fe78271da6 --> assume these can be instead referenced from env config file STRIPE_PK, STRIPE_SK, STRIPE_WH_SEC (KF can try this after getting test keys)
  • GA_ID not needed in config template (KF remove)
  • checking if user is premium by looking at orders table isUserPremium -- this function does not appear to check if the order was successful or if they cancel at a future date, etc. Instead, what if we add a custom claim and isUserPremium is a check on the claim "plan": "PRO" (KF to test this)
  • "Manage subscription" link in profile doesn't appear to link anywhere -- does this need an extra function call from stripe SDK to generate this URL?
  • Geo modal cancel button does not work
  • Geo modal map click does not result in desired action
  • Geo modal updating location does not update entity ID
  • Payment modal learn more link does not link anywhere - KF can do that

Next step for this:

  • Can we push "isPremium" ASAP? Can we feature lock using claims?
  • pull out geo map ASAP
  • Billing later

Therefore requests of Rosty:

  • Question: is there any reason that we MUST have an orders table? Or can we use "claims" instead for this purpose? Then I can use stripe UI as my orders table. I will manually update user claims based on stripe events or eventually write additional cloud functions to do this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants