forked from Kamva-Academy/Kamva-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: do some refactors about transferring funds to user
- Loading branch information
1 parent
d62ef59
commit 03021ff
Showing
8 changed files
with
41 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
from rest_framework.routers import DefaultRouter | ||
from django.urls import path | ||
|
||
from apps.attributes.views.currency import get_currencies | ||
|
||
router = DefaultRouter() | ||
|
||
urlpatterns = [ | ||
path('currencies/', get_currencies), | ||
] | ||
urlpatterns = [] | ||
|
||
urlpatterns += router.urls |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from proxies.bank_service.bank import request_transfer | ||
from proxies.website_service.main import get_website | ||
from typing import TypedDict | ||
|
||
|
||
class TransferResponse(TypedDict): | ||
withdraw_transaction_id: str | ||
deposit_transaction_id: str | ||
|
||
|
||
def transfer_funds_to_user(website_name, user_uuid, funds) -> TransferResponse: | ||
website = get_website(website_name) | ||
|
||
return request_transfer( | ||
sender_id=website.get('uuid'), | ||
receiver_id=str(user_uuid), | ||
funds=funds, | ||
) |