@dodopayments/remix 0.1.1 → 0.1.2
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 +9 -9
- package/dist/checkout/checkout.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/webhook/webhook.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,8 @@ const checkoutGetHandler = Checkout({
|
|
|
34
34
|
type: "static", // optional, defaults to 'static'
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
export const loader = ({ request }: LoaderFunctionArgs) =>
|
|
37
|
+
export const loader = ({ request }: LoaderFunctionArgs) =>
|
|
38
|
+
checkoutGetHandler(request);
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
---
|
|
@@ -46,13 +47,13 @@ export const loader = ({ request }: LoaderFunctionArgs) => checkoutGetHandler(re
|
|
|
46
47
|
import { CustomerPortal } from "@dodopayments/remix";
|
|
47
48
|
import type { LoaderFunctionArgs } from "@remix-run/node";
|
|
48
49
|
|
|
49
|
-
|
|
50
50
|
const customerPortalHandler = CustomerPortal({
|
|
51
51
|
bearerToken: process.env.DODO_PAYMENTS_API_KEY,
|
|
52
|
-
environment: process.env.DODO_PAYMENTS_ENVIRONMENT
|
|
52
|
+
environment: process.env.DODO_PAYMENTS_ENVIRONMENT,
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
export const loader = ({ request }: LoaderFunctionArgs) =>
|
|
55
|
+
export const loader = ({ request }: LoaderFunctionArgs) =>
|
|
56
|
+
customerPortalHandler(request);
|
|
56
57
|
```
|
|
57
58
|
|
|
58
59
|
#### Query Parameters
|
|
@@ -71,17 +72,16 @@ Returns 400 if `customer_id` is missing.
|
|
|
71
72
|
import { Webhooks } from "@dodopayments/remix";
|
|
72
73
|
import type { LoaderFunctionArgs } from "@remix-run/node";
|
|
73
74
|
|
|
74
|
-
|
|
75
75
|
const webhookHandler = Webhooks({
|
|
76
76
|
webhookKey: process.env.DODO_PAYMENTS_WEBHOOK_SECRET,
|
|
77
77
|
onPayload: async (payload) => {
|
|
78
78
|
//Handle Payload Here
|
|
79
|
-
console.log(payload)
|
|
80
|
-
}
|
|
79
|
+
console.log(payload);
|
|
80
|
+
},
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
export const action = ({ request }: LoaderFunctionArgs) =>
|
|
84
|
+
webhookHandler(request);
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/checkout/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,EAGtB,MAAM,6BAA6B,CAAC;AAErC;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,qBAAqB,IAC7B,SAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/checkout/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,EAGtB,MAAM,6BAA6B,CAAC;AAErC;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,qBAAqB,IAC7B,SAAS,OAAO,8CAqDxC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1824,7 +1824,7 @@ var checkoutQuerySchema = zod.z.object({
|
|
|
1824
1824
|
showDiscounts: zod.z.string().optional(),
|
|
1825
1825
|
// Metadata (allow any key starting with metadata_)
|
|
1826
1826
|
// We'll handle metadata separately in the handler
|
|
1827
|
-
});
|
|
1827
|
+
}).catchall(zod.z.unknown());
|
|
1828
1828
|
// Add Zod schema for dynamic checkout body
|
|
1829
1829
|
var dynamicCheckoutBodySchema = zod.z
|
|
1830
1830
|
.object({
|