test pna views
This commit is contained in:
parent
69635b5b03
commit
b8d2dd6925
2 changed files with 4 additions and 3 deletions
|
|
@ -46,7 +46,7 @@ class ChargeRequest(BaseModel):
|
|||
pna_client = PNAClient()
|
||||
description = 'from addwin ipg'
|
||||
pna_callback_url = f'https://ipg.addwin.ir/page/pna_callback/{self.pk}/'
|
||||
response = pna_client.request_normal_sale(self.amount, description, pna_callback_url, order_id=2)
|
||||
response = pna_client.request_normal_sale(self.amount, description, pna_callback_url, order_id=3)
|
||||
|
||||
self.pna_status_code = response['status']
|
||||
self.pna_status_message = response.get('title')
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from django.http import HttpResponseRedirect
|
|||
from django.shortcuts import render
|
||||
from django.urls import reverse
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.views.generic import UpdateView, DetailView
|
||||
from oauth2_provider.contrib.rest_framework import TokenHasScope, IsAuthenticatedOrTokenHasScope
|
||||
from rest_framework import generics
|
||||
|
|
@ -30,7 +31,7 @@ class ChargeRequestCreateApiView(generics.CreateAPIView):
|
|||
# TODO: web view
|
||||
# charge_request.charge_wallet_balance()
|
||||
|
||||
|
||||
@method_decorator(csrf_exempt, name='dispatch')
|
||||
class ChargeRequestView(UpdateView):
|
||||
template_name = 'pg/charge-request.html'
|
||||
form_class = ChargeRequestForm
|
||||
|
|
@ -76,7 +77,7 @@ class ChargeRequestView(UpdateView):
|
|||
return self.object.callback_url
|
||||
# return reverse('pg:charge-request-view', kwargs={'pk': self.object.pk})
|
||||
|
||||
|
||||
@method_decorator(csrf_exempt, name='dispatch')
|
||||
class ChargeConfirmView(UpdateView):
|
||||
template_name = 'pg/charge-request.html'
|
||||
form_class = ChargeRequestForm
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue