@moneydevkit/nextjs 0.7.0-beta.7 → 0.7.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/route.d.ts +1 -1
- package/dist/server/route.js +1 -1
- package/dist/server/route.js.map +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -189,6 +189,20 @@ function ProductPage() {
|
|
|
189
189
|
- **`type: 'AMOUNT'`** - For donations, tips, or custom amounts. Requires `amount` field.
|
|
190
190
|
- **`type: 'PRODUCTS'`** - For selling products. Requires `products` array with product IDs. Amount is calculated from product prices.
|
|
191
191
|
|
|
192
|
+
### Pay What You Want (CUSTOM prices)
|
|
193
|
+
Products can have CUSTOM prices that let customers choose their own amount. When a checkout includes a product with a CUSTOM price, the checkout UI automatically shows an amount input field:
|
|
194
|
+
|
|
195
|
+
```jsx
|
|
196
|
+
// Create a checkout for a product with CUSTOM pricing
|
|
197
|
+
const result = await createCheckout({
|
|
198
|
+
type: 'PRODUCTS',
|
|
199
|
+
products: [customPriceProductId], // Product configured with CUSTOM price in dashboard
|
|
200
|
+
successUrl: '/checkout/success',
|
|
201
|
+
})
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The customer enters their desired amount during checkout. For USD, amounts are in dollars (converted to cents internally). For SAT, amounts are in satoshis.
|
|
205
|
+
|
|
192
206
|
## Verify successful payments
|
|
193
207
|
When a checkout completes, use `useCheckoutSuccess()` on the success page
|
|
194
208
|
```tsx
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/server/route.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { POST } from '@moneydevkit/core/route';
|
|
1
|
+
export { POST, GET } from '@moneydevkit/core/route';
|
package/dist/server/route.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { POST } from '@moneydevkit/core/route';
|
|
1
|
+
export { POST, GET } from '@moneydevkit/core/route';
|
|
2
2
|
//# sourceMappingURL=route.js.map
|
package/dist/server/route.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/server/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/server/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneydevkit/nextjs",
|
|
3
|
-
"version": "0.7.0-beta.
|
|
3
|
+
"version": "0.7.0-beta.9",
|
|
4
4
|
"title": "@moneydevkit/nextjs",
|
|
5
5
|
"description": "moneydevkit checkout components for Next.js.",
|
|
6
6
|
"repository": {
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
},
|
|
21
21
|
"./mdk-styles.css": "./dist/mdk-styles.css",
|
|
22
22
|
"./package.json": "./package.json",
|
|
23
|
+
"./server": {
|
|
24
|
+
"types": "./dist/server/index.d.ts",
|
|
25
|
+
"import": "./dist/server/index.js",
|
|
26
|
+
"default": "./dist/server/index.js"
|
|
27
|
+
},
|
|
23
28
|
"./server/route": {
|
|
24
29
|
"types": "./dist/server/route.d.ts",
|
|
25
30
|
"import": "./dist/server/route.js",
|
|
@@ -50,8 +55,8 @@
|
|
|
50
55
|
},
|
|
51
56
|
"dependencies": {
|
|
52
57
|
"@hookform/resolvers": "^5.0.1",
|
|
53
|
-
"@moneydevkit/api-contract": "^0.1.
|
|
54
|
-
"@moneydevkit/core": "0.7.0-beta.
|
|
58
|
+
"@moneydevkit/api-contract": "^0.1.17",
|
|
59
|
+
"@moneydevkit/core": "0.7.0-beta.9",
|
|
55
60
|
"@moneydevkit/lightning-js": "^0.1.60",
|
|
56
61
|
"@orpc/client": "1.3.0",
|
|
57
62
|
"@orpc/contract": "1.3.0",
|