-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix #287 #288
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these suggestios might be needed in order to work. Review them and let me know, please.
Thanks for your work @jerebtw!
src/index.ts
Outdated
@@ -220,7 +222,8 @@ function getPmtInf( | |||
); | |||
} | |||
|
|||
if (options?.checkBIC && !isValidBIC(item.bic)) { | |||
const bicOptional = PAIN_TYPES[painFormat] === "CstmrCdtTrfInitn"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const bicOptional = PAIN_TYPES[painFormat] === "CstmrCdtTrfInitn"; | |
const bicOptional = PAIN_TYPES[painFormat] === "CstmrDrctDbtInitn"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct, because then pain.001.001.03 and pain.001.003.03 will support optional bic and not pain.008.001.02 and pain.008.003.02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jerebtw, pain.001... are for credit transfers, and pain.008 are for direct debit, which is where bic is optional. That's why I think that the bic optional variable shouod be true if pain type is CstmrDrctDbtInitn (which are pain.008...) and not CstmrCdtTrfInitn (which are pain.001...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it even easier, I think credit transfers also allow bic optional, as this article says
Since February 2016, the ‘IBAN only’ rule has been in force, and makes SEPA payments even easier for consumers and corporates. When they make euro credit transfers or direct debits in SEPA, they are no longer asked to provide the BIC of the payer or payee because the IBAN is sufficient to process the transaction. PSPs can consult databases provided by various suppliers in order to link the IBAN to the BIC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks okay, I will change that and release a new version.
Co-authored-by: Daniel Reinón García <[email protected]>
This reverts commit a22e39d.
This reverts commit 7207fb4.
No description provided.