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