Skip to content

Commit

Permalink
add in conditional update
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 committed Feb 1, 2024
1 parent 7766261 commit 3b41139
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pay-api/src/pay_api/services/payment_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ def _save_account(cls, account_request: Dict[str, any], payment_account: Payment
from pay_api.factory.payment_system_factory import PaymentSystemFactory

payment_account.auth_account_id = account_request.get('accountId')
payment_account.branch_name = account_request.get('branchName')

# If the payment method is CC, set the payment_method as DIRECT_PAY
if payment_method := get_str_by_path(account_request, 'paymentInfo/methodOfPayment'):
Expand All @@ -448,6 +447,9 @@ def _save_account(cls, account_request: Dict[str, any], payment_account: Payment
if name := account_request.get('accountName', None):
payment_account.name = name

if branch_name := account_request.get('branchName', None):
payment_account.branch_name = branch_name

if pad_tos_accepted_by := account_request.get('padTosAcceptedBy', None):
payment_account.pad_tos_accepted_by = pad_tos_accepted_by
payment_account.pad_tos_accepted_date = datetime.now()
Expand Down

0 comments on commit 3b41139

Please sign in to comment.