transfer money
This commit is contained in:
parent
345bde39a3
commit
6f568125b3
15 changed files with 219 additions and 108 deletions
|
|
@ -5,6 +5,8 @@ from oauth2_provider.models import AbstractApplication, AbstractAccessToken, Abs
|
||||||
import uuid
|
import uuid
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
from apps.wallet.constans import TypeChoices
|
||||||
|
|
||||||
|
|
||||||
class AccessToken(AbstractAccessToken):
|
class AccessToken(AbstractAccessToken):
|
||||||
id = None
|
id = None
|
||||||
|
|
@ -25,6 +27,14 @@ class Application(AbstractApplication):
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = False
|
abstract = False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def instance_id(self):
|
||||||
|
return self.pk
|
||||||
|
|
||||||
|
@property
|
||||||
|
def instance_type(self):
|
||||||
|
return TypeChoices.APPLICATION
|
||||||
|
|
||||||
|
|
||||||
class Grant(AbstractGrant):
|
class Grant(AbstractGrant):
|
||||||
id = None
|
id = None
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import string
|
||||||
import base64
|
import base64
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
|
from apps.wallet.constans import TypeChoices
|
||||||
|
|
||||||
|
|
||||||
class UserManager(BaseUserManager):
|
class UserManager(BaseUserManager):
|
||||||
|
|
@ -75,6 +76,14 @@ class User(AbstractUser):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.username or self.pk)
|
return str(self.username or self.pk)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def instance_id(self):
|
||||||
|
return self.pk
|
||||||
|
|
||||||
|
@property
|
||||||
|
def instance_type(self):
|
||||||
|
return TypeChoices.APPLICATION
|
||||||
|
|
||||||
|
|
||||||
# TODO: user redis instead.
|
# TODO: user redis instead.
|
||||||
# TODO: create a queryset
|
# TODO: create a queryset
|
||||||
|
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
from django.contrib import messages
|
|
||||||
from django.contrib.auth.decorators import login_required
|
|
||||||
from django.db.models import Q
|
|
||||||
from django.urls import reverse
|
|
||||||
from django.utils.decorators import method_decorator
|
|
||||||
from django.views.generic import DetailView, ListView, UpdateView
|
|
||||||
|
|
||||||
from oauth2_provider.contrib.rest_framework import TokenHasScope, IsAuthenticatedOrTokenHasScope
|
|
||||||
from rest_framework import generics, permissions, mixins
|
|
||||||
from rest_framework.permissions import AllowAny
|
|
||||||
from rest_framework.response import Response
|
|
||||||
from rest_framework.viewsets import GenericViewSet, ModelViewSet
|
|
||||||
|
|
||||||
from apps.gooyal_oauth2.rest_framework import IsAuthenticatedOrTokenMatchesOASRequirements, \
|
|
||||||
IsAuthenticatedOrActionMatchesOASRequirements
|
|
||||||
from apps.wallet.models import Transaction
|
|
||||||
from apps.wallet.serializers import TransactionSerializer, DepositSerializer, WithdrawSerializer, WalletSerializer
|
|
||||||
from .constans import StateChoices
|
|
||||||
from .forms import TransactionActionForm
|
|
||||||
|
|
||||||
from django.utils.translation import gettext_lazy as _
|
|
||||||
|
|
||||||
|
|
||||||
def get_application(request):
|
|
||||||
try:
|
|
||||||
application = request.auth.application
|
|
||||||
except:
|
|
||||||
application = None
|
|
||||||
return application
|
|
||||||
|
|
||||||
|
|
||||||
class ApplicationWalletBalanceView(generics.RetrieveAPIView):
|
|
||||||
'''
|
|
||||||
API for getting authenticated user balance.
|
|
||||||
'''
|
|
||||||
permission_classes = [TokenHasScope]
|
|
||||||
serializer_class = WalletSerializer
|
|
||||||
required_scopes = ['wallet.application:get_balance']
|
|
||||||
|
|
||||||
def get_object(self):
|
|
||||||
return self.request.user
|
|
||||||
|
|
||||||
def retrieve(self, request, *args, **kwargs):
|
|
||||||
return super().retrieve(request, *args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
class TransactionDetail(generics.RetrieveAPIView):
|
|
||||||
permission_classes = [permissions.IsAuthenticated, IsAuthenticatedOrTokenHasScope]
|
|
||||||
serializer_class = TransactionSerializer
|
|
||||||
lookup_field = 'uuid'
|
|
||||||
required_scopes = ['wallet.transaction:retrieve']
|
|
||||||
|
|
||||||
def get_queryset(self):
|
|
||||||
user = self.request.user
|
|
||||||
return Transaction.objects.filter(Q(payee=user) | Q(payer=user) | Q(payer__isnull=True)).all()
|
|
||||||
|
|
||||||
|
|
||||||
class TransactionPay(generics.RetrieveAPIView):
|
|
||||||
permission_classes = [permissions.IsAuthenticated, IsAuthenticatedOrTokenHasScope]
|
|
||||||
serializer_class = TransactionSerializer
|
|
||||||
lookup_field = 'uuid'
|
|
||||||
required_scopes = ['wallet.invoice:pay']
|
|
||||||
|
|
||||||
def get_queryset(self):
|
|
||||||
user = self.request.user
|
|
||||||
return Transaction.objects.filter(Q(payer=user) | Q(payer__isnull=True)).all()
|
|
||||||
|
|
||||||
def retrieve(self, request, *args, **kwargs):
|
|
||||||
instance = self.get_object()
|
|
||||||
instance.pay(payer=self.request.user)
|
|
||||||
serializer = self.get_serializer(instance)
|
|
||||||
return Response(serializer.data)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -5,7 +5,7 @@ from django.utils.translation import gettext_lazy as _
|
||||||
class StateChoices(IntegerChoices):
|
class StateChoices(IntegerChoices):
|
||||||
CREATED = 1 , _('created')
|
CREATED = 1 , _('created')
|
||||||
DELAYED = 2 , _('delayed') # delayed as user wish
|
DELAYED = 2 , _('delayed') # delayed as user wish
|
||||||
PENDING = 3 , _('pending') # wait for external service response
|
PENDING = 3 , _('pending') # wait for external service response (or action)
|
||||||
INCOMPLETE = 4 , _('incomplete') # started and wait for internal progress to complete
|
INCOMPLETE = 4 , _('incomplete') # started and wait for internal progress to complete
|
||||||
SUCCESS = 5 , _('success')
|
SUCCESS = 5 , _('success')
|
||||||
FAILED = 6 , _('failed')
|
FAILED = 6 , _('failed')
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Generated by Django 5.0.6 on 2024-08-11 10:40
|
||||||
|
|
||||||
|
import django.core.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('wallet', '0004_remove_transaction_payee_remove_transaction_payer_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='transaction',
|
||||||
|
name='detail',
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='transaction',
|
||||||
|
name='details',
|
||||||
|
field=models.JSONField(blank=True, default=dict, null=True),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='transaction',
|
||||||
|
name='amount',
|
||||||
|
field=models.PositiveBigIntegerField(validators=[django.core.validators.MinValueValidator(1)], verbose_name='amount'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='transaction',
|
||||||
|
name='delay',
|
||||||
|
field=models.PositiveIntegerField(blank=True, default=0),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -193,4 +193,4 @@ class Transaction(models.Model):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.get_payer()} -> {self.get_payee()} ({self.uuid}): {self.amount}"
|
return f"{self.get_payer()} -> {self.get_payee()} ({self.uuid}): {self.amount} - {self.get_state_display()}"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ from django.db.transaction import atomic
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from rest_framework.exceptions import APIException
|
from rest_framework.exceptions import APIException
|
||||||
|
|
||||||
|
from .constans import TypeChoices
|
||||||
from .models import Transaction
|
from .models import Transaction
|
||||||
from ..users.models import User
|
from ..users.models import User
|
||||||
|
|
||||||
|
|
@ -10,6 +11,7 @@ from ..users.models import User
|
||||||
class TransactionSerializer(serializers.ModelSerializer):
|
class TransactionSerializer(serializers.ModelSerializer):
|
||||||
payee_id = serializers.UUIDField(read_only=True)
|
payee_id = serializers.UUIDField(read_only=True)
|
||||||
payee_type = serializers.UUIDField(read_only=True)
|
payee_type = serializers.UUIDField(read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Transaction
|
model = Transaction
|
||||||
fields = ('uuid',
|
fields = ('uuid',
|
||||||
|
|
@ -92,7 +94,55 @@ class WithdrawSerializer(serializers.ModelSerializer):
|
||||||
return transaction
|
return transaction
|
||||||
|
|
||||||
|
|
||||||
class WalletSerializer(serializers.ModelSerializer):
|
class MyWalletSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model=User
|
model = User
|
||||||
fields = ['balance']
|
fields = ['balance']
|
||||||
|
|
||||||
|
|
||||||
|
class WalletBalanceSerializer(serializers.ModelSerializer):
|
||||||
|
instance_id = serializers.UUIDField(required=True)
|
||||||
|
instance_type = serializers.ChoiceField(choices=TypeChoices.choices, required=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = User
|
||||||
|
fields = ['balance', 'instance_id', 'instance_type']
|
||||||
|
|
||||||
|
|
||||||
|
class TransferSubmitSerializer(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = Transaction
|
||||||
|
fields = ('uuid',
|
||||||
|
'payer_id',
|
||||||
|
'payer_type',
|
||||||
|
'payee_id',
|
||||||
|
'payee_type',
|
||||||
|
"created_at",
|
||||||
|
"state",
|
||||||
|
'amount',
|
||||||
|
# 'delay',
|
||||||
|
'updated_at',
|
||||||
|
'details',
|
||||||
|
)
|
||||||
|
|
||||||
|
read_only_fields = ['uuid', 'updated_at', 'state', 'created_at']
|
||||||
|
|
||||||
|
|
||||||
|
class TransferVerifySerializer(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = Transaction
|
||||||
|
fields = ('uuid',
|
||||||
|
'payer_id',
|
||||||
|
'payer_type',
|
||||||
|
'payee_id',
|
||||||
|
'payee_type',
|
||||||
|
"created_at",
|
||||||
|
"state",
|
||||||
|
'amount',
|
||||||
|
# 'delay',
|
||||||
|
'updated_at',
|
||||||
|
'details',
|
||||||
|
)
|
||||||
|
|
||||||
|
read_only_fields = ['uuid', 'payer_id', 'payer_type', 'payee_id', 'payee_type', 'updated_at', 'state',
|
||||||
|
'amount', 'created_at']
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,30 @@
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
|
||||||
from .application_views import ApplicationWalletBalanceView
|
from .views import application as application_views
|
||||||
from .views import TransactionList, TransactionDetail, TransactionPay, TransactionReceipt, \
|
from .views import user as user_views
|
||||||
WithdrawVerify, WithdrawSubmit, DepositSubmit, DepositVerify, TransactionListView, TransactionDetailView, \
|
|
||||||
WalletBalanceView
|
|
||||||
|
|
||||||
app_name = "wallet"
|
app_name = "wallet"
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('transactions/', TransactionListView.as_view(), name='transaction_list'),
|
path('transactions/', user_views.TransactionListView.as_view(), name='user_transaction_list'),
|
||||||
path('transactions/<pk>', TransactionDetailView.as_view(), name='transaction_detail'),
|
path('transactions/<pk>', user_views.TransactionDetailView.as_view(), name='user_transaction_detail'),
|
||||||
|
|
||||||
path('api/wallet/balance', WalletBalanceView.as_view(), name='wallet_balance_api'),
|
|
||||||
|
|
||||||
path('api/transactions/', TransactionList.as_view(), name='transaction_list_api'),
|
|
||||||
path('api/transactions/<uuid>', TransactionDetail.as_view(), name='transaction_detail_api'),
|
|
||||||
path('api/transactions/<uuid>/pay', TransactionPay.as_view(), name='transaction_pay_api'),
|
|
||||||
path('api/transactions/<uuid>/receipt', TransactionReceipt.as_view(), name='transaction_receipt_api'),
|
|
||||||
#
|
#
|
||||||
path('api/deposit/', DepositSubmit.as_view(), name='deposit_submit_api'),
|
# path('api/wallet/balance', MyWalletBalanceView.as_view(), name='wallet_balance_api'),
|
||||||
path('api/deposit/<uuid>/verify', DepositVerify.as_view(), name='deposit_verify_api'),
|
|
||||||
#
|
#
|
||||||
path('api/withdraw/', WithdrawSubmit.as_view(), name='withdraw_submit_api'),
|
# path('api/transactions/', TransactionList.as_view(), name='transaction_list_api'),
|
||||||
path('api/withdraw/<uuid>/verify', WithdrawVerify.as_view(), name='withdraw_verify_api'),
|
# path('api/transactions/<uuid>', TransactionDetail.as_view(), name='transaction_detail_api'),
|
||||||
|
# path('api/transactions/<uuid>/pay', TransactionPay.as_view(), name='transaction_pay_api'),
|
||||||
|
# path('api/transactions/<uuid>/receipt', TransactionReceipt.as_view(), name='transaction_receipt_api'),
|
||||||
|
# #
|
||||||
|
# path('api/deposit/', DepositSubmit.as_view(), name='deposit_submit_api'),
|
||||||
|
# path('api/deposit/<uuid>/verify', DepositVerify.as_view(), name='deposit_verify_api'),
|
||||||
|
# #
|
||||||
|
# path('api/withdraw/', WithdrawSubmit.as_view(), name='withdraw_submit_api'),
|
||||||
|
# path('api/withdraw/<uuid>/verify', WithdrawVerify.as_view(), name='withdraw_verify_api'),
|
||||||
|
|
||||||
|
path('api/get_balance/', application_views.WalletBalanceView.as_view(), name='wallet_balance'),
|
||||||
|
path('api/transaction/transfer_submit/', application_views.TransferSubmitView.as_view(), name='transfer_submit'),
|
||||||
|
path('api/transaction/<uuid>/transfer_verify/', application_views.TransferVerifyView.as_view(), name='transfer_verify'),
|
||||||
|
path('api/transaction/<uuid>/', application_views.TransactionDetailView.as_view(), name='transaction_detail'),
|
||||||
|
|
||||||
path('api/get_balance/', ApplicationWalletBalanceView.as_view(), name='wallet_balance'),
|
|
||||||
]
|
]
|
||||||
0
apps/wallet/views/__init__.py
Normal file
0
apps/wallet/views/__init__.py
Normal file
83
apps/wallet/views/application.py
Executable file
83
apps/wallet/views/application.py
Executable file
|
|
@ -0,0 +1,83 @@
|
||||||
|
from django.db.models import Q
|
||||||
|
from django.http import Http404
|
||||||
|
from django.shortcuts import get_object_or_404
|
||||||
|
from oauth2_provider.contrib.rest_framework import TokenHasScope, IsAuthenticatedOrTokenHasScope
|
||||||
|
from rest_framework import generics, permissions, mixins
|
||||||
|
from rest_framework.response import Response
|
||||||
|
|
||||||
|
from apps.gooyal_oauth2.models import Application
|
||||||
|
from apps.users.models import User
|
||||||
|
from apps.wallet.constans import TypeChoices
|
||||||
|
from apps.wallet.models import Transaction
|
||||||
|
from apps.wallet.serializers import TransactionSerializer, WalletBalanceSerializer, TransferSubmitSerializer, \
|
||||||
|
TransferVerifySerializer
|
||||||
|
|
||||||
|
|
||||||
|
def get_application(request):
|
||||||
|
try:
|
||||||
|
application = request.auth.application
|
||||||
|
except:
|
||||||
|
application = None
|
||||||
|
return application
|
||||||
|
|
||||||
|
|
||||||
|
class WalletBalanceView(generics.RetrieveAPIView):
|
||||||
|
'''
|
||||||
|
API for getting specified user or application balance.
|
||||||
|
'''
|
||||||
|
permission_classes = [TokenHasScope]
|
||||||
|
serializer_class = WalletBalanceSerializer
|
||||||
|
required_scopes = ['wallet.application:get_balance']
|
||||||
|
|
||||||
|
def get_object(self):
|
||||||
|
serializer = self.get_serializer(data=self.request.data)
|
||||||
|
serializer.is_valid(raise_exception=True)
|
||||||
|
instance_id = serializer.data.get('instance_id')
|
||||||
|
instance_type = serializer.data.get('instance_type')
|
||||||
|
if instance_type == TypeChoices.USER:
|
||||||
|
queryset = User.objects.filter(pk=instance_id)
|
||||||
|
elif instance_type == TypeChoices.APPLICATION:
|
||||||
|
queryset = Application.objects.filter(pk=instance_id)
|
||||||
|
else:
|
||||||
|
raise Http404(
|
||||||
|
"No object matches the given query."
|
||||||
|
)
|
||||||
|
|
||||||
|
instance = get_object_or_404(queryset)
|
||||||
|
return instance
|
||||||
|
|
||||||
|
def retrieve(self, request, *args, **kwargs):
|
||||||
|
return super().retrieve(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
class TransactionDetailView(generics.RetrieveAPIView):
|
||||||
|
permission_classes = [TokenHasScope]
|
||||||
|
serializer_class = TransactionSerializer
|
||||||
|
lookup_field = 'uuid'
|
||||||
|
required_scopes = ['wallet.application:transaction_detail']
|
||||||
|
|
||||||
|
|
||||||
|
class TransferSubmitView(generics.CreateAPIView):
|
||||||
|
permission_classes = [TokenHasScope]
|
||||||
|
serializer_class = TransferSubmitSerializer
|
||||||
|
lookup_field = 'uuid'
|
||||||
|
required_scopes = ['wallet.application:transfer_submit']
|
||||||
|
|
||||||
|
def perform_create(self, serializer):
|
||||||
|
instance:Transaction = serializer.save()
|
||||||
|
application = get_application(self.request)
|
||||||
|
instance.application = application
|
||||||
|
instance.submit()
|
||||||
|
|
||||||
|
|
||||||
|
class TransferVerifyView(generics.UpdateAPIView):
|
||||||
|
permission_classes = [TokenHasScope]
|
||||||
|
serializer_class = TransferVerifySerializer
|
||||||
|
lookup_field = 'uuid'
|
||||||
|
required_scopes = ['wallet.application:transfer_verify']
|
||||||
|
queryset = Transaction.objects.all()
|
||||||
|
|
||||||
|
def perform_update(self, serializer):
|
||||||
|
instance:Transaction = serializer.save()
|
||||||
|
instance.verify()
|
||||||
|
|
||||||
|
|
@ -12,9 +12,10 @@ from rest_framework.response import Response
|
||||||
|
|
||||||
from apps.gooyal_oauth2.rest_framework import IsAuthenticatedOrTokenMatchesOASRequirements
|
from apps.gooyal_oauth2.rest_framework import IsAuthenticatedOrTokenMatchesOASRequirements
|
||||||
from apps.wallet.models import Transaction
|
from apps.wallet.models import Transaction
|
||||||
from apps.wallet.serializers import TransactionSerializer, DepositSerializer, WithdrawSerializer, WalletSerializer
|
from apps.wallet.serializers import TransactionSerializer, DepositSerializer, WithdrawSerializer, \
|
||||||
from .constans import StateChoices
|
MyWalletSerializer
|
||||||
from .forms import TransactionActionForm
|
from ..constans import StateChoices
|
||||||
|
from ..forms import TransactionActionForm
|
||||||
|
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
@ -27,12 +28,12 @@ def get_application(request):
|
||||||
return application
|
return application
|
||||||
|
|
||||||
|
|
||||||
class WalletBalanceView(generics.RetrieveAPIView):
|
class MyWalletBalanceView(generics.RetrieveAPIView):
|
||||||
'''
|
'''
|
||||||
API for getting authenticated user balance.
|
API for getting authenticated user balance.
|
||||||
'''
|
'''
|
||||||
permission_classes = [AllowAny, permissions.IsAuthenticated, IsAuthenticatedOrTokenHasScope]
|
permission_classes = [AllowAny, permissions.IsAuthenticated, IsAuthenticatedOrTokenHasScope]
|
||||||
serializer_class = WalletSerializer
|
serializer_class = MyWalletSerializer
|
||||||
required_scopes = ['wallet.application:get_balance']
|
required_scopes = ['wallet.application:get_balance']
|
||||||
|
|
||||||
def get_object(self):
|
def get_object(self):
|
||||||
|
|
@ -183,7 +184,7 @@ class TransactionListView(ListView):
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
user = self.request.user
|
user = self.request.user
|
||||||
return Transaction.objects.filter(Q(payee=user) | Q(payer=user)).all()
|
return Transaction.objects.filter(Q(payee_id=user.pk) | Q(payer_id=user.pk)).all()
|
||||||
|
|
||||||
|
|
||||||
@method_decorator(login_required, name='dispatch')
|
@method_decorator(login_required, name='dispatch')
|
||||||
|
|
@ -213,4 +214,3 @@ class TransactionDetailView(UpdateView):
|
||||||
result = transaction.receipt()
|
result = transaction.receipt()
|
||||||
messages.error(self.request, _('success.'))
|
messages.error(self.request, _('success.'))
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<span class="fw-bold">
|
<span class="fw-bold">
|
||||||
amount:
|
amount:
|
||||||
</span>
|
</span>
|
||||||
<a href="{% url 'wallet:transaction_detail' transaction.pk %}">{{ transaction.amount }}</a>
|
<a href="{% url 'wallet:user_transaction_detail' transaction.pk %}">{{ transaction.amount }}</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col col-sm-12 col-md-4 col-lg-4">
|
<div class="col col-sm-12 col-md-4 col-lg-4">
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col d-flex justify-content-center">
|
<div class="col d-flex justify-content-center">
|
||||||
<div class="bi bi-file-spreadsheet p-1"></div>
|
<div class="bi bi-file-spreadsheet p-1"></div>
|
||||||
<div class="p-1"><a class="text-decoration-none" href="{% url 'wallet:transaction_list' %}">transactions</a></div>
|
<div class="p-1"><a class="text-decoration-none" href="{% url 'wallet:user_transaction_list' %}">transactions</a></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col d-flex justify-content-center">
|
<div class="col d-flex justify-content-center">
|
||||||
<div class="bi bi-file-spreadsheet p-1"></div>
|
<div class="bi bi-file-spreadsheet p-1"></div>
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ TEMPLATES = [
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = (
|
AUTHENTICATION_BACKENDS = (
|
||||||
'oauth2_provider.backends.OAuth2Backend',
|
'oauth2_provider.backends.OAuth2Backend',
|
||||||
# 'django.contrib.auth.backends.ModelBackend',
|
'django.contrib.auth.backends.ModelBackend',
|
||||||
)
|
)
|
||||||
|
|
||||||
WSGI_APPLICATION = 'wallet.wsgi.application'
|
WSGI_APPLICATION = 'wallet.wsgi.application'
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,6 @@ from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, Spec
|
||||||
|
|
||||||
|
|
||||||
# from apps.gooyal_oauth2.views.introspect import introspect_token
|
# from apps.gooyal_oauth2.views.introspect import introspect_token
|
||||||
from apps.wallet.views import TransactionList, TransactionDetail, TransactionPay, TransactionReceipt, \
|
|
||||||
WithdrawVerify, WithdrawSubmit, DepositSubmit, DepositVerify
|
|
||||||
from django.contrib.auth import urls as auth_urls
|
from django.contrib.auth import urls as auth_urls
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue