wip
This commit is contained in:
parent
583575f5ea
commit
f798035a17
|
@ -112,6 +112,17 @@ const PlansSlider = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const manageSubscription = async () => {
|
||||||
|
try {
|
||||||
|
const response = await accountsService.post("stripe/billing");
|
||||||
|
console.log(response);
|
||||||
|
debugger;
|
||||||
|
} catch (error) {
|
||||||
|
setShowPaymentError(true);
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full mb-24">
|
<div className="w-full mb-24">
|
||||||
<Metadata>
|
<Metadata>
|
||||||
|
@ -162,11 +173,9 @@ const PlansSlider = () => {
|
||||||
<div className="text-center my-6">
|
<div className="text-center my-6">
|
||||||
{(!hasActivePlan || isHigherThanCurrent) &&
|
{(!hasActivePlan || isHigherThanCurrent) &&
|
||||||
(isCurrentPlanPaid ? (
|
(isCurrentPlanPaid ? (
|
||||||
<form method="post" action="/api/stripe/billing">
|
<Button $primary onClick={manageSubscription}>
|
||||||
<Button type="submit">
|
|
||||||
Upgrade
|
Upgrade
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
|
||||||
) : (
|
) : (
|
||||||
<Button $primary onClick={() => handleSubscribe(plan)}>
|
<Button $primary onClick={() => handleSubscribe(plan)}>
|
||||||
Upgrade
|
Upgrade
|
||||||
|
@ -174,11 +183,9 @@ const PlansSlider = () => {
|
||||||
))}
|
))}
|
||||||
{isCurrent && <Button disabled>Current</Button>}
|
{isCurrent && <Button disabled>Current</Button>}
|
||||||
{isLower && (
|
{isLower && (
|
||||||
<form method="post" action="/api/stripe/billing">
|
<Button $primary onClick={manageSubscription}>
|
||||||
<Button type="submit">
|
|
||||||
Choose
|
Choose
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{plan.limits && (
|
{plan.limits && (
|
||||||
|
|
Reference in New Issue