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: Add ACH payment method #3616

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

feat: Add ACH payment method #3616

wants to merge 7 commits into from

Conversation

suejung-sentry
Copy link
Contributor

@suejung-sentry suejung-sentry commented Dec 31, 2024

This PR adds a secondary payment method flow for ACH.

  • Updates the View state to show Primary and Secondary payment methods, and in columns instead of rows
  • Updates the Edit state to a new form with tabs and sections for the 2 payment methods
  • Cuts over from the existing Stripe CardElement to their PaymentElement. Note that the PaymentElement requires a clientSecret from api which establishes a Stripe setupIntent

Remaining TODO

  • fix dark mode
  • implement in api the setup intent flow
  • "Address same as the primary payment method" checkbox
  • Fix/ write tests
  • Handle to allow only admins to take certain actions

Figma: https://www.figma.com/design/ftdTGGX43YyurDlxPCLTFy/GH-2621?node-id=1-2&p=f&t=lQMWI0ok827VpgVr-0

Closes codecov/engineering-team#3108

Screenshot 2025-01-01 at 8 49 47 PM Screenshot 2025-01-01 at 8 50 48 PM

Copy link

sentry-io bot commented Dec 31, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: src/services/navigation/useNavLinks/useNavLinks.ts

Function Unhandled Issue
useNavLinks TypeError: Cannot read properties of undefined (reading 'match') /gh/docker/cli/commit/0f058041c4775b17b65fbb48...
Event Count: 3 Affected Users: 123

Did you find this useful? React with a 👍 or 👎

@codecov-staging
Copy link

codecov-staging bot commented Dec 31, 2024

❌ 16 Tests Failed:

Tests completed Failed Passed Skipped
4102 16 4086 0
View the top 3 failed tests by shortest run time
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when there is an error in the form > renders the error
Stack Traces | 0.00244s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="edit-address"]

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:365:31
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when the user clicks on Edit > doesn't render the card anymore
Stack Traces | 0.00293s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="edit-address"]

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:266:31
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when the user has an address > renders the card holder information
Stack Traces | 0.00295s run time
TestingLibraryElementError: Unable to find an element with the text: /Cardholder name/. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:244:21

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Dec 31, 2024

❌ 16 Tests Failed:

Tests completed Failed Passed Skipped
3461 16 3445 2
View the top 3 failed tests by shortest run time
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when there is an error in the form > renders the error
Stack Traces | 0.0023s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="edit-address"]

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:365:31
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when the user has an address > renders the card holder information
Stack Traces | 0.00309s run time
TestingLibraryElementError: Unable to find an element with the text: /Cardholder name/. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:244:21
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when the user clicks on Edit > doesn't render the card anymore
Stack Traces | 0.0031s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="edit-address"]

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:266:31

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Dec 31, 2024

❌ 16 Tests Failed:

Tests completed Failed Passed Skipped
3463 16 3447 0
View the top 3 failed tests by shortest run time
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when there is an error in the form > renders the error
Stack Traces | 0.0023s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="edit-address"]

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:365:31
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when the user has an address > renders the card holder information
Stack Traces | 0.00309s run time
TestingLibraryElementError: Unable to find an element with the text: /Cardholder name/. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:244:21
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when the user clicks on Edit > doesn't render the card anymore
Stack Traces | 0.0031s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="edit-address"]

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:266:31

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link

codecov-public-qa bot commented Dec 31, 2024

❌ 16 Tests Failed:

Tests completed Failed Passed Skipped
3463 16 3447 0
View the top 3 failed tests by shortest run time
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when there is an error in the form > renders the error
Stack Traces | 0.0023s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="edit-address"]

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:365:31
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when the user has an address > renders the card holder information
Stack Traces | 0.00309s run time
TestingLibraryElementError: Unable to find an element with the text: /Cardholder name/. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:244:21
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/Address/AddressCard.test.tsx > AddressCard > when the user clicks on Edit > doesn't render the card anymore
Stack Traces | 0.0031s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="edit-address"]

Ignored nodes: comments, script, style
<body
  class="light"
>
  <div>
    <div
      class="flex gap-2"
    >
      <div>
        <h4
          class="mb-2 font-semibold"
        >
          Billing address
        </h4>
        <p>
          123 Sesame St. Apt A
        </p>
        <p>
          San Francisco, 
          CA 12345
        </p>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../BillingDetails/Address/AddressCard.test.tsx:266:31

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@aj-codecov
Copy link
Contributor

@codecov-ai-reviewer review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Gazebo] Update the Billing / Plan Page to fit the new Figma Design
2 participants