Closed tiff-stripe closed 7 months ago
Adds support for passing the fetchClientSecret param to <EmbeddedCheckoutProvider>'s options prop.
fetchClientSecret
<EmbeddedCheckoutProvider>
options
Example usage:
import * as React from 'react'; import {loadStripe} from '@stripe/stripe-js'; import { EmbeddedCheckoutProvider, EmbeddedCheckout } from '@stripe/react-stripe-js'; const stripePromise = loadStripe('pk_test_123', {betas: ['embedded_checkout_beta_1']})); const App = ({createCheckoutSession}) => { const options = { fetchClientSecret: async () => { const clientSecret = await createCheckoutSession(); return clientSecret; } }; return ( <EmbeddedCheckoutProvider stripe={stripePromise} options={options} /> <EmbeddedCheckout /> </EmbeddedCheckoutProvider> ) }
Unit tests and manual testing locally.
Summary & motivation
Adds support for passing the
fetchClientSecret
param to<EmbeddedCheckoutProvider>
'soptions
prop.Example usage:
Testing & documentation
Unit tests and manual testing locally.