feat: payment card atom (#17203)

* init stripe payment card atom

* cleanup

* update platform libraries

* fix import paths

* add function to get user payment info

* fixup

* resolve merge conflicts

* fixup fixup

* resolve merge conflicts

* fixup

* update payments page

* add props for event payment success and failure

* update props and fixup

* bump platform libraries

* fixup! bump platform libraries

* fixup! fixup! bump platform libraries

* resolve merge conflicts

* fix: add isActive to paymentsTab

---------

Co-authored-by: Morgan <[email protected]>
Co-authored-by: Morgan Vernay <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-10-31 11:21:13 +02:00
1 parent a5806cb100
commit fee3b73bda
15 files changed
+602 -129

No files matched your search

@@ -93,7 +93,11 @@ export default function Bookings(props: { calUsername: string; calEmail: string
eventSlug={eventTypeSlug}
onCreateBookingSuccess={(data) => {
setBookingTitle(data.data.title ?? "");
router.push(`/${data.data.uid}`);
if (data.data.paymentRequired) {
router.push(`/payment/${data.data.paymentUid}`);
} else {
router.push(`/${data.data.uid}`);
}
}}
metadata={{ CustomKey: "CustomValue" }}
duration={eventTypeDuration}
@@ -0,0 +1,30 @@
import { Navbar } from "@/components/Navbar";
import { Inter } from "next/font/google";
import { usePathname } from "next/navigation";
import { useRouter } from "next/navigation";
import { PaymentForm } from "@calcom/atoms";
const inter = Inter({ subsets: ["latin"] });
export default function Payment(props: { calUsername: string; calEmail: string }) {
const pathname = usePathname();
const router = useRouter();
const uid = pathname.split("/").pop();
return (
<main className={`flex min-h-screen flex-col ${inter.className}`}>
<Navbar username={props.calUsername} />
<PaymentForm
paymentUid={uid ?? ""}
onPaymentSuccess={(data) => {
router.push("/bookings");
}}
onPaymentCancellation={(data) => {
router.back();
}}
/>
</main>
);
}