Skip to content

Conversation

jbasa-stripe
Copy link
Contributor

@jbasa-stripe jbasa-stripe commented Oct 6, 2025

Summary & motivation

Adds a new React component, FinancialAccountDisclosure, that users can use to add the compulsory disclosure text detailing our Financial Account (FA) for platforms product (fka Treasury), the banking partners we work with, and information about FDIC insurance.

Testing & documentation

I tested this change by creating a new local testing file in examples/hooks and running yarn run storybook

I also wrote tests in src/components/FinancialAccountDisclosure.test.tsx that I ran with yarn jest


if (onLoad) {
onLoad();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be called once disclosurePromise resolves without error (e.g., line 109)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't the promise then already be loaded? I specifically broke up the instantiation of the call to createFinancialAccountDisclosure and awaiting said call so that I could call onLoad when the component was actually doing loading. If I didn't want to capture the exact loading state, I would have instead simply just written:

const {htmlElement: disclosureContent, error} = await (stripeState as any).createFinancialAccountDisclosure( options ); 
Copy link
Contributor Author

@jbasa-stripe jbasa-stripe Oct 6, 2025

Choose a reason for hiding this comment

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

Brian and I chatted about this. The onLoad function is typically called when an object has already been loaded, not when it's loading (W3 docs example).

};

createDisclosure();
}, [stripeState, options, onLoad, onError]);
Copy link
Contributor

Choose a reason for hiding this comment

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

should use the specific option values in the dependency array, like options.businessName and options.learnMoreLink, so that this doesn't trigger the createFinancialAccountDisclosure call unless the options actually change.

@bmathews-stripe bmathews-stripe merged commit 17d95c8 into stripe:master Oct 6, 2025
2 checks passed
@jbasa-stripe jbasa-stripe deleted the jbasa/add-fa-for-platforms-disclosure-component branch October 6, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants