From ee92d0925165706811574ecea480c3b455f41855 Mon Sep 17 00:00:00 2001 From: "aritro.ghosh" Date: Mon, 11 Nov 2024 18:19:58 +0530 Subject: [PATCH] chore: add dynamic fields support for multiple bank tranfers --- src/Payments/PaymentMethodsRecord.res | 49 +++++++++++++++++++++++++++ src/Utilities/DynamicFieldsUtils.res | 7 ++++ src/Utilities/PaymentBody.res | 12 ++++++- 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/Payments/PaymentMethodsRecord.res b/src/Payments/PaymentMethodsRecord.res index 15cbfee7..7fa011c3 100644 --- a/src/Payments/PaymentMethodsRecord.res +++ b/src/Payments/PaymentMethodsRecord.res @@ -534,6 +534,55 @@ let paymentMethodsFields = [ fields: [InfoElement], miniIcon: None, }, + { + paymentMethodName: "permata_bank_transfer_transfer", + icon: Some(icon("boleto", ~size=21, ~width=25)), + displayName: "Permata Bank", + fields: [InfoElement], + miniIcon: None, + }, + { + paymentMethodName: "bca_bank_transfer_transfer", + icon: Some(icon("boleto", ~size=21, ~width=25)), + displayName: "BCA Bank", + fields: [InfoElement], + miniIcon: None, + }, + { + paymentMethodName: "bni_va_transfer", + icon: Some(icon("boleto", ~size=21, ~width=25)), + displayName: "BNI VA", + fields: [InfoElement], + miniIcon: None, + }, + { + paymentMethodName: "bri_va_transfer", + icon: Some(icon("boleto", ~size=21, ~width=25)), + displayName: "BRI VA", + fields: [InfoElement], + miniIcon: None, + }, + { + paymentMethodName: "cimb_va_transfer", + icon: Some(icon("boleto", ~size=21, ~width=25)), + displayName: "CIMB VA", + fields: [InfoElement], + miniIcon: None, + }, + { + paymentMethodName: "danamon_va_transfer", + icon: Some(icon("boleto", ~size=21, ~width=25)), + displayName: "Danamon VA", + fields: [InfoElement], + miniIcon: None, + }, + { + paymentMethodName: "mandiri_va_transfer", + icon: Some(icon("boleto", ~size=21, ~width=25)), + displayName: "Mandiri VA", + fields: [InfoElement], + miniIcon: None, + }, { paymentMethodName: "local_bank_transfer_transfer", fields: [InfoElement], diff --git a/src/Utilities/DynamicFieldsUtils.res b/src/Utilities/DynamicFieldsUtils.res index ef254da5..4d6f9a69 100644 --- a/src/Utilities/DynamicFieldsUtils.res +++ b/src/Utilities/DynamicFieldsUtils.res @@ -25,6 +25,13 @@ let dynamicFieldsEnabledPaymentMethods = [ "bacs", "pay_bright", "multibanco_transfer", + "permata_bank_transfer_transfer", + "bca_bank_transfer_transfer", + "bni_va_transfer", + "bri_va_transfer", + "cimb_va_transfer", + "danamon_va_transfer", + "mandiri_va_transfer", ] let getName = (item: PaymentMethodsRecord.required_fields, field: RecoilAtomTypes.field) => { diff --git a/src/Utilities/PaymentBody.res b/src/Utilities/PaymentBody.res index 3774f02a..f5c436f0 100644 --- a/src/Utilities/PaymentBody.res +++ b/src/Utilities/PaymentBody.res @@ -884,7 +884,17 @@ let appendRedirectPaymentMethods = [ ] let appendBankeDebitMethods = ["sepa"] -let appendBankTransferMethods = ["sepa", "ach", "bacs", "multibanco"] +let appendBankTransferMethods = [ + "sepa", + "ach", + "bacs", + "multibanco", + "bni_va", + "bri_va", + "cimb_va", + "danamon_va", + "mandiri_va", +] let getPaymentMethodSuffix = (~paymentMethodType, ~paymentMethod, ~isQrPaymentMethod) => { if isQrPaymentMethod {