#george_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1260201758479749230
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hello. Thank you ๐
Not sure I follow. Can you component not accept a stripe prop that is just a loadStripe instance?
The component can accept that prop
But the goal is to export this component from a UI kit library so consumers could easily import a checkout page our company's products easily when using different stripe accounts like so:
UI Library
export { BillingCheckout } from './'
Team A
import { BillingCheckout } from 'ui-kit'
const App = () => {
...
<BillingCheckout key='pk-stripe-account-1' />
...
}
Team B
import { BillingCheckout } from 'ui-kit'
const App = () => {
...
<BillingCheckout key='pk-stripe-account-2' />
...
}
Ideally loadStripe is handled within the UI library and not within consumer
Hope it makes sense, happy to share more info
Something like this will work: https://github.com/vercel/next.js/blob/canary/examples/with-stripe-typescript/app/components/CheckoutForm.tsx
getStripe() is just a wrapper around loadStripe, so you can forward your key prop to that: https://github.com/vercel/next.js/blob/canary/examples/with-stripe-typescript/utils/get-stripejs.ts
Didn't know about that. Sure, I'll try, thanks for the suggestion