Skip to content

Commit

Permalink
Skip over sending queue message for CSO payments. (#1067)
Browse files Browse the repository at this point in the history
* Skip over sending queue message for CSO payments.

* Lint error
  • Loading branch information
seeker25 authored Jan 23, 2023
1 parent 25f7216 commit 85514b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pay-api/src/pay_api/services/base_payment_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
from pay_api.services.invoice_reference import InvoiceReference
from pay_api.services.payment import Payment
from pay_api.services.payment_account import PaymentAccount
from pay_api.utils.enums import InvoiceReferenceStatus, InvoiceStatus, PaymentMethod, PaymentStatus, TransactionStatus
from pay_api.utils.enums import (
CorpType, InvoiceReferenceStatus, InvoiceStatus, PaymentMethod, PaymentStatus, TransactionStatus)
from pay_api.utils.user_context import UserContext
from pay_api.utils.util import get_local_formatted_date_time, get_pay_subject_name

Expand Down Expand Up @@ -141,6 +142,9 @@ def _release_payment(invoice: Invoice):
from .payment_transaction import PaymentTransaction # pylint:disable=import-outside-toplevel,cyclic-import
from .payment_transaction import publish_response # pylint:disable=import-outside-toplevel,cyclic-import

if invoice.corp_type_code == CorpType.CSO.value:
return

payload = PaymentTransaction.create_event_payload(invoice, TransactionStatus.COMPLETED.value)
try:
current_app.logger.info(f'Releasing record for invoice {invoice.id}')
Expand Down
1 change: 1 addition & 0 deletions pay-api/src/pay_api/utils/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class CorpType(Enum):
NRO = 'NRO'
PPR = 'PPR'
VS = 'VS'
CSO = 'CSO'


class DisbursementStatus(Enum):
Expand Down

0 comments on commit 85514b1

Please sign in to comment.