GamerC0der commited on
Commit
547ebb9
·
verified ·
1 Parent(s): 17d4a3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -12
app.py CHANGED
@@ -167,14 +167,12 @@ def calculate_fee(amount):
167
  return 50
168
 
169
  def calculate_claim_amounts(amount):
170
- if amount > 50:
171
- fee_percent = 0.02
172
- else:
173
- fee_percent = 0.01
174
-
175
- send_amount = max(1, int(amount * (1 + fee_percent)))
176
- claim_amount = max(1, int(amount * (1 - fee_percent)))
177
-
178
  return send_amount, claim_amount, fee_percent
179
 
180
  def generate_unique_code():
@@ -187,7 +185,7 @@ def generate_unique_code():
187
 
188
  return str(uuid.uuid4())
189
 
190
- ENCRYPTED_CONNECT_SID = encrypt_value('s%3AFSMCNK2YzaBROcBx6s8t50G96lmOqu0_.HAKonn5EXUgOcn1S%2Fbtj1ZZUL%2FgRtwTQxjtW5poj8Yo')
191
  ENCRYPTED_API_URL = encrypt_value('https://astra-bank-moh1812.replit.app/api/transactions')
192
  ENCRYPTED_REFERER = encrypt_value('https://astra-bank-moh1812.replit.app/')
193
  ENCRYPTED_ETAG = encrypt_value('W/"6e3-L0zHI4rHMa4nHmyewyA/4y+lL6c"')
@@ -737,14 +735,14 @@ def create_claim_link():
737
  @app.route('/claim/<claim_id>')
738
  def view_claim(claim_id):
739
  claim_link = ClaimLink.query.get_or_404(claim_id)
740
- fee_percent = 0.02 if claim_link.amount > 50 else 0.01
741
- fee = int(claim_link.amount * fee_percent)
742
  return render_template('claim.html',
743
  amount=claim_link.amount,
744
  send_amount=claim_link.send_amount,
745
  claim_amount=claim_link.claim_amount,
746
  fee=fee,
747
- fee_percent=int(fee_percent * 100),
748
  verified=claim_link.verified,
749
  claimed=claim_link.claimed,
750
  claimer_email=claim_link.claimer_email,
 
167
  return 50
168
 
169
  def calculate_claim_amounts(amount):
170
+ fee = 1 if amount <= 100 else 2
171
+ fee_percent = fee / amount if amount > 0 else 0
172
+
173
+ send_amount = amount + fee
174
+ claim_amount = amount
175
+
 
 
176
  return send_amount, claim_amount, fee_percent
177
 
178
  def generate_unique_code():
 
185
 
186
  return str(uuid.uuid4())
187
 
188
+ ENCRYPTED_CONNECT_SID = encrypt_value('s%3AchprkBWT1gzUWdCkJcWneCauTP73rb1-.tLvwxPgi6HFX3f1ULUt120nsbCJgODtlWpdp0cIluM0')
189
  ENCRYPTED_API_URL = encrypt_value('https://astra-bank-moh1812.replit.app/api/transactions')
190
  ENCRYPTED_REFERER = encrypt_value('https://astra-bank-moh1812.replit.app/')
191
  ENCRYPTED_ETAG = encrypt_value('W/"6e3-L0zHI4rHMa4nHmyewyA/4y+lL6c"')
 
735
  @app.route('/claim/<claim_id>')
736
  def view_claim(claim_id):
737
  claim_link = ClaimLink.query.get_or_404(claim_id)
738
+ fee = 1 if claim_link.amount <= 100 else 2
739
+ fee_percent = int((fee / claim_link.amount) * 100) if claim_link.amount > 0 else 0
740
  return render_template('claim.html',
741
  amount=claim_link.amount,
742
  send_amount=claim_link.send_amount,
743
  claim_amount=claim_link.claim_amount,
744
  fee=fee,
745
+ fee_percent=int(fee_percent),
746
  verified=claim_link.verified,
747
  claimed=claim_link.claimed,
748
  claimer_email=claim_link.claimer_email,