Skip to content
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

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

gitanjli525
Copy link
Contributor

@gitanjli525 gitanjli525 commented Dec 6, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

https://github.com/user-attachments/assets/0e7d786a-a922-48e0-b726-b9e6479ed1a7
image

Motivation and Context

How did you test it?

Where to test it?

  • INTEG
  • SANDBOX
  • PROD

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

@gitanjli525 gitanjli525 self-assigned this Dec 6, 2024
@gitanjli525 gitanjli525 requested a review from a team as a code owner December 6, 2024 09:39
Copy link

Review changes with  SemanticDiff

@gitanjli525 gitanjli525 linked an issue Dec 6, 2024 that may be closed by this pull request
@gitanjli525 gitanjli525 added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed core Status: issues related to core labels Dec 6, 2024
src/screens/OMPSwitch/ProfileSwitch.res Outdated Show resolved Hide resolved
src/screens/Connectors/ConnectorTableUtils.res Outdated Show resolved Hide resolved
src/screens/Connectors/ConnectorPaymentMethod.res Outdated Show resolved Hide resolved
src/entryPoints/HyperSwitchApp.res Outdated Show resolved Hide resolved
src/entryPoints/HyperSwitchApp.res Show resolved Hide resolved
@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add dev_ as prefix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated @JeevaRamu0104

@@ -94,6 +100,21 @@ let make = (~setCurrentStep, ~connector, ~setInitialValues, ~initialValues, ~isU
Nullable.null
}

React.useEffect(() => {
if paymentMethodsClone->Array.length > 0 {
Copy link
Collaborator

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")
Copy link
Collaborator

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

Copy link
Contributor Author

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) => {
Copy link
Collaborator

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(() => {
Copy link
Collaborator

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

Copy link
Contributor Author

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(() => {
Copy link
Collaborator

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]"
Copy link
Collaborator

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

@JeevaRamu0104 JeevaRamu0104 added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Status: issues related to core S-waiting-on-author Status: This PR is incomplete or needs to address review comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Enable cloning of payment methods
4 participants