From d6c657e7b2d4fb1f5ceee57d75fd04e2fc166c19 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 23 Aug 2025 22:57:58 -0400 Subject: [PATCH] option anme --- .env | 3 +++ .env.live | 3 ++- .env.qa | 13 ++--------- .production.env | 31 ++++++++++++------------- SQL/sql_live.sql | 19 +++++++++++---- app/api/schemas/subscription_session.py | 1 + 6 files changed, 37 insertions(+), 33 deletions(-) diff --git a/.env b/.env index e3c51d8..c9a6944 100644 --- a/.env +++ b/.env @@ -41,4 +41,7 @@ STRIPE_PUB_KEY="pk_test_51RqL5WLjZLojw6IZmEpwFidNZSl9lLlVUHNvuFZNEz1eTR9XXepnyyV #Secret key STRIPE_PRIV_KEY="sk_test_51RqL5WLjZLojw6IZZa921BftQWmxZ4JDxrHUrFZvc5kwJhxtK3ijZguUw42c4Rl5yjmpkdYlbpslDOaMGtOSrsL100oaN72Lne" +STRIPE_SUCCESS_URL="https://qa-panel.mermsemr.com/subscription-success?session_id={CHECKOUT_SESSION_ID}" +STRIPE_CANCEL_URL="https://qa-panel.mermsemr.com/subscription" + diff --git a/.env.live b/.env.live index c4af62b..966e344 100644 --- a/.env.live +++ b/.env.live @@ -40,4 +40,5 @@ STRIPE_PUB_KEY="pk_test_51RqL5WLjZLojw6IZmEpwFidNZSl9lLlVUHNvuFZNEz1eTR9XXepnyyV #Secret key STRIPE_PRIV_KEY="sk_test_51RqL5WLjZLojw6IZZa921BftQWmxZ4JDxrHUrFZvc5kwJhxtK3ijZguUw42c4Rl5yjmpkdYlbpslDOaMGtOSrsL100oaN72Lne" - +STRIPE_SUCCESS_URL="https://panel.mermsemr.com/subscription-success?session_id={CHECKOUT_SESSION_ID}" +STRIPE_CANCEL_URL="https://panel.mermsemr.com/subscription" diff --git a/.env.qa b/.env.qa index 69eeb3f..216e4f0 100644 --- a/.env.qa +++ b/.env.qa @@ -51,14 +51,5 @@ STRIPE_PUB_KEY="pk_test_51RqL5WLjZLojw6IZmEpwFidNZSl9lLlVUHNvuFZNEz1eTR9XXepnyyV #Secret key STRIPE_PRIV_KEY="sk_test_51RqL5WLjZLojw6IZZa921BftQWmxZ4JDxrHUrFZvc5kwJhxtK3ijZguUw42c4Rl5yjmpkdYlbpslDOaMGtOSrsL100oaN72Lne" - -# APP_PORT=14700 -# FLASK_APP=project/__init__.py -# FLASK_DEBUG=1 -# SOCKET_URL=https://dev-socket.mermsemr.com -# PANEL_URL=https://dev-panel.mermsemr.com -# DATABASE_URL=postgresql://merms_panel:merms_panel@10.20.30.60:5432/merms_panel -# SQL_HOST=10.20.30.60 -# SQL_PORT=5432 -# DATABASE=postgres -# APP_FOLDER=/usr/src/app \ No newline at end of file +STRIPE_SUCCESS_URL="https://qa-panel.mermsemr.com/subscription-success?session_id={CHECKOUT_SESSION_ID}" +STRIPE_CANCEL_URL="https://qa-panel.mermsemr.com/subscription" diff --git a/.production.env b/.production.env index d179224..df1c3fa 100644 --- a/.production.env +++ b/.production.env @@ -38,19 +38,18 @@ SIMBRELLA_API_KEY="testtest-api-key-12345" JWT_SECRET_KEY=dce6bd64f7d7101de4f -# APP_PORT=14700 -# FLASK_APP=project/__init__.py -# FLASK_DEBUG=1 -# SOCKET_URL=https://dev-socket.mermsemr.com -# PANEL_URL=https://dev-panel.mermsemr.com -# DATABASE_URL=postgresql://merms_panel:merms_panel@10.20.30.60:5432/merms_panel -# SQL_HOST=10.20.30.60 -# SQL_PORT=5432 -# DATABASE=postgres -# APP_FOLDER=/usr/src/app -# INITIAL_PRODUCT_URL=devprov.mermsemr.com -# MAIL_SERVER=smtp.gmail.com -# MAIL_PORT= 465 -# MAIL_USERNAME=message@chiefsoft.com -# MAIL_PASSWORD=may12002! -# JWT_SECRET=dce6bd64f7d7101de4f \ No newline at end of file +MAIL_SERVER=smtp.gmail.com +MAIL_PORT= 465 +MAIL_USERNAME=message@chiefsoft.com +MAIL_PASSWORD=may12002! +JWT_SECRET_KEY=dce6bd64f7d7101de4fed7cfc185a12851611a79bd60bbfdcc5b414b85f1fdb75e0905691c2a77ce94a7351b261fab4e183e17731ed40089f68f7290a793119f285d8ec7902d248ce15e8b1d4996ebacf5e7bcb06a38ac7ce0736f17d5c2895a499661d27095ac20aa174f9af2fba9a849dd2e6fd0aad8aa7e1ecc030c11eb8dc8dcb71d32233de3530d04f85918b9582f8b02587a7350aa34232825d4831707c7c5775026f3fdd92c5df555e6ff8b785525922709830206bbd49c371fb6e16bcab01ffccaf904108bb9789c578bce6afbb33bc77960051e680b2428d1f026473e71ef0f9997b2a6dc496e1c40509a1d289e3ff8b384c2d49e1d7719f9f4aaa1 + +#Publishable key +STRIPE_PUB_KEY="pk_test_51RqL5WLjZLojw6IZmEpwFidNZSl9lLlVUHNvuFZNEz1eTR9XXepnyyVhfvXe9cp4eMnqkDPpoe9wxLLRSV0dxRee00UfhayUOT" +#Secret key +STRIPE_PRIV_KEY="sk_test_51RqL5WLjZLojw6IZZa921BftQWmxZ4JDxrHUrFZvc5kwJhxtK3ijZguUw42c4Rl5yjmpkdYlbpslDOaMGtOSrsL100oaN72Lne" + +STRIPE_SUCCESS_URL="https://panel.mermsemr.com/subscription-success?session_id={CHECKOUT_SESSION_ID}" +STRIPE_CANCEL_URL="https://panel.mermsemr.com/subscription" + + diff --git a/SQL/sql_live.sql b/SQL/sql_live.sql index d592907..35a8b4b 100644 --- a/SQL/sql_live.sql +++ b/SQL/sql_live.sql @@ -44,9 +44,16 @@ ALTER TABLE members ADD firstname VARCHAR(25); ALTER TABLE members ADD lastname VARCHAR(25); ALTER TABLE members ALTER COLUMN password TYPE VARCHAR(250); ALTER TABLE members ADD country VARCHAR(3); -ALTER TABLE members ADD stripe_customer_id VARCHAR(100) +ALTER TABLE members ADD stripe_customer_id VARCHAR(100); ALTER TABLE members ADD profile_completed timestamp without time zone DEFAULT NULL; + + + + + + + CREATE TABLE members_profile( id SERIAL, uid uuid DEFAULT uuid_generate_v4(), @@ -61,7 +68,7 @@ CREATE TABLE members_profile( ALTER TABLE ONLY members_profile ADD CONSTRAINT members_members_profile_id_key UNIQUE (id); -ALTER TABLE members_profile OWNER TO merms_panel +--- ALTER TABLE members_profile OWNER TO merms_panel CREATE TABLE members_session( @@ -91,16 +98,18 @@ CREATE TABLE products ( ); ALTER TABLE ONLY products ADD CONSTRAINT products_id_key UNIQUE (id); - -INSERT INTO products (name,description,status,product_id, banner) VALUES ('Personal Website','Your personal professional web presence',1,'A000001', 'banner.jpg'); +ALTER TABLE products ADD banner VARCHAR(100); +INSERT INTO products (name,description,status,product_id, banner) VALUES ('Personal Website','Your personal professional web presence',5,'A000001', 'banner.jpg'); INSERT INTO products (name,description,status,product_id, banner) VALUES ('Professional Website','Your healthcare practice online presence ',1,'A000002', 'banner.jpg'); INSERT INTO products (name,description,status,product_id, banner) VALUES ('Personal Blog','Blog to share your health care view',1,'A000003', 'banner.jpg'); INSERT INTO products (name,description,status,product_id, banner) VALUES ('Professional Blog','Booster your practice with engaging contents',1,'A000004', 'banner.jpg'); INSERT INTO products (name,description,status,product_id, banner) VALUES ('Practice EMR','Get Open EMR for practice management',1,'A000005', 'banner.jpg'); -ALTER TABLE products ADD banner VARCHAR(100); + UPDATE products set banner = 'p'||id||'.jpg' +---- ===== STOP HERE +ALTER TABLE members ADD option_name VARCHAR(100) REFERENCES subscription_options(option_name); CREATE TABLE products_details ( id SERIAL, diff --git a/app/api/schemas/subscription_session.py b/app/api/schemas/subscription_session.py index 5395563..a257925 100644 --- a/app/api/schemas/subscription_session.py +++ b/app/api/schemas/subscription_session.py @@ -5,6 +5,7 @@ class SubscriptionSession(Schema): uid = fields.Str(required=True) customerId = fields.Str(required=True) priceId = fields.Str(required=True) + option_name = fields.Str(required=True) # { # "priceId": "price_1RzLIMLjZLojw6IZ95Eijmdd",