payments
This commit is contained in:
parent
e170be5aa8
commit
27968dd087
|
@ -41,7 +41,6 @@ export default async (req, res) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const customer = await getStripeCustomer(user, authorization);
|
const customer = await getStripeCustomer(user, authorization);
|
||||||
console.log(customer);
|
|
||||||
const session = await stripe.checkout.sessions.create({
|
const session = await stripe.checkout.sessions.create({
|
||||||
mode: "subscription",
|
mode: "subscription",
|
||||||
payment_method_types: ["card"],
|
payment_method_types: ["card"],
|
||||||
|
|
|
@ -2,7 +2,7 @@ import dayjs from "dayjs";
|
||||||
import Layout from "../components/Layout";
|
import Layout from "../components/Layout";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import ky from "ky/umd";
|
import ky from "ky/umd";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
const plans = [
|
const plans = [
|
||||||
{
|
{
|
||||||
|
@ -67,6 +67,12 @@ export default function Payments() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (activePlan && isPaidTier(activePlan.tier)) {
|
||||||
|
setSelectedPlan(activePlan);
|
||||||
|
}
|
||||||
|
}, [activePlan, selectedPlan, setSelectedPlan]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout title="Payments">
|
<Layout title="Payments">
|
||||||
<div className="bg-white rounded-lg shadow px-5 py-6 sm:px-6">
|
<div className="bg-white rounded-lg shadow px-5 py-6 sm:px-6">
|
||||||
|
|
Reference in New Issue