Skip to content

Commit

Permalink
refactor: Update fetch_payment function to return payment_payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Arghya721 committed Aug 18, 2024
1 parent 02a421b commit c1c74e3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,15 @@ async def fetch_payment(payment_id: str, token_info: dict = Depends(verify_token
if payment_data:
# fetch the payment details
payment_data = Payment(client).fetch(payment_id)
print(payment_data)
return payment_data
payment_payload = {
"id": payment_data['id'],
"order_id": payment_data['order_id'],
"status": payment_data['status'],
"amount": payment_data['amount'],
"currency": payment_data['currency'],
"description": payment_data['description'],
}
return payment_payload
else:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
Expand Down

0 comments on commit c1c74e3

Please sign in to comment.