fix(pg): deposit verify process
deposit verify process
This commit is contained in:
parent
91ba2a7edf
commit
0c9dde0339
3 changed files with 14 additions and 13 deletions
|
|
@ -120,8 +120,9 @@ class PaymentRequest(models.Model):
|
|||
def deposit_submit(self):
|
||||
data = {
|
||||
"uuid": str(self.uuid),
|
||||
"payee_id": str(self.user.uuid),
|
||||
"payee": str(self.user.uuid),
|
||||
"payee_type": 1,
|
||||
"payee_wallet": settings.WALLET_RIAL,
|
||||
"amount": self.amount,
|
||||
"details": {
|
||||
'description': str(_("charge via ipg")),
|
||||
|
|
@ -129,7 +130,7 @@ class PaymentRequest(models.Model):
|
|||
'application_details_url': ''
|
||||
},
|
||||
}
|
||||
submit_response = deposit_to_user_wallet_submit(settings.WALLET_RIAL_CATEGORY, data)
|
||||
submit_response = deposit_to_user_wallet_submit(settings.WALLET_RIAL, data)
|
||||
|
||||
if not submit_response or not submit_response.uuid:
|
||||
logger.error(f"[Deposit Submit] Wallet submission failed | payment_id={self.pk}")
|
||||
|
|
@ -147,7 +148,7 @@ class PaymentRequest(models.Model):
|
|||
return to_success
|
||||
|
||||
def deposit_verify(self):
|
||||
verify_response = deposit_to_user_wallet_verify(settings.WALLET_RIAL_CATEGORY, self.uuid)
|
||||
verify_response = deposit_to_user_wallet_verify(settings.WALLET_RIAL, self.uuid)
|
||||
|
||||
if not verify_response:
|
||||
logger.error(f"[Deposit Verify] Failed to get response from wallet service | payment_id={self.pk}")
|
||||
|
|
|
|||
|
|
@ -255,5 +255,5 @@ CACHES = {
|
|||
|
||||
PNA_CORPORATION_PIN = config('PNA_CORPORATION_PIN')
|
||||
WALLET_BASE_PUBLIC_URL = config('WALLET_BASE_PUBLIC_URL')
|
||||
WALLET_RIAL_CATEGORY = config('WALLET_RIAL_CATEGORY')
|
||||
WALLET_RIAL = config('WALLET_RIAL')
|
||||
IPG_BASE_PUBLIC_URL = config('IPG_BASE_PUBLIC_URL')
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ from django.db import models
|
|||
from httpx import Request
|
||||
|
||||
from gooyal_wallet_client import AuthenticatedClient
|
||||
from gooyal_wallet_client.models import MyWallet, UserTransaction, ApplicationDeposit, ApplicationWithdraw
|
||||
from gooyal_wallet_client.api.wallet import (wallet_api_application_deposit_create_2,
|
||||
wallet_api_application_deposit_verify_retrieve_2,
|
||||
wallet_api_application_withdraw_create_2,
|
||||
wallet_api_application_withdraw_verify_retrieve_2)
|
||||
from gooyal_wallet_client.models import Transaction, Account, ApplicationDeposit, ApplicationWithdraw
|
||||
from gooyal_wallet_client.api.wallet import (wallet_api_application_deposit_create,
|
||||
wallet_api_application_deposit_verify_retrieve,
|
||||
wallet_api_application_withdraw_create,
|
||||
wallet_api_application_withdraw_verify_retrieve)
|
||||
from gooyal_wallet_client.types import Response
|
||||
|
||||
from django.conf import Settings
|
||||
|
|
@ -73,23 +73,23 @@ def get_client():
|
|||
return client
|
||||
|
||||
|
||||
def deposit_to_user_wallet_submit(category_uuid, data):
|
||||
def deposit_to_user_wallet_submit(payer_wallet, data):
|
||||
class Tmp():
|
||||
def to_dict(self):
|
||||
return data
|
||||
|
||||
deposit_data = Tmp()
|
||||
client = get_client()
|
||||
response: ApplicationDeposit = wallet_api_application_deposit_create_2.sync(category_uuid= category_uuid,
|
||||
response: ApplicationDeposit = wallet_api_application_deposit_create.sync(payer_wallet=payer_wallet,
|
||||
client=client,
|
||||
body=deposit_data)
|
||||
print(response)
|
||||
return response
|
||||
|
||||
|
||||
def deposit_to_user_wallet_verify(category_uuid, uuid):
|
||||
def deposit_to_user_wallet_verify(payer_wallet, uuid):
|
||||
client = get_client()
|
||||
response: ApplicationDeposit = wallet_api_application_deposit_verify_retrieve_2.sync(category_uuid=category_uuid, uuid=uuid, client=client)
|
||||
response: ApplicationDeposit = wallet_api_application_deposit_verify_retrieve.sync(payer_wallet=payer_wallet, uuid=uuid, client=client)
|
||||
print(response)
|
||||
return response
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue