Changes
Co-authored-by: wolfoftyreso-debug <250630591+wolfoftyreso-debug@users.noreply.github.com>
This commit is contained in:
@@ -122,7 +122,7 @@ const PlansSection = () => {
|
|||||||
postal_code: result.data.postnummer,
|
postal_code: result.data.postnummer,
|
||||||
city: "Storstockholm",
|
city: "Storstockholm",
|
||||||
comments: result.data.kommentarer ?? "",
|
comments: result.data.kommentarer ?? "",
|
||||||
return_url: `${window.location.origin}/?checkout=success&session_id={CHECKOUT_SESSION_ID}`,
|
return_url: `${window.location.origin}/order-confirmation?session_id={CHECKOUT_SESSION_ID}&method=card&kg=${recommendedKg}&email=${encodeURIComponent(result.data.epost)}`,
|
||||||
environment: getStripeEnvironment(),
|
environment: getStripeEnvironment(),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -134,7 +134,8 @@ const PlansSection = () => {
|
|||||||
if (!(data as any)?.clientSecret) throw new Error("Kunde inte skapa checkout-session");
|
if (!(data as any)?.clientSecret) throw new Error("Kunde inte skapa checkout-session");
|
||||||
setClientSecret((data as any).clientSecret);
|
setClientSecret((data as any).clientSecret);
|
||||||
} else {
|
} else {
|
||||||
setSubmitted("invoice");
|
window.location.href = `/order-confirmation?method=invoice&kg=${recommendedKg}&email=${encodeURIComponent(result.data.epost)}`;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user