Skip to content

Commit

Permalink
Fix unlocking account
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-barraza committed Jan 22, 2024
1 parent 39b96f4 commit 4ea8cf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions pay-api/src/pay_api/services/payment_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,7 @@ def create_account_event_payload(self, event_type: str, nsf_object: dict = None,
if event_type == MessageType.NSF_UNLOCK_ACCOUNT.value:
payload['data']['invoiceNumber'] = nsf_object.payment.invoice_number
payload['data']['paymentMethodDescription'] = nsf_object.payment.payment_method_code
payload['data']['filingIdentifier'] = nsf_object.filing_identifier
payload['data']['receiptNumber'] = nsf_object.receipt_number
payload['data']['receiptNumber'] = nsf_object.payment.receipt_number
if event_type == MessageType.PAD_ACCOUNT_CREATE.value:
payload['data']['padTosAcceptedBy'] = self.pad_tos_accepted_by
if include_pay_info:
Expand All @@ -806,7 +805,7 @@ def create_account_event_payload(self, event_type: str, nsf_object: dict = None,
return payload

@staticmethod
def unlock_frozen_accounts(payment: Payment, filing_identifier: str, receipt_number: str):
def unlock_frozen_accounts(payment: Payment):
"""Unlock frozen accounts."""
pay_account: PaymentAccount = PaymentAccount.find_by_id(payment.payment_account_id)
if pay_account.cfs_account_status == CfsAccountStatus.FREEZE.value:
Expand All @@ -821,9 +820,7 @@ def unlock_frozen_accounts(payment: Payment, filing_identifier: str, receipt_num
# get nsf payment object associated with this payment

nsf_object = {
'payment': payment,
'filing_identifier': filing_identifier,
'receipt_number': receipt_number
'payment': payment
}

payload = pay_account.create_account_event_payload(
Expand Down
2 changes: 1 addition & 1 deletion pay-api/src/pay_api/services/payment_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def update_transaction(transaction_id: uuid, # pylint: disable=too-many-locals
active_failed_payments = Payment.get_failed_payments(auth_account_id=payment_account.auth_account_id)
current_app.logger.info('active_failed_payments %s', active_failed_payments)
if not active_failed_payments:
PaymentAccount.unlock_frozen_accounts(payment, invoice.filing_id, receipt_details)
PaymentAccount.unlock_frozen_accounts(payment)

transaction = PaymentTransaction.__wrap_dao(transaction_dao)

Expand Down

0 comments on commit 4ea8cf0

Please sign in to comment.