gotangible / pages / _app.jsx
_app.jsx
Raw
import "../styles/globals.css";
import { MoralisProvider } from "react-moralis";
import { CartProvider } from "use-shopping-cart";

function MyApp({ Component, pageProps }) {
  return (
    <MoralisProvider
      appId={process.env.NEXT_PUBLIC_APP_ID}
      serverUrl={process.env.NEXT_PUBLIC_SERVER_URL}
    >
      <CartProvider
        mode="payment"
        cartMode="checkout-session"
        stripe={process.env.NEXT_PUBLIC_STRIPE_API_KEY_TEST}
        successUrl={`${process.env.NEXT_PUBLIC_URL}?success=true`}
        cancelUrl={`${process.env.NEXT_PUBLIC_URL}?cancel=true`}
        currency="USD"
        allowedCountries={["US", "GB", "CA"]}
        billingAddressCollection={true}
      >
        <Component {...pageProps} />
      </CartProvider>
    </MoralisProvider>
  );
}

export default MyApp;