Skip to content

Commit

Permalink
refactor(payout): make BIC optional for SEPA txns
Browse files Browse the repository at this point in the history
  • Loading branch information
kashif-m committed Jul 23, 2024
1 parent d352b7b commit 6ecf4ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/CollectWidget.res
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,15 @@ let make = (
->React.array}
</div>
<div
className="flex flex-row items-center min-w-full m5 py-1.5 px-2.5 text-xs border border-solid border-blue-200 rounded bg-blue-50">
className="flex flex-row items-center min-w-full my-5 px-2.5 py-1.5 text-xs border border-solid border-blue-200 rounded bg-blue-50">
<img src={"merchantLogo"} alt="" className="h-3 w-auto mr-1.5" />
{React.string(
`Your funds will be deposited in the selected ${paymentMethod
->getPaymentMethodLabel
->String.toLowerCase}.`,
)}
</div>
<div className="flex m5 text-lg font-semibold w-full">
<div className="flex my-5 text-lg font-semibold w-full">
<button
onClick={_ => setSavedPMD(_ => None)}
disabled={submitted}
Expand Down
9 changes: 5 additions & 4 deletions src/Utilities/PaymentMethodCollectUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ let getPaymentMethodDataFieldLabel = (key: paymentMethodDataField): string =>
| ACHAccountNumber | BacsAccountNumber => "Account Number"
| BacsSortCode => "Sort Code"
| SepaIban => "International Bank Account Number (IBAN)"
| SepaBic => "Bank Identifier Code (BIC)"
| SepaBic => "Bank Identifier Code (Optional)"
| PixId => "Pix ID"
| PixBankAccountNumber => "Bank Account Number"
| PaypalMail => "Email"
Expand Down Expand Up @@ -347,7 +347,7 @@ let getPaymentMethodDataErrorString = (key: paymentMethodDataField, value): stri

let getPaymentMethodIcon = (paymentMethod: paymentMethod) =>
switch paymentMethod {
| Card => <Icon name="card-generic-line" size=20 />
| Card => <Icon name="default-card" size=20 />
| BankTransfer => <Icon name="bank" size=20 />
| Wallet => <Icon name="wallet-generic-line" size=20 />
}
Expand Down Expand Up @@ -619,7 +619,7 @@ let formPaymentMethodData = (
paymentMethodDataDict->getValue(SepaBankCity->getPaymentMethodDataFieldKey),
paymentMethodDataDict->getValue(SepaCountryCode->getPaymentMethodDataFieldKey),
) {
| (Some(iban), Some(bic), bankName, city, countryCode) =>
| (Some(iban), bic, bankName, city, countryCode) =>
switch [
SepaIban->getPaymentMethodDataFieldKey,
SepaBic->getPaymentMethodDataFieldKey,
Expand All @@ -629,7 +629,8 @@ let formPaymentMethodData = (
]->checkValidity(fieldValidityDict) {
| false => None
| true =>
let pmd = [(SepaIban, iban), (SepaBic, bic)]
let pmd = [(SepaIban, iban)]
let _ = bic->Option.map(bic => pmd->Array.push((SepaBic, bic)))
let _ = bankName->Option.map(bankName => pmd->Array.push((SepaBankName, bankName)))
let _ = city->Option.map(city => pmd->Array.push((SepaBankCity, city)))
let _ =
Expand Down

0 comments on commit 6ecf4ff

Please sign in to comment.