diff --git a/src/PaymentMethodCollectElement.res b/src/PaymentMethodCollectElement.res index b2037de00..517c67c7f 100644 --- a/src/PaymentMethodCollectElement.res +++ b/src/PaymentMethodCollectElement.res @@ -24,7 +24,7 @@ let make = (~integrateError, ~logger) => { React.useEffect(() => { let availablePM: array = [] let availablePMT: array = [] - let _ = options.enabledPaymentMethods->Array.map(pm => { + options.enabledPaymentMethods->Array.forEach(pm => { switch pm { | Card(_) => if !(availablePM->Array.includes(Card)) { diff --git a/src/Types/PaymentMethodCollectTypes.res b/src/Types/PaymentMethodCollectTypes.res index 5f860e697..8636e0cba 100644 --- a/src/Types/PaymentMethodCollectTypes.res +++ b/src/Types/PaymentMethodCollectTypes.res @@ -182,9 +182,9 @@ let decodePaymentMethodType = (json: JSON.t): option> = ->Dict.get("payment_method_types") ->Option.flatMap(JSON.Decode.array) ->Option.flatMap(pmts => { - let _ = pmts->Array.map(pmt => { + pmts->Array.forEach(pmt => { let payment_method_type = pmt->JSON.Decode.string - let _ = switch (payment_method, payment_method_type) { + switch (payment_method, payment_method_type) { | (Some("card"), Some(cardType)) => switch decodeCard(cardType) { | Some(card) => payment_methods->Array.push(Card(card)) diff --git a/src/Utilities/PaymentMethodCollectUtils.res b/src/Utilities/PaymentMethodCollectUtils.res index 347cfeb28..2a7bf9a93 100644 --- a/src/Utilities/PaymentMethodCollectUtils.res +++ b/src/Utilities/PaymentMethodCollectUtils.res @@ -578,8 +578,8 @@ let formPaymentMethodData = ( | false => None | true => let pmd = [(ACHRoutingNumber, routingNumber), (ACHAccountNumber, accountNumber)] - let _ = bankName->Option.map(bankName => pmd->Array.push((ACHBankName, bankName))) - let _ = city->Option.map(city => pmd->Array.push((ACHBankCity, city))) + bankName->Option.forEach(bankName => pmd->Array.push((ACHBankName, bankName))) + city->Option.forEach(city => pmd->Array.push((ACHBankCity, city))) Some(BankTransfer, BankTransfer(ACH), pmd) } | _ => None @@ -603,8 +603,8 @@ let formPaymentMethodData = ( | false => None | true => let pmd = [(BacsSortCode, sortCode), (BacsAccountNumber, accountNumber)] - let _ = bankName->Option.map(bankName => pmd->Array.push((BacsBankName, bankName))) - let _ = city->Option.map(city => pmd->Array.push((BacsBankCity, city))) + bankName->Option.forEach(bankName => pmd->Array.push((BacsBankName, bankName))) + city->Option.forEach(city => pmd->Array.push((BacsBankCity, city))) Some(BankTransfer, BankTransfer(Bacs), pmd) } | _ => None @@ -630,11 +630,10 @@ let formPaymentMethodData = ( | false => None | true => 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 _ = - countryCode->Option.map(countryCode => pmd->Array.push((SepaCountryCode, countryCode))) + bic->Option.forEach(bic => pmd->Array.push((SepaBic, bic))) + bankName->Option.forEach(bankName => pmd->Array.push((SepaBankName, bankName))) + city->Option.forEach(city => pmd->Array.push((SepaBankCity, city))) + countryCode->Option.forEach(countryCode => pmd->Array.push((SepaCountryCode, countryCode))) Some(BankTransfer, BankTransfer(Sepa), pmd) } | _ => None @@ -656,7 +655,7 @@ let formBody = (flow: paymentMethodCollectFlow, paymentMethodData: paymentMethod let (paymentMethod, paymentMethodType, fields) = paymentMethodData let pmdApiFields = [] - let _ = fields->Array.map(field => { + fields->Array.forEach(field => { let (key, value) = field switch key { // Card diff --git a/src/Utilities/Utils.res b/src/Utilities/Utils.res index 7a6490c65..305df1d28 100644 --- a/src/Utilities/Utils.res +++ b/src/Utilities/Utils.res @@ -1095,8 +1095,7 @@ let rec flatten = (obj, addIndicatorForObject) => { let arrayArray = [] dictArray->Array.forEachWithIndex((item, index) => { switch item->JSON.Classify.classify { - | String(_str) => - let _ = stringArray->Array.push(item) + | String(_str) => stringArray->Array.push(item) | Object(_obj) => { let flattenedSubObj = flatten(item, addIndicatorForObject) flattenedSubObj @@ -1109,8 +1108,7 @@ let rec flatten = (obj, addIndicatorForObject) => { ) } - | _ => - let _ = arrayArray->Array.push(item) + | _ => arrayArray->Array.push(item) } }) if stringArray->Array.length > 0 {