Fred808 commited on
Commit
673cee3
·
verified ·
1 Parent(s): 319997d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -169,7 +169,7 @@ def create_paystack_payment_link(email: str, amount: int, reference: str) -> dic
169
  "email": email,
170
  "amount": amount,
171
  "reference": reference,
172
- "callback_url": "https://yourdomain.com/payment_callback"
173
  }
174
  try:
175
  response = requests.post(url, json=data, headers=headers, timeout=10)
@@ -699,6 +699,7 @@ async def process_voice(file: UploadFile = File(...)):
699
 
700
  # --- Payment Callback Endpoint with Payment Tracking and Redirection ---
701
  @app.api_route("/payment_callback", methods=["GET", "POST"])
 
702
  async def payment_callback(request: Request):
703
  # GET: User redirection after payment
704
  if request.method == "GET":
@@ -724,7 +725,7 @@ async def payment_callback(request: Request):
724
  f"Payment Update:\nOrder ID: {order_id} is now {status}."
725
  )
726
  # Redirect user back to the chat interface (adjust URL as needed)
727
- redirect_url = f"https://fred808-botpy-808.hf.space/chat?order_id={order_id}&status=success"
728
  return RedirectResponse(url=redirect_url)
729
  # POST: Server-to-server callback from Paystack
730
  else:
 
169
  "email": email,
170
  "amount": amount,
171
  "reference": reference,
172
+ "callback_url": "https://custy-bot.vercel.app/payment_callback"
173
  }
174
  try:
175
  response = requests.post(url, json=data, headers=headers, timeout=10)
 
699
 
700
  # --- Payment Callback Endpoint with Payment Tracking and Redirection ---
701
  @app.api_route("/payment_callback", methods=["GET", "POST"])
702
+
703
  async def payment_callback(request: Request):
704
  # GET: User redirection after payment
705
  if request.method == "GET":
 
725
  f"Payment Update:\nOrder ID: {order_id} is now {status}."
726
  )
727
  # Redirect user back to the chat interface (adjust URL as needed)
728
+ redirect_url = f"https://wa.link/am87s2"
729
  return RedirectResponse(url=redirect_url)
730
  # POST: Server-to-server callback from Paystack
731
  else: