method get instead of post for confirm

This commit is contained in:
Sayyid Hamid Mahdavi 2025-05-16 09:24:40 +03:30
parent 63ce9fdea8
commit 243b34d4a3
2 changed files with 6 additions and 3 deletions

View file

@ -84,13 +84,13 @@ class ChargeRequest(models.Model):
raise Exception('Cannot charge balance because state') raise Exception('Cannot charge balance because state')
data = { data = {
"uuid": str(self.pk), "uuid": str(self.uuid),
"payee_id": str(self.user.uuid), "payee_id": str(self.user.uuid),
"payee_type": 1, "payee_type": 1,
"amount": self.amount, "amount": self.amount,
"details": { "details": {
'description': "charge via IPG", 'description': "charge via IPG",
'reference_id': str(self.pk), 'reference_id': str(self.uuid),
'application_details_url': '' 'application_details_url': ''
}, },
} }
@ -99,7 +99,7 @@ class ChargeRequest(models.Model):
if not submit_response.uuid: if not submit_response.uuid:
raise Exception('Failed to submit payment in wallet') raise Exception('Failed to submit payment in wallet')
verify_response = deposit_to_user_wallet_verify(self.pk) verify_response = deposit_to_user_wallet_verify(self.uuid)
if not verify_response.uuid or verify_response.state != 5: if not verify_response.uuid or verify_response.state != 5:
raise Exception('Failed to verify payment in wallet') raise Exception('Failed to verify payment in wallet')

View file

@ -115,6 +115,9 @@ class ChargeConfirmView(UpdateView):
print(request.POST) print(request.POST)
print(args) print(args)
print(kwargs) print(kwargs)
# post = <QueryDict: {'Token': ['NDEwMTI0Nzc0MDMzMA=='], 'OrderId': ['7'], 'TerminalNo': ['31127029'], 'RRN': ['511629156251'], 'status': ['0'], 'TspToken': ['00000000-0000-0000-0000-000000000000'], 'HashCardNumber': ['6008617E6BAB76997499446356F5C8B60288445650DD551FDF32007BCF2B14AF'], 'Amount': ['21,000'], 'SwAmount': [''], 'STraceNo': ['123232']}>
self.object = self.get_object() self.object = self.get_object()
charge_request: ChargeRequest = self.get_object() charge_request: ChargeRequest = self.get_object()
charge_request.charge_wallet_balance() charge_request.charge_wallet_balance()