Mauricio Araujo před 2 roky
rodič
revize
6c4c823f52

+ 4 - 4
dashboard/src/main/home/modals/PaymentSetupForm.tsx

@@ -5,7 +5,7 @@ import SaveButton from "components/SaveButton";
 import styled from "styled-components";
 import Error from "components/porter/Error";
 
-const PaymentSetupForm = ({ project_id, onCreate }) => {
+const PaymentSetupForm = ({ projectId, onCreate }: { projectId: number, onCreate: () => void, }) => {
     const stripe = useStripe();
     const elements = useElements();
 
@@ -14,7 +14,7 @@ const PaymentSetupForm = ({ project_id, onCreate }) => {
 
     const handleSubmit = async () => {
         if (!stripe || !elements) {
-            return null;
+            return;
         }
 
         setLoading(true);
@@ -28,7 +28,7 @@ const PaymentSetupForm = ({ project_id, onCreate }) => {
 
         // Create the setup intent in the server
         const resp = await api
-            .addPaymentMethod("<token>", {}, { project_id })
+            .addPaymentMethod("<token>", {}, { project_id: projectId })
 
         // Finally, confirm with Stripe so the payment method is saved
         const clientSecret = resp.data.clientSecret;
@@ -59,4 +59,4 @@ export default PaymentSetupForm;
 
 const SubmitButton = styled(SaveButton)`
   position: initial;
-`;
+`;

+ 1 - 2
dashboard/src/main/home/project-settings/BillingPage.tsx

@@ -35,7 +35,6 @@ function BillingPage() {
         onCreate={() => setShouldCreate(false)}
         back={() => setShouldCreate(false)}
         project_id={currentProject?.id}
-        defaultValues={null}
       />
     );
   }
@@ -159,4 +158,4 @@ const DeleteButtonContainer = styled.div`
   width: 20%;
   text-align: right;
   margin-top: 12px;
-`;
+`;

+ 1 - 1
zarf/helm/.dashboardenv

@@ -21,4 +21,4 @@ API_SERVER=http://localhost:8080
 TRUST_ARN=arn:aws:iam::MY_AWS_DEV_ACCOUNT_ID:role/CAPIManagement
 
 # STRIPE_PUBLISHABLE_KEY is used to create Stripe Web Elements
-STRIPE_PUBLISHABLE_KEY=
+STRIPE_PUBLISHABLE_KEY=