From 902cdf71cf19100291d81850db7cb8221e4ac043 Mon Sep 17 00:00:00 2001 From: freqnik Date: Fri, 3 Nov 2023 01:11:18 -0400 Subject: [PATCH] Change /v1/add to JSON POST --- meile_plan_api.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/meile_plan_api.py b/meile_plan_api.py index 946b032..5e40048 100644 --- a/meile_plan_api.py +++ b/meile_plan_api.py @@ -160,13 +160,14 @@ def add_wallet_to_plan(): status = False renewal = False try: - wallet = request.json.get('wallet') - plan_id = int(request.json.get('planid')) # plan ID, we should have 4 or 5 plans. Will be a UUID. - duration = int(request.json.get('duration')) # duration of plan subscription, in months - sub_id = int(request.json.get('subid')) # subscription ID of plan - uuid = request.json.get('uuid') # uuid of subscription - amt_paid = int(request.json.get('amt')) - denom = int(request.json.get('denom')) + JSON = request.json + wallet = JSON['data']['wallet'] + plan_id = int(JSON['data']['planid']) # plan ID, we should have 4 or 5 plans. Will be a UUID. + duration = int(JSON['data']['duration']) # duration of plan subscription, in months + sub_id = int(JSON['data']['subid']) # subscription ID of plan + uuid = JSON['data']['uuid'] # uuid of subscription + amt_paid = int(JSON['data']['amt']) + denom = int(JSON['data']['denom']) except Exception as e: print(str(e)) status = False