tierrun / tier-vercel-openai

This project generates marketing content using OpenAI, implements metered pricing model, checks for feature access based on their current subscription, reports usage of a feature, manages subscription and more using Tier.
https://tier-vercel-openai.vercel.app
MIT License
335 stars 49 forks source link

Trying to Update Plan Raises Error #8

Closed lewisddffse11 closed 1 year ago

lewisddffse11 commented 1 year ago

Describe the bug Error Code: 500 Function: /api/change-plan

tier: GET https://api.tier.run/v1/limits?org=org%3Aclkp7sutx0000ky08x5x1iv02 tier: GET https://api.tier.run/v1/payment_methods?org=org%3Aclkp7sutx0000ky08x5x1iv02 set up mode checkout tier: POST /v1/checkout { org: 'org:clkp7sutx0000ky08x5x1iv02', success_url: 'https://tier-vercel-openai4.vercel.app/api/subscribe?plan=plan:startup@0', cancel_url: 'https://tier-vercel-openai4.vercel.app/billing', require_billing_address: undefined, tax: undefined }

To Reproduce Go to billing and press the "Upgrade" button.

Information I using a copy of https://model.tier.run/clkkv3fv93bbko972m4w3x9o8. I am deploying in live mode with live Stripe API keys. Other functions work. Function: /billing works with the following output: tier: GET https://api.tier.run/v1/pull { plans: { 'plan:business@0': { title: 'Business', features: [Object] }, 'plan:free@0': { title: 'Free', features: [Object] }, 'plan:startup@0': { title: 'Startup', features: [Object] } } } tier: GET https://api.tier.run/v1/limits?org=org%3Aclkp7sutx0000ky08x5x1iv02 tier: GET https://api.tier.run/v1/phase?org=org%3Aclkp7sutx0000ky08x5x1iv02 tier: GET https://api.tier.run/v1/whois?org=org%3Aclkp7sutx0000ky08x5x1iv02&include=info tier: GET https://api.tier.run/v1/payment_methods?org=org%3Aclkp7sutx0000ky08x5x1iv02 undefined

jerriclynsjohn commented 1 year ago

Can you confirm if the problem persists after giving full permission for the restricted key that you are using.

lewisddffse11 commented 1 year ago

I have solved the problem by giving the key ALL the permissions.