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

[canada] - bank_code_length 4 -> 3 #250

Merged
merged 3 commits into from
Aug 6, 2024
Merged

[canada] - bank_code_length 4 -> 3 #250

merged 3 commits into from
Aug 6, 2024

Conversation

piiraa
Copy link
Contributor

@piiraa piiraa commented Aug 5, 2024

The changes permit the input of CA details using a 3-digit bank code.

This should not affect the underlying systems, as the previous value is still accepted (4 digits). Additionally, the pseudo_iban_bank_code_length ensures that the returned value remains 4 digits long.

iban1 = Ibandit::IBAN.new(country_code: 'CA', bank_code: '0036', branch_code: '00063', account_number: '0123456')
=> #<Ibandit::IBAN:0x0000000104c99f78
 @account_number="0123456",
 @bank_code="0036",
 @branch_code="00063",
 @country_code="CA",
 @errors={},
 @iban=nil,
 @source=:local_details,
 @swift_account_number="0123456",
 @swift_bank_code="0036",
 @swift_branch_code="00063">
 
iban2 = Ibandit::IBAN.new(country_code: 'CA', bank_code: '036', branch_code: '00063', account_number: '0123456')
=> #<Ibandit::IBAN:0x0000000104c978b8
 @account_number="0123456",
 @bank_code="0036",
 @branch_code="00063",
 @country_code="CA",
 @errors={},
 @iban=nil,
 @source=:local_details,
 @swift_account_number="0123456",
 @swift_bank_code="0036",
 @swift_branch_code="00063">
 
iban1.pseudo_iban == iban2.pseudo_iban
=> true

iban1.bank_code
=> "0036"

iban2.bank_code
=> "0036"

@piiraa piiraa force-pushed the ca-bank-code-length branch from 17ba78e to bb2bb05 Compare August 5, 2024 16:52
@piiraa piiraa force-pushed the ca-bank-code-length branch from bb2bb05 to 7dc2c7b Compare August 6, 2024 07:23
@piiraa piiraa marked this pull request as ready for review August 6, 2024 07:36
@piiraa piiraa requested review from JoeSouthan and a team August 6, 2024 07:36
@piiraa piiraa merged commit 93f8a82 into master Aug 6, 2024
4 checks passed
@piiraa piiraa deleted the ca-bank-code-length branch August 6, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants