Skip to content

Commit

Permalink
stripe attempt #2: add missing await before loadStripe() call
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratchet7x5 committed Dec 12, 2024
1 parent f002fcc commit 8c82938
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/Dockerfile.auis
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ENV VITE_API_URL="https://auis-api.fly.dev"
ENV VITE_STRAPI_URL="https://auis-strapi.fly.dev"
ENV VITE_APP_URL="https://auis.fly.dev"
ENV VITE_APP_NAME="AUIS"
ENV VITE_STRIPE_PUBLISHABLE_KEY=pk_test_51PPclyP464csY2UpQPZ4cpWlyupAwPXfvWZRIG0zy9BhlYE8GmR4LYEytjFKOjMS6o5oXF5I0QMB8RWcc0TqsNxC00Nz3UAH14

# Mount secrets into Dockerfile and set environment variables
RUN yarn run build
Expand Down
3 changes: 2 additions & 1 deletion web/src/screens/CheckoutScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ const STRIPE_PUBLISHABLE_KEY = import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY;

// Make sure to call `loadStripe` outside of a component’s render to avoid
// recreating the `Stripe` object on every render.
const stripePromise = loadStripe(`${STRIPE_PUBLISHABLE_KEY}`);
const stripePromise = await loadStripe(`${STRIPE_PUBLISHABLE_KEY}`);
let bodyData: { priceId: string; userTicketId: number };

export default function CheckoutScreen() {
const location = useLocation();
// ensure data required for checkout is here
Expand Down

0 comments on commit 8c82938

Please sign in to comment.