Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes on reconciliation #774

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions jobs/payment-jobs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-e git+https://github.com/bcgov/sbc-common-components.git@a7c5c1c589a958a78697288c240d38d5e1c352c0#egg=sbc_common_components&subdirectory=python
-e git+https://github.com/bcgov/sbc-pay.git@d735a9db20d6c9a6b67d4891eaec957dd5a6c711#egg=pay_api&subdirectory=pay-api
-e git+https://github.com/bcgov/sbc-pay.git@01f1390e8929d9416f3ea396b0b31f6db8f65635#egg=pay_api&subdirectory=pay-api
Flask-Caching==1.10.1
Flask-Migrate==2.7.0
Flask-Moment==1.0.2
Expand All @@ -25,27 +25,26 @@ blinker==1.4
cachelib==0.3.0
certifi==2021.5.30
cffi==1.14.6
charset-normalizer==2.0.4
charset-normalizer==2.0.5
click==7.1.2
croniter==1.0.15
cryptography==3.4.8
dpath==2.0.2
dpath==2.0.5
ecdsa==0.17.0
flask-jwt-oidc==0.3.0
flask-marshmallow==0.11.0
flask-restx==0.5.1
gunicorn==20.1.0
idna==3.2
importlib-resources==5.2.2
itsdangerous==1.1.0
jaeger-client==4.6.1
jaeger-client==4.8.0
jsonschema==3.2.0
marshmallow-sqlalchemy==0.25.0
marshmallow==3.13.0
minio==7.1.0
opentracing==2.4.0
paramiko==2.7.2
protobuf==3.17.3
protobuf==3.18.0
psycopg2-binary==2.9.1
pyasn1==0.4.8
pycparser==2.20
Expand All @@ -63,4 +62,3 @@ threadloop==1.0.2
thrift==0.13.0
tornado==6.1
urllib3==1.26.6
zipp==3.5.0
2 changes: 1 addition & 1 deletion jobs/payment-jobs/tasks/cfs_create_invoice_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _create_pad_invoices(cls): # pylint: disable=too-many-locals

try:
# Get the first invoice id as the trx number for CFS
invoice_response = CFSService.create_account_invoice(transaction_number=account_invoices[0].id,
invoice_response = CFSService.create_account_invoice(transaction_number=account_invoices[-1].id,
line_items=lines,
cfs_account=cfs_account)
except Exception as e: # NOQA # pylint: disable=broad-except
Expand Down
2 changes: 1 addition & 1 deletion pay-api/src/pay_api/services/bcol_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def create_invoice(self, payment_account: PaymentAccount, # pylint: disable=too
payload['userId'] = user.user_name_with_no_idp if user.is_staff() else current_app.config[
'BCOL_USERNAME_FOR_SERVICE_ACCOUNT_PAYMENTS']
payload['accountNumber'] = invoice.bcol_account
payload['formNumber'] = invoice.dat_number
payload['formNumber'] = invoice.dat_number or ''
payload['reduntantFlag'] = 'Y'
payload['rateType'] = 'C'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,16 @@ async def _process_consolidated_invoices(row):
filter(InvoiceReferenceModel.status_code == InvoiceReferenceStatus.ACTIVE.value). \
filter(InvoiceReferenceModel.invoice_number == inv_number). \
all()

payment_account: PaymentAccountModel = _get_payment_account(row)

if target_txn_status.lower() == Status.PAID.value.lower():
logger.debug('Fully PAID payment.')
if not inv_references:
logger.error('No invoice found for %s in the system, and cannot process %s.', inv_number, row)
capture_message('No invoice found for {invoice_number} in the system, and cannot process {row}.'
.format(invoice_number=inv_number, row=row), level='error')
return
await _process_paid_invoices(inv_references, row)
await _publish_mailer_events('PAD.PaymentSuccess', payment_account, row)
elif target_txn_status.lower() == Status.NOT_PAID.value.lower() \
Expand Down