Skip to content

Commit

Permalink
Add paymentMethodConfiguration property to the ConnectPaymentMethodSe…
Browse files Browse the repository at this point in the history
…ttings component (#106)

* Add paymentMethodConfiguration property to the ConnectPaymentMethodSettings component

* Bump connect-js package versions

* Empty-Commit

* Update yarn.lock with updated versions of @stripe/connect-js@beta
  • Loading branch information
ianharris-stripe authored Aug 8, 2024
1 parent bd80a60 commit 6892801
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@babel/preset-react": "7.18.6",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-replace": "^2.3.1",
"@stripe/connect-js": "3.3.14-beta-1",
"@stripe/connect-js": "3.3.15-beta-1",
"@types/jest": "^24.0.25",
"@types/react": "^16.8.0",
"@types/react-dom": "^16.8.0",
Expand Down Expand Up @@ -84,7 +84,7 @@
"zx": "^4.2.0"
},
"peerDependencies": {
"@stripe/connect-js": ">=3.3.13-beta-1",
"@stripe/connect-js": ">=3.3.15-beta-1",
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
}
Expand Down
11 changes: 10 additions & 1 deletion src/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,22 @@ export const ConnectAccountOnboarding = ({
};

export const ConnectPaymentMethodSettings = ({
paymentMethodConfiguration,
onLoadError,
onLoaderStart,
}: CommonComponentProps): JSX.Element => {
}: {
paymentMethodConfiguration?: string;
} & CommonComponentProps): JSX.Element => {
const {wrapper, component: paymentMethodSettings} = useCreateComponent(
'payment-method-settings'
);

useUpdateWithSetter(
paymentMethodSettings,
paymentMethodConfiguration,
(comp, val) => comp.setPaymentMethodConfiguration(val)
);

useUpdateWithSetter(paymentMethodSettings, onLoaderStart, (comp, val) => {
comp.setOnLoaderStart(val);
});
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1454,10 +1454,10 @@
dependencies:
"@sinonjs/commons" "^3.0.0"

"@stripe/connect-js@3.3.14-beta-1":
version "3.3.14-beta-1"
resolved "https://registry.yarnpkg.com/@stripe/connect-js/-/connect-js-3.3.14-beta-1.tgz#009d254fed2209779ff595d5618a344dfe8e0e79"
integrity sha512-RYy3idMTSACWFe2NxJhrytAARsMTJZz5CrLREMXO4MKSb29awpQdcEHGG2N7Qg2LuoomAwJ9eJESvz2YiZLN2w==
"@stripe/connect-js@3.3.15-beta-1":
version "3.3.15-beta-1"
resolved "https://registry.yarnpkg.com/@stripe/connect-js/-/connect-js-3.3.15-beta-1.tgz#6b9f1e2f28dc6d7de5266cea9e51669a88084d72"
integrity sha512-kGmShz5Vdh016AELGcJkYXViErd5ULGAcpZ7wJ7N3sAEmHEPFV2dlyCWmnO3RFzWb6su1K4gzZ3BeC525xzqKw==

"@tootallnate/once@2":
version "2.0.0"
Expand Down

0 comments on commit 6892801

Please sign in to comment.