-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23618 - Handling feedback for EFT Refunds (#1769)
- Loading branch information
1 parent
b72aaec
commit 726b002
Showing
6 changed files
with
298 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,11 +20,11 @@ | |
from datetime import datetime, timezone | ||
|
||
from pay_api.models import ( | ||
CfsAccount, DistributionCode, Invoice, InvoiceReference, Payment, PaymentAccount, PaymentLineItem, | ||
PaymentTransaction, Receipt, Refund, RoutingSlip, Statement, StatementInvoices, StatementSettings) | ||
CfsAccount, DistributionCode, EFTRefund, EFTShortnames, Invoice, InvoiceReference, Payment, PaymentAccount, | ||
PaymentLineItem, PaymentTransaction, Receipt, Refund, RoutingSlip, Statement, StatementInvoices, StatementSettings) | ||
from pay_api.utils.enums import ( | ||
CfsAccountStatus, InvoiceReferenceStatus, InvoiceStatus, LineItemStatus, PaymentMethod, PaymentStatus, | ||
PaymentSystem, RoutingSlipStatus, TransactionStatus) | ||
CfsAccountStatus, DisbursementStatus, EFTShortnameRefundStatus, EFTShortnameType, InvoiceReferenceStatus, | ||
InvoiceStatus, LineItemStatus, PaymentMethod, PaymentStatus, PaymentSystem, RoutingSlipStatus, TransactionStatus) | ||
|
||
|
||
def factory_premium_payment_account(bcol_user_id='PB25020', bcol_account_id='1234567890', auth_account_id='1234'): | ||
|
@@ -155,6 +155,38 @@ def factory_payment_transaction(payment_id: int): | |
transaction_start_time=datetime.now()).save() | ||
|
||
|
||
def factory_create_eft_shortname(short_name: str, short_name_type: str = EFTShortnameType.EFT.value): | ||
"""Return Factory.""" | ||
short_name = EFTShortnames( | ||
short_name=short_name, | ||
type=short_name_type | ||
).save() | ||
return short_name | ||
|
||
|
||
def factory_create_eft_refund( | ||
cas_supplier_number: str = '1234', | ||
comment: str = 'Test Comment', | ||
refund_amount: float = 100.0, | ||
refund_email: str = '[email protected]', | ||
short_name_id: int = 1, | ||
status: str = EFTShortnameRefundStatus.APPROVED.value, | ||
disbursement_status_code: str = DisbursementStatus.ACKNOWLEDGED.value | ||
): | ||
"""Return Factory.""" | ||
eft_refund = EFTRefund( | ||
cas_supplier_number=cas_supplier_number, | ||
comment=comment, | ||
disbursement_status_code=disbursement_status_code, | ||
refund_amount=refund_amount, | ||
refund_email=refund_email, | ||
short_name_id=short_name_id, | ||
status=status, | ||
created_on=datetime.now(tz=timezone.utc) | ||
).save() | ||
return eft_refund | ||
|
||
|
||
def factory_create_eft_account(auth_account_id='1234', status=CfsAccountStatus.ACTIVE.value, | ||
cfs_account='1234'): | ||
"""Return Factory.""" | ||
|
Oops, something went wrong.