Closed amreda closed 3 years ago
The docs look like they're out of date, stripe
now expects the stripe key instead of the stripe promise
Exactly. The example is out of date. For anyone getting the same error, pass the following values to CartProvider :
<CartProvider
mode="payment"
cartMode="client-only"
stripe={YOUR_STRIPE_API_KEY_GOES_HERE}
successUrl="stripe.com"
cancelUrl="twitter.com/dayhaysoos"
currency="USD"
allowedCountries={['US', 'GB', 'CA']}
billingAddressCollection={true}
>
You no longer need const stripePromise = loadStripe(process.env.GATSBY_STRIPE_PUBLISHABLE_KEY)
I get the following errors whenever calling
addItem()
,redirectToCheckout()
, andclearCart()
as used in the example code: