hardik8588 commited on
Commit
61de7f0
·
verified ·
1 Parent(s): 699775a

Update paypal_integration.py

Browse files
Files changed (1) hide show
  1. paypal_integration.py +11 -12
paypal_integration.py CHANGED
@@ -192,7 +192,7 @@ def create_plan(product_id, name, price, interval="MONTH", interval_count=1):
192
  "pricing_scheme": {
193
  "fixed_price": {
194
  "value": str(price),
195
- "currency_code": "USD"
196
  }
197
  }
198
  }
@@ -201,7 +201,7 @@ def create_plan(product_id, name, price, interval="MONTH", interval_count=1):
201
  "auto_bill_outstanding": True,
202
  "setup_fee": {
203
  "value": "0",
204
- "currency_code": "USD"
205
  },
206
  "setup_fee_failure_action": "CONTINUE",
207
  "payment_failure_threshold": 3
@@ -271,8 +271,8 @@ def initialize_subscription_plans():
271
  "total_cycles": 0,
272
  "pricing_scheme": {
273
  "fixed_price": {
274
- "value": "9.99",
275
- "currency_code": "USD"
276
  }
277
  }
278
  }
@@ -281,7 +281,7 @@ def initialize_subscription_plans():
281
  "auto_bill_outstanding": True,
282
  "setup_fee": {
283
  "value": "0",
284
- "currency_code": "USD"
285
  },
286
  "setup_fee_failure_action": "CONTINUE",
287
  "payment_failure_threshold": 3
@@ -302,8 +302,8 @@ def initialize_subscription_plans():
302
  "total_cycles": 0,
303
  "pricing_scheme": {
304
  "fixed_price": {
305
- "value": "19.99",
306
- "currency_code": "USD"
307
  }
308
  }
309
  }
@@ -312,7 +312,7 @@ def initialize_subscription_plans():
312
  "auto_bill_outstanding": True,
313
  "setup_fee": {
314
  "value": "0",
315
- "currency_code": "USD"
316
  },
317
  "setup_fee_failure_action": "CONTINUE",
318
  "payment_failure_threshold": 3
@@ -534,10 +534,9 @@ def update_user_subscription(user_email, subscription_id, tier):
534
 
535
  # Add this near the top with other path definitions
536
  # Update the PLAN_IDS_PATH definition to use the correct path
537
- PLAN_IDS_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "data", "plan_ids.json"))
538
-
539
- # Make sure the data directory exists
540
  os.makedirs(os.path.dirname(PLAN_IDS_PATH), exist_ok=True)
 
541
 
542
  # Add this debug log to see where the file is expected
543
  logger.info(f"PayPal plans will be stored at: {PLAN_IDS_PATH}")
@@ -545,7 +544,7 @@ logger.info(f"PayPal plans will be stored at: {PLAN_IDS_PATH}")
545
  # Add this function if it's not defined elsewhere
546
  def get_db_connection():
547
  """Get a connection to the SQLite database"""
548
- DB_PATH = os.getenv("DB_PATH", os.path.join(os.path.dirname(__file__), "../data/user_data.db"))
549
  # Make sure the data directory exists
550
  os.makedirs(os.path.dirname(DB_PATH), exist_ok=True)
551
  return sqlite3.connect(DB_PATH)
 
192
  "pricing_scheme": {
193
  "fixed_price": {
194
  "value": str(price),
195
+ "currency_code": "INR"
196
  }
197
  }
198
  }
 
201
  "auto_bill_outstanding": True,
202
  "setup_fee": {
203
  "value": "0",
204
+ "currency_code": "INR"
205
  },
206
  "setup_fee_failure_action": "CONTINUE",
207
  "payment_failure_threshold": 3
 
271
  "total_cycles": 0,
272
  "pricing_scheme": {
273
  "fixed_price": {
274
+ "value": "799",
275
+ "currency_code": "INR"
276
  }
277
  }
278
  }
 
281
  "auto_bill_outstanding": True,
282
  "setup_fee": {
283
  "value": "0",
284
+ "currency_code": "INR"
285
  },
286
  "setup_fee_failure_action": "CONTINUE",
287
  "payment_failure_threshold": 3
 
302
  "total_cycles": 0,
303
  "pricing_scheme": {
304
  "fixed_price": {
305
+ "value": "1499",
306
+ "currency_code": "INR"
307
  }
308
  }
309
  }
 
312
  "auto_bill_outstanding": True,
313
  "setup_fee": {
314
  "value": "0",
315
+ "currency_code": "INR"
316
  },
317
  "setup_fee_failure_action": "CONTINUE",
318
  "payment_failure_threshold": 3
 
534
 
535
  # Add this near the top with other path definitions
536
  # Update the PLAN_IDS_PATH definition to use the correct path
537
+ PLAN_IDS_PATH = os.path.abspath("/tmp/data/plan_ids.json")
 
 
538
  os.makedirs(os.path.dirname(PLAN_IDS_PATH), exist_ok=True)
539
+ # Make sure the data directory exists
540
 
541
  # Add this debug log to see where the file is expected
542
  logger.info(f"PayPal plans will be stored at: {PLAN_IDS_PATH}")
 
544
  # Add this function if it's not defined elsewhere
545
  def get_db_connection():
546
  """Get a connection to the SQLite database"""
547
+ DB_PATH = os.path.abspath("/tmp/user_data.db")
548
  # Make sure the data directory exists
549
  os.makedirs(os.path.dirname(DB_PATH), exist_ok=True)
550
  return sqlite3.connect(DB_PATH)