-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: enable payment methods cloning to another profile of same merchant #1875
base: main
Are you sure you want to change the base?
Conversation
config/config.toml
Outdated
@@ -54,6 +54,7 @@ x_feature_route=false | |||
tenant_user=false | |||
dev_click_to_pay=false | |||
dev_recon_v2_product=false | |||
clone_payment_methods=false |
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.
add dev_
as prefix
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.
updated @JeevaRamu0104
…center into clone-payment-methods-feature
@@ -94,6 +100,21 @@ let make = (~setCurrentStep, ~connector, ~setInitialValues, ~initialValues, ~isU | |||
Nullable.null | |||
} | |||
|
|||
React.useEffect(() => { | |||
if paymentMethodsClone->Array.length > 0 { |
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.
please recheck this condition
let json = await fetchDetails(connectorUrl) | ||
setInitialValues(_ => json) | ||
} catch { | ||
| _ => Exn.raiseError("Something went wrong") |
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.
what happens if the exception is throwed
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.
updated and showed a toast error in such case
@@ -1560,6 +1560,26 @@ let defaultSelectAllCards = ( | |||
} | |||
} | |||
|
|||
let setConnectorPaymentMethods = async (initialValues, setPaymentMethods, setMetaData) => { |
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.
Please write this function inside the clone module itself
} | ||
} | ||
|
||
React.useEffect(() => { |
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.
do we need this useEffect can we write everything inside the getConnectorDetails
function itself
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.
yeah moved
None | ||
}, [initialValues]) | ||
|
||
React.useEffect(() => { |
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.
same here
@@ -152,13 +157,15 @@ let make = () => { | |||
let customStyle = "text-blue-500 bg-white dark:bg-black hover:bg-jp-gray-100 text-nowrap w-full" | |||
let addItemBtnStyle = "border border-t-0 w-full" | |||
let customScrollStyle = "max-h-72 overflow-scroll px-1 pt-1 border border-b-0" | |||
let dropdownContainerStyle = "rounded-md border border-1 w-[15rem]" | |||
let dropdownContainerStyle = "rounded-md border border-1 w-[14rem] max-w-[20rem]" |
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.
please raise this as a separate PR
Type of Change
Description
https://github.com/user-attachments/assets/0e7d786a-a922-48e0-b726-b9e6479ed1a7
Motivation and Context
How did you test it?
Where to test it?
Checklist
npm run re:build