✨ fix illimity
This commit is contained in:
parent
5e3fc9a9d3
commit
f3fa945345
@ -49,8 +49,8 @@ export default function SubscribeCheckoutTicket(props: IProps) {
|
||||
|
||||
const handleSubmitPayment = async () => {
|
||||
const stripeCheckout = {
|
||||
type: EType.Standard,
|
||||
nb_seats: numberOfCollaborators,
|
||||
type: forfeitType === EForfeitType.standard ? EType.Standard : EType.Unlimited,
|
||||
nb_seats: forfeitType === EForfeitType.standard ? numberOfCollaborators : 0,
|
||||
};
|
||||
|
||||
try {
|
||||
|
@ -10,12 +10,16 @@ import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||
import RadioBox from "@Front/Components/DesignSystem/RadioBox";
|
||||
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
||||
import useOpenable from "@Front/Hooks/useOpenable";
|
||||
import { EType } from "le-coffre-resources/dist/Admin/Subscription";
|
||||
import Stripe from "@Front/Api/LeCoffreApi/Admin/Stripe/Stripe";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
type IProps = {
|
||||
hasNavTab?: boolean;
|
||||
};
|
||||
export default function SubscribeIllimityComponent({ hasNavTab = true }: IProps) {
|
||||
const { close, isOpen, open } = useOpenable();
|
||||
const router = useRouter();
|
||||
|
||||
const formatFloat = (value: number) => {
|
||||
return value.toFixed(2).replace(".", ",");
|
||||
@ -32,6 +36,18 @@ export default function SubscribeIllimityComponent({ hasNavTab = true }: IProps)
|
||||
setPaymentFrequency(parseInt(e.target.value) as EPaymentFrequency);
|
||||
};
|
||||
|
||||
const handleSubmitPayment = async () => {
|
||||
const stripeCheckout = {
|
||||
type: EType.Unlimited,
|
||||
nb_seats: 0,
|
||||
};
|
||||
|
||||
try {
|
||||
const newStripeCheckout = await Stripe.getInstance().post(stripeCheckout);
|
||||
router.push(newStripeCheckout.url);
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<DefaultTemplate title="Nouvelle souscription" hasBackArrow>
|
||||
@ -122,7 +138,7 @@ export default function SubscribeIllimityComponent({ hasNavTab = true }: IProps)
|
||||
Voir le récapitulatif plus en détail
|
||||
</Button>
|
||||
</div>
|
||||
<div className={classes["payment-button"]}>
|
||||
<div className={classes["payment-button"]} onClick={handleSubmitPayment}>
|
||||
<Button fullwidth>{hasNavTab ? "Passer au paiement" : "Mettre à jour l'abonnement"}</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user