Skip to content

Commit a6e0dec

Browse files
amackillopmdk-bot[bot]
authored andcommitted
LSPS4 Splice In (#642)
1 parent 6980ec7 commit a6e0dec

4 files changed

Lines changed: 654 additions & 765 deletions

File tree

examples/mdk-nextjs-demo/app/page.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import { Button } from "@/components/button";
44
import { useCheckout } from "@moneydevkit/nextjs";
55
import Link from "next/link";
6-
import { useMemo, useState } from "react";
6+
import { Suspense, useMemo, useState } from "react";
7+
import { useSearchParams } from "next/navigation";
78

89
const sellingPoints = [
910
"Creates a checkout session from the client and routes to /checkout/[id]",
@@ -14,11 +15,21 @@ const sellingPoints = [
1415

1516
const chips = [
1617
{ label: "App Router", value: "Next.js 16" },
17-
{ label: "Payments", value: "Lightning + USD" },
18+
{ label: "Payments", value: "Lightning + SAT" },
1819
{ label: "Deploy target", value: "Vercel" },
1920
];
2021

2122
export default function HomePage() {
23+
return (
24+
<Suspense>
25+
<HomePageInner />
26+
</Suspense>
27+
);
28+
}
29+
30+
function HomePageInner() {
31+
const searchParams = useSearchParams();
32+
const amountFromUrl = Number(searchParams.get("amount")) || 20_000;
2233
const [customerName, setCustomerName] = useState("Satoshi Nakamoto");
2334
const [note, setNote] = useState("Fast IBD snapshot with hosted checkout.");
2435
const [error, setError] = useState<string | null>(null);
@@ -40,8 +51,8 @@ export default function HomePage() {
4051
type: "AMOUNT",
4152
title: "Lightning download",
4253
description: "A quick Money Dev Kit checkout running on Vercel.",
43-
amount: 2500,
44-
currency: "USD",
54+
amount: amountFromUrl,
55+
currency: "SAT",
4556
successUrl: "/checkout/success",
4657
metadata,
4758
checkoutPath: "/checkout",

examples/mdk-nextjs-demo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"lint": "eslint . --ext ts,tsx,js,jsx --max-warnings=0"
1010
},
1111
"dependencies": {
12-
"@moneydevkit/core": "0.10.0",
13-
"@moneydevkit/nextjs": "0.10.0",
12+
"@moneydevkit/core": "0.14.0",
13+
"@moneydevkit/nextjs": "0.14.0",
1414
"@radix-ui/react-slot": "^1.2.2",
1515
"class-variance-authority": "^0.7.1",
1616
"clsx": "^2.1.1",

0 commit comments

Comments
 (0)