Skip to content

Commit

Permalink
Revert "stripe attempt #1: Refactor stripe key to be loaded in earlier"
Browse files Browse the repository at this point in the history
This reverts commit 6b86de3.
  • Loading branch information
Ratchet7x5 committed Dec 12, 2024
1 parent 6b86de3 commit f002fcc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion web/Dockerfile.auis
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ 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
7 changes: 4 additions & 3 deletions web/src/screens/CheckoutScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { useCallback } from "react";
import { loadStripe } from "@stripe/stripe-js";
import {
EmbeddedCheckoutProvider,
EmbeddedCheckout,
} from "@stripe/react-stripe-js";
import { useLocation } from "react-router";
import { stripeKey } from "../stripe/stripe";
import { fetchEventOrMembershipCheckoutSecret } from "../api/apiRequests";
import CheckoutError from "@components/checkout-page/CheckoutError";

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 = stripeKey;
const stripePromise = 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
7 changes: 0 additions & 7 deletions web/src/stripe/stripe.ts

This file was deleted.

0 comments on commit f002fcc

Please sign in to comment.