Skip to content

feat(contractor): integrate payment-method and bank-account hooks into PaymentMethod#2303

Draft
serikjensen wants to merge 3 commits into
mainfrom
feat/contractor-payment-method-integration
Draft

feat(contractor): integrate payment-method and bank-account hooks into PaymentMethod#2303
serikjensen wants to merge 3 commits into
mainfrom
feat/contractor-payment-method-integration

Conversation

@serikjensen

Copy link
Copy Markdown
Member

Summary

  • Refactors the PaymentMethod component to compose useContractorPaymentMethodForm and useContractorBankAccountForm via composeSubmitHandler, replacing the old PaymentTypeForm / BankAccountForm internals.
  • Direct Deposit submits through the bank-account form (which creates/replaces the bank account and flips the contractor to Direct Deposit server-side); Check submits through the payment-method form. The masked account number is prefilled and sent as the keep-existing sentinel so an unchanged Direct Deposit preserves the account.
  • Adds a dedicated SCSS module to give the section full width.

Notes

Test plan

  • PaymentMethod component + both hook test suites pass (26/26)
  • npm run derive regenerates API report + docs

Made with Cursor

@serikjensen

Copy link
Copy Markdown
Member Author

@cursoragent you should be able to bring this one up to date with main. The PRs that is based on for the useContractorBankAccount and payment method hooks have been merged so you should be able to base the integration off of that

@cursor

cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown

The format check failed on commit 3c26a1e9 (the rebased commit), but I've already fixed this issue. The failure was due to a Prettier formatting problem in useContractorPaymentMethodForm.tsx where a union type wasn't formatted correctly.

What I did to fix it:

  1. Ran npm run format:check locally and identified the formatting issue
  2. Ran npm run format to fix it
  3. Committed the fix as 1b26295f chore: fix prettier formatting
  4. Pushed the fix to the branch

The latest commit on the branch is now 1b26295f, which includes the formatting fix. The CI should pass on the new commit once it runs. The formatting issue was a minor side effect of the rebase where the hook file from main had slightly different formatting that got adjusted during conflict resolution.

Open in Web Open in Cursor 

…Form hook

Migrate the Contractor PaymentMethod component from its monolithic inline-form
pattern to the hook-based architecture.

- Add useContractorPaymentMethodForm: a single headless hook for the combined
  payment-type + bank-account form, with value-aware excludeFields (Check hides
  and de-requires the bank fields) per the useContractorDetailsForm precedent.
- Rewrite PaymentMethod.tsx to BaseBoundaries + thin Root + SDKFormProvider,
  preserving the event surface (CREATED / UPDATED / DONE) and masked-account
  behavior.
- Harden pre-migration test coverage and add hook unit tests.
- Export the hook, schema, error codes, and fields from src/index.ts.
- Remove the now-unused PaymentTypeForm/BankAccountForm and inline schema.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor cursor Bot force-pushed the feat/contractor-payment-method-integration branch from 0f70708 to 3c26a1e Compare June 30, 2026 22:50
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.

2 participants