@puzzle-ui/payment-providers 0.0.0-stage → 0.17.0
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 +28 -2
- package/ai/instructions.md +10 -0
- package/ai/manifest.json +8 -0
- package/dist/LICENSE +21 -0
- package/dist/adyen.cjs +226 -0
- package/dist/adyen.cjs.map +1 -0
- package/dist/adyen.d.cts +10 -0
- package/dist/adyen.d.ts +10 -0
- package/dist/adyen.js +225 -0
- package/dist/adyen.js.map +1 -0
- package/dist/http-BJTHkHOr.d.cts +10 -0
- package/dist/http-BJTHkHOr.d.ts +10 -0
- package/dist/http-DxPMQ2xk.cjs +113 -0
- package/dist/http-DxPMQ2xk.cjs.map +1 -0
- package/dist/http-Pinf6Gsa.js +66 -0
- package/dist/http-Pinf6Gsa.js.map +1 -0
- package/dist/index.cjs +15 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +7 -0
- package/dist/mollie.cjs +194 -0
- package/dist/mollie.cjs.map +1 -0
- package/dist/mollie.d.cts +9 -0
- package/dist/mollie.d.ts +9 -0
- package/dist/mollie.js +193 -0
- package/dist/mollie.js.map +1 -0
- package/dist/paypal.cjs +207 -0
- package/dist/paypal.cjs.map +1 -0
- package/dist/paypal.d.cts +10 -0
- package/dist/paypal.d.ts +10 -0
- package/dist/paypal.js +206 -0
- package/dist/paypal.js.map +1 -0
- package/dist/signatures-AHsLlFRl.js +35 -0
- package/dist/signatures-AHsLlFRl.js.map +1 -0
- package/dist/signatures-F-65qEDl.cjs +46 -0
- package/dist/signatures-F-65qEDl.cjs.map +1 -0
- package/dist/stripe.cjs +191 -0
- package/dist/stripe.cjs.map +1 -0
- package/dist/stripe.d.cts +10 -0
- package/dist/stripe.d.ts +10 -0
- package/dist/stripe.js +190 -0
- package/dist/stripe.js.map +1 -0
- package/package.json +97 -4
package/dist/stripe.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { a as jsonHeaders, c as requireString, i as encodeBasicAuth, n as asString, o as now, r as createProviderError, s as requestJson } from "./http-Pinf6Gsa.js";
|
|
2
|
+
import { n as verifyStripeSignature } from "./signatures-AHsLlFRl.js";
|
|
3
|
+
import { createMoney } from "@puzzle-ui/commerce";
|
|
4
|
+
// src/stripe.ts
|
|
5
|
+
const provider = "stripe";
|
|
6
|
+
const getAmount = (value, currency) => createMoney(typeof value === "number" && Number.isSafeInteger(value) ? value : 0, currency);
|
|
7
|
+
const paymentFromIntent = (value, fallback) => {
|
|
8
|
+
const currency = String(value.currency ?? fallback.amount.currency).toUpperCase();
|
|
9
|
+
const status = String(value.status ?? "pending");
|
|
10
|
+
const normalizedStatus = status === "requires_action" ? "requires_action" : status === "processing" ? "processing" : status === "succeeded" ? "succeeded" : status === "canceled" ? "cancelled" : status === "requires_payment_method" || status === "requires_confirmation" ? "pending" : "pending";
|
|
11
|
+
const amount = getAmount(value.amount, currency);
|
|
12
|
+
const captured = getAmount(value.amount_received, currency);
|
|
13
|
+
return {
|
|
14
|
+
id: fallback.id,
|
|
15
|
+
orderId: fallback.orderId,
|
|
16
|
+
amount,
|
|
17
|
+
status: normalizedStatus,
|
|
18
|
+
provider,
|
|
19
|
+
providerPaymentId: requireString(value.id, "payment ID"),
|
|
20
|
+
capturedAmount: captured.amount > 0 ? captured : void 0,
|
|
21
|
+
failure: typeof value.last_payment_error === "object" && value.last_payment_error ? {
|
|
22
|
+
code: "declined",
|
|
23
|
+
message: String(value.last_payment_error.message ?? "Payment was declined."),
|
|
24
|
+
providerCode: asString(value.last_payment_error.code),
|
|
25
|
+
retryable: false,
|
|
26
|
+
decline: true
|
|
27
|
+
} : void 0,
|
|
28
|
+
createdAt: typeof value.created === "number" ? /* @__PURE__ */ new Date(value.created * 1e3) : fallback.amount ? now() : void 0,
|
|
29
|
+
updatedAt: now()
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const formBody = (values) => new URLSearchParams(Object.entries(values).filter(([, value]) => value !== void 0)).toString();
|
|
33
|
+
const createStripeAdapter = (options) => {
|
|
34
|
+
if (!options.secretKey.trim()) throw new TypeError("Stripe secret key is required.");
|
|
35
|
+
const fetcher = options.fetcher ?? fetch;
|
|
36
|
+
const baseUrl = options.apiBaseUrl ?? "https://api.stripe.com";
|
|
37
|
+
const headers = (idempotencyKey) => ({
|
|
38
|
+
...jsonHeaders(),
|
|
39
|
+
Authorization: encodeBasicAuth(options.secretKey),
|
|
40
|
+
...idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {}
|
|
41
|
+
});
|
|
42
|
+
const request = async (path, init = {}, idempotencyKey) => {
|
|
43
|
+
try {
|
|
44
|
+
return await requestJson(fetcher, `${baseUrl}${path}`, {
|
|
45
|
+
...init,
|
|
46
|
+
headers: {
|
|
47
|
+
...headers(idempotencyKey),
|
|
48
|
+
...init.headers
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
} catch (error) {
|
|
52
|
+
throw createProviderError(error);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const createIntent = async (input, idempotencyKey) => {
|
|
56
|
+
const body = formBody({
|
|
57
|
+
amount: input.amount.amount,
|
|
58
|
+
currency: input.amount.currency.toLowerCase(),
|
|
59
|
+
"metadata[order_id]": input.orderId,
|
|
60
|
+
"payment_method_options[card][request_three_d_secure]": "automatic"
|
|
61
|
+
});
|
|
62
|
+
const intent = await request("/v1/payment_intents", {
|
|
63
|
+
method: "POST",
|
|
64
|
+
body,
|
|
65
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
66
|
+
}, idempotencyKey);
|
|
67
|
+
return paymentFromIntent(intent, {
|
|
68
|
+
id: input.paymentId,
|
|
69
|
+
orderId: input.orderId,
|
|
70
|
+
amount: input.amount
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
return {
|
|
74
|
+
id: provider,
|
|
75
|
+
name: "Stripe",
|
|
76
|
+
capabilities: {
|
|
77
|
+
payments: true,
|
|
78
|
+
refunds: true,
|
|
79
|
+
authorize: true,
|
|
80
|
+
capture: true,
|
|
81
|
+
cancel: true,
|
|
82
|
+
partialCapture: true,
|
|
83
|
+
partialRefund: true,
|
|
84
|
+
recurring: true,
|
|
85
|
+
hostedCheckout: true,
|
|
86
|
+
embeddedCheckout: true,
|
|
87
|
+
wallets: true,
|
|
88
|
+
delayedPaymentMethods: true,
|
|
89
|
+
webhooks: Boolean(options.webhookSecret),
|
|
90
|
+
idempotency: true
|
|
91
|
+
},
|
|
92
|
+
createPayment: (input, context) => createIntent(input, context?.idempotencyKey),
|
|
93
|
+
getPayment: async (providerPaymentId, context) => {
|
|
94
|
+
const intent = await request(`/v1/payment_intents/${encodeURIComponent(providerPaymentId)}`, { method: "GET" }, context?.idempotencyKey);
|
|
95
|
+
return paymentFromIntent(intent, {
|
|
96
|
+
id: providerPaymentId,
|
|
97
|
+
orderId: String(intent.metadata?.order_id ?? ""),
|
|
98
|
+
amount: getAmount(intent.amount, String(intent.currency ?? "USD").toUpperCase())
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
authorize: async ({ payment, context }) => {
|
|
102
|
+
const intent = await request(`/v1/payment_intents/${encodeURIComponent(requireString(payment.providerPaymentId, "provider payment ID"))}/confirm`, { method: "POST" }, context?.idempotencyKey);
|
|
103
|
+
return paymentFromIntent(intent, payment);
|
|
104
|
+
},
|
|
105
|
+
capture: async ({ payment, amount, context }) => {
|
|
106
|
+
const intent = await request(`/v1/payment_intents/${encodeURIComponent(requireString(payment.providerPaymentId, "provider payment ID"))}/capture`, {
|
|
107
|
+
method: "POST",
|
|
108
|
+
body: formBody({ amount_to_capture: amount?.amount }),
|
|
109
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
110
|
+
}, context?.idempotencyKey);
|
|
111
|
+
return paymentFromIntent(intent, payment);
|
|
112
|
+
},
|
|
113
|
+
cancel: async ({ payment, context }) => {
|
|
114
|
+
const intent = await request(`/v1/payment_intents/${encodeURIComponent(requireString(payment.providerPaymentId, "provider payment ID"))}/cancel`, { method: "POST" }, context?.idempotencyKey);
|
|
115
|
+
return paymentFromIntent(intent, payment);
|
|
116
|
+
},
|
|
117
|
+
refund: async ({ payment, refund, context }) => {
|
|
118
|
+
const result = await request("/v1/refunds", {
|
|
119
|
+
method: "POST",
|
|
120
|
+
body: formBody({
|
|
121
|
+
payment_intent: requireString(payment.providerPaymentId, "provider payment ID"),
|
|
122
|
+
amount: refund.amount.amount,
|
|
123
|
+
reason: refund.reason
|
|
124
|
+
}),
|
|
125
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
126
|
+
}, context?.idempotencyKey);
|
|
127
|
+
return {
|
|
128
|
+
...refund,
|
|
129
|
+
providerRefundId: requireString(result.id, "refund ID"),
|
|
130
|
+
status: result.status === "succeeded" ? "succeeded" : result.status === "failed" ? "failed" : "pending",
|
|
131
|
+
updatedAt: now()
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
createCheckoutSession: async (input, context) => {
|
|
135
|
+
const session = await request("/v1/checkout/sessions", {
|
|
136
|
+
method: "POST",
|
|
137
|
+
body: formBody({
|
|
138
|
+
mode: input.mode ?? "payment",
|
|
139
|
+
success_url: input.returnUrl,
|
|
140
|
+
cancel_url: input.cancelUrl,
|
|
141
|
+
"line_items[0][price_data][currency]": input.amount.currency.toLowerCase(),
|
|
142
|
+
"line_items[0][price_data][product_data][name]": `Order ${input.orderId}`,
|
|
143
|
+
"line_items[0][price_data][unit_amount]": input.amount.amount,
|
|
144
|
+
"line_items[0][quantity]": 1
|
|
145
|
+
}),
|
|
146
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
147
|
+
}, context?.idempotencyKey);
|
|
148
|
+
return {
|
|
149
|
+
id: requireString(session.id, "checkout session ID"),
|
|
150
|
+
provider,
|
|
151
|
+
paymentId: input.paymentId,
|
|
152
|
+
url: asString(session.url),
|
|
153
|
+
clientSecret: asString(session.client_secret),
|
|
154
|
+
expiresAt: typeof session.expires_at === "number" ? /* @__PURE__ */ new Date(session.expires_at * 1e3) : void 0
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
getSupportedPaymentMethods: async () => [{
|
|
158
|
+
id: "card",
|
|
159
|
+
type: "card",
|
|
160
|
+
label: "Card",
|
|
161
|
+
provider
|
|
162
|
+
}, {
|
|
163
|
+
id: "wallet",
|
|
164
|
+
type: "wallet",
|
|
165
|
+
label: "Wallet",
|
|
166
|
+
provider
|
|
167
|
+
}],
|
|
168
|
+
verifyWebhook: async (payload, signature, secret) => verifyStripeSignature({
|
|
169
|
+
payload: typeof payload === "string" ? payload : new TextDecoder().decode(payload),
|
|
170
|
+
signature,
|
|
171
|
+
secret,
|
|
172
|
+
toleranceSeconds: options.webhookToleranceSeconds
|
|
173
|
+
}),
|
|
174
|
+
parseWebhook: (payload) => {
|
|
175
|
+
const event = payload;
|
|
176
|
+
const data = event.data?.object;
|
|
177
|
+
const object = data;
|
|
178
|
+
return {
|
|
179
|
+
id: requireString(event.id, "webhook event ID"),
|
|
180
|
+
type: requireString(event.type, "webhook event type"),
|
|
181
|
+
paymentId: asString(object?.payment_intent) ?? (asString(object?.object) === "payment_intent" ? asString(object?.id) : void 0),
|
|
182
|
+
data: object ?? data ?? event,
|
|
183
|
+
occurredAt: typeof event.created === "number" ? /* @__PURE__ */ new Date(event.created * 1e3) : now()
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
export { createStripeAdapter };
|
|
189
|
+
|
|
190
|
+
//# sourceMappingURL=stripe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe.js","names":[],"sources":["../src/stripe.ts"],"sourcesContent":["import {\n createMoney,\n type CreateCheckoutSessionRequest,\n type CreatePaymentRequest,\n type PaymentAttempt,\n type PaymentProviderAdapter,\n type ProviderWebhookEvent,\n type Refund,\n type RefundPaymentRequest,\n type CapturePaymentRequest,\n type CancelPaymentRequest,\n} from \"@puzzle-ui/commerce\";\nimport {\n asString,\n createProviderError,\n encodeBasicAuth,\n jsonHeaders,\n now,\n requestJson,\n requireString,\n type ProviderFetcher,\n} from \"./http\";\nimport { verifyStripeSignature } from \"./signatures\";\n\nexport type StripeAdapterOptions = {\n readonly secretKey: string;\n readonly webhookSecret?: string;\n readonly apiBaseUrl?: string;\n readonly fetcher?: ProviderFetcher;\n readonly webhookToleranceSeconds?: number;\n};\n\nconst provider = \"stripe\";\n\nconst getAmount = (value: unknown, currency: string) =>\n createMoney(\n typeof value === \"number\" && Number.isSafeInteger(value) ? value : 0,\n currency,\n );\n\nconst paymentFromIntent = (\n value: Record<string, unknown>,\n fallback: Pick<PaymentAttempt, \"id\" | \"orderId\" | \"amount\">,\n): PaymentAttempt => {\n const currency = String(value.currency ?? fallback.amount.currency).toUpperCase();\n const status = String(value.status ?? \"pending\");\n const normalizedStatus: PaymentAttempt[\"status\"] =\n status === \"requires_action\"\n ? \"requires_action\"\n : status === \"processing\"\n ? \"processing\"\n : status === \"succeeded\"\n ? \"succeeded\"\n : status === \"canceled\"\n ? \"cancelled\"\n : status === \"requires_payment_method\" || status === \"requires_confirmation\"\n ? \"pending\"\n : \"pending\";\n const amount = getAmount(value.amount, currency);\n const captured = getAmount(value.amount_received, currency);\n return {\n id: fallback.id,\n orderId: fallback.orderId,\n amount,\n status: normalizedStatus,\n provider,\n providerPaymentId: requireString(value.id, \"payment ID\"),\n capturedAmount: captured.amount > 0 ? captured : undefined,\n failure:\n typeof value.last_payment_error === \"object\" && value.last_payment_error\n ? {\n code: \"declined\",\n message: String(\n (value.last_payment_error as Record<string, unknown>).message ??\n \"Payment was declined.\",\n ),\n providerCode: asString(\n (value.last_payment_error as Record<string, unknown>).code,\n ),\n retryable: false,\n decline: true,\n }\n : undefined,\n createdAt:\n typeof value.created === \"number\"\n ? new Date(value.created * 1000)\n : fallback.amount\n ? now()\n : undefined,\n updatedAt: now(),\n };\n};\n\nconst formBody = (values: Readonly<Record<string, string | number | undefined>>) =>\n new URLSearchParams(\n Object.entries(values).filter(([, value]) => value !== undefined) as [\n string,\n string,\n ][],\n ).toString();\n\nexport const createStripeAdapter = (\n options: StripeAdapterOptions,\n): PaymentProviderAdapter => {\n if (!options.secretKey.trim()) throw new TypeError(\"Stripe secret key is required.\");\n const fetcher = options.fetcher ?? fetch;\n const baseUrl = options.apiBaseUrl ?? \"https://api.stripe.com\";\n const headers = (idempotencyKey?: string): HeadersInit => ({\n ...jsonHeaders(),\n Authorization: encodeBasicAuth(options.secretKey),\n ...(idempotencyKey ? { \"Idempotency-Key\": idempotencyKey } : {}),\n });\n\n const request = async (\n path: string,\n init: RequestInit = {},\n idempotencyKey?: string,\n ) => {\n try {\n return await requestJson(fetcher, `${baseUrl}${path}`, {\n ...init,\n headers: { ...headers(idempotencyKey), ...init.headers },\n });\n } catch (error) {\n throw createProviderError(error);\n }\n };\n\n const createIntent = async (\n input: CreatePaymentRequest,\n idempotencyKey?: string,\n ) => {\n const body = formBody({\n amount: input.amount.amount,\n currency: input.amount.currency.toLowerCase(),\n \"metadata[order_id]\": input.orderId,\n \"payment_method_options[card][request_three_d_secure]\": \"automatic\",\n });\n const intent = await request(\n \"/v1/payment_intents\",\n { method: \"POST\", body, headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" } },\n idempotencyKey,\n );\n return paymentFromIntent(intent, {\n id: input.paymentId,\n orderId: input.orderId,\n amount: input.amount,\n });\n };\n\n return {\n id: provider,\n name: \"Stripe\",\n capabilities: {\n payments: true,\n refunds: true,\n authorize: true,\n capture: true,\n cancel: true,\n partialCapture: true,\n partialRefund: true,\n recurring: true,\n hostedCheckout: true,\n embeddedCheckout: true,\n wallets: true,\n delayedPaymentMethods: true,\n webhooks: Boolean(options.webhookSecret),\n idempotency: true,\n },\n createPayment: (input, context) =>\n createIntent(input, context?.idempotencyKey),\n getPayment: async (providerPaymentId, context) => {\n const intent = await request(\n `/v1/payment_intents/${encodeURIComponent(providerPaymentId)}`,\n { method: \"GET\" },\n context?.idempotencyKey,\n );\n return paymentFromIntent(intent, {\n id: providerPaymentId,\n orderId: String(\n (intent.metadata as Record<string, unknown> | undefined)?.order_id ?? \"\",\n ),\n amount: getAmount(intent.amount, String(intent.currency ?? \"USD\").toUpperCase()),\n });\n },\n authorize: async ({ payment, context }) => {\n const intent = await request(\n `/v1/payment_intents/${encodeURIComponent(requireString(payment.providerPaymentId, \"provider payment ID\"))}/confirm`,\n { method: \"POST\" },\n context?.idempotencyKey,\n );\n return paymentFromIntent(intent, payment);\n },\n capture: async ({ payment, amount, context }: CapturePaymentRequest) => {\n const intent = await request(\n `/v1/payment_intents/${encodeURIComponent(requireString(payment.providerPaymentId, \"provider payment ID\"))}/capture`,\n {\n method: \"POST\",\n body: formBody({ amount_to_capture: amount?.amount }),\n headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n },\n context?.idempotencyKey,\n );\n return paymentFromIntent(intent, payment);\n },\n cancel: async ({ payment, context }: CancelPaymentRequest) => {\n const intent = await request(\n `/v1/payment_intents/${encodeURIComponent(requireString(payment.providerPaymentId, \"provider payment ID\"))}/cancel`,\n { method: \"POST\" },\n context?.idempotencyKey,\n );\n return paymentFromIntent(intent, payment);\n },\n refund: async ({ payment, refund, context }: RefundPaymentRequest) => {\n const result = await request(\n \"/v1/refunds\",\n {\n method: \"POST\",\n body: formBody({\n payment_intent: requireString(payment.providerPaymentId, \"provider payment ID\"),\n amount: refund.amount.amount,\n reason: refund.reason,\n }),\n headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n },\n context?.idempotencyKey,\n );\n return {\n ...refund,\n providerRefundId: requireString(result.id, \"refund ID\"),\n status:\n result.status === \"succeeded\"\n ? \"succeeded\"\n : result.status === \"failed\"\n ? \"failed\"\n : \"pending\",\n updatedAt: now(),\n };\n },\n createCheckoutSession: async (input: CreateCheckoutSessionRequest, context) => {\n const session = await request(\n \"/v1/checkout/sessions\",\n {\n method: \"POST\",\n body: formBody({\n mode: input.mode ?? \"payment\",\n success_url: input.returnUrl,\n cancel_url: input.cancelUrl,\n \"line_items[0][price_data][currency]\": input.amount.currency.toLowerCase(),\n \"line_items[0][price_data][product_data][name]\": `Order ${input.orderId}`,\n \"line_items[0][price_data][unit_amount]\": input.amount.amount,\n \"line_items[0][quantity]\": 1,\n }),\n headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n },\n context?.idempotencyKey,\n );\n return {\n id: requireString(session.id, \"checkout session ID\"),\n provider,\n paymentId: input.paymentId,\n url: asString(session.url),\n clientSecret: asString(session.client_secret),\n expiresAt:\n typeof session.expires_at === \"number\"\n ? new Date(session.expires_at * 1000)\n : undefined,\n };\n },\n getSupportedPaymentMethods: async () => [\n { id: \"card\", type: \"card\", label: \"Card\", provider },\n { id: \"wallet\", type: \"wallet\", label: \"Wallet\", provider },\n ],\n verifyWebhook: async (payload, signature, secret) =>\n verifyStripeSignature({\n payload: typeof payload === \"string\" ? payload : new TextDecoder().decode(payload),\n signature,\n secret,\n toleranceSeconds: options.webhookToleranceSeconds,\n }),\n parseWebhook: (payload): ProviderWebhookEvent => {\n const event = payload as Record<string, unknown>;\n const data = (event.data as Record<string, unknown> | undefined)?.object;\n const object = data as Record<string, unknown> | undefined;\n return {\n id: requireString(event.id, \"webhook event ID\"),\n type: requireString(event.type, \"webhook event type\"),\n paymentId:\n asString(object?.payment_intent) ??\n (asString(object?.object) === \"payment_intent\" ? asString(object?.id) : undefined),\n data: object ?? data ?? event,\n occurredAt:\n typeof event.created === \"number\"\n ? new Date(event.created * 1000)\n : now(),\n };\n },\n };\n};\n"],"mappings":";;;;AAgCA,MAAM,WAAW;AAEjB,MAAM,aAAa,OAAgB,aACjC,YACE,OAAO,UAAU,YAAY,OAAO,cAAc,KAAK,IAAI,QAAQ,GACnE,QACF;AAEF,MAAM,qBACJ,OACA,aACmB;CACnB,MAAM,WAAW,OAAO,MAAM,YAAY,SAAS,OAAO,QAAQ,CAAC,CAAC,YAAY;CAChF,MAAM,SAAS,OAAO,MAAM,UAAU,SAAS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2BAA2B;IAC7B,CAAC;IACD,SAAS,EAAE,gBAAgB,oCAAoC;GACjE,GACA,SAAS,cACX;GACA,OAAO;IACL,IAAI,cAAc,QAAQ,IAAI,qBAAqB;IACnD;IACA,WAAW,MAAM;IACjB,KAAK,SAAS,QAAQ,GAAG;IACzB,cAAc,SAAS,QAAQ,aAAa;IAC5C,WACE,OAAO,QAAQ,eAAe,2BAC1B,IAAI,KAAK,QAAQ,aAAa,GAAI,IAClC,KAAA;GACR;EACF;EACA,4BAA4B,YAAY,CACtC;GAAE,IAAI;GAAQ,MAAM;GAAQ,OAAO;GAAQ;EAAS,GACpD;GAAE,IAAI;GAAU,MAAM;GAAU,OAAO;GAAU;EAAS,CAC5D;EACA,eAAe,OAAO,SAAS,WAAW,WACxC,sBAAsB;GACpB,SAAS,OAAO,YAAY,WAAW,UAAU,IAAI,YAAY,CAAC,CAAC,OAAO,OAAO;GACjF;GACA;GACA,kBAAkB,QAAQ;EAC5B,CAAC;EACH,eAAe,YAAkC;GAC/C,MAAM,QAAQ;GACd,MAAM,OAAQ,MAAM,MAA8C;GAClE,MAAM,SAAS;GACf,OAAO;IACL,IAAI,cAAc,MAAM,IAAI,kBAAkB;IAC9C,MAAM,cAAc,MAAM,MAAM,oBAAoB;IACpD,WACE,SAAS,QAAQ,cAAc,MAC9B,SAAS,QAAQ,MAAM,MAAM,mBAAmB,SAAS,QAAQ,EAAE,IAAI,KAAA;IAC1E,MAAM,UAAU,QAAQ;IACxB,YACE,OAAO,MAAM,YAAY,2BACrB,IAAI,KAAK,MAAM,UAAU,GAAI,IAC7B,IAAI;GACZ;EACF;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,99 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puzzle-ui/payment-providers",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.17.0",
|
|
4
|
+
"description": "Server-only payment provider adapters for Puzzle Commerce.",
|
|
5
|
+
"homepage": "https://puzzle-ui.com/docs/payments",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"puzzle-ui",
|
|
8
|
+
"payments",
|
|
9
|
+
"stripe",
|
|
10
|
+
"mollie",
|
|
11
|
+
"paypal",
|
|
12
|
+
"adyen"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/senorprogramador/puzzle.git"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"registry": "https://registry.npmjs.org/"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "./dist/index.cjs",
|
|
25
|
+
"module": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"import": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"require": {
|
|
34
|
+
"types": "./dist/index.d.cts",
|
|
35
|
+
"default": "./dist/index.cjs"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"./stripe": {
|
|
39
|
+
"import": {
|
|
40
|
+
"types": "./dist/stripe.d.ts",
|
|
41
|
+
"default": "./dist/stripe.js"
|
|
42
|
+
},
|
|
43
|
+
"require": {
|
|
44
|
+
"types": "./dist/stripe.d.cts",
|
|
45
|
+
"default": "./dist/stripe.cjs"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"./mollie": {
|
|
49
|
+
"import": {
|
|
50
|
+
"types": "./dist/mollie.d.ts",
|
|
51
|
+
"default": "./dist/mollie.js"
|
|
52
|
+
},
|
|
53
|
+
"require": {
|
|
54
|
+
"types": "./dist/mollie.d.cts",
|
|
55
|
+
"default": "./dist/mollie.cjs"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"./paypal": {
|
|
59
|
+
"import": {
|
|
60
|
+
"types": "./dist/paypal.d.ts",
|
|
61
|
+
"default": "./dist/paypal.js"
|
|
62
|
+
},
|
|
63
|
+
"require": {
|
|
64
|
+
"types": "./dist/paypal.d.cts",
|
|
65
|
+
"default": "./dist/paypal.cjs"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"./adyen": {
|
|
69
|
+
"import": {
|
|
70
|
+
"types": "./dist/adyen.d.ts",
|
|
71
|
+
"default": "./dist/adyen.js"
|
|
72
|
+
},
|
|
73
|
+
"require": {
|
|
74
|
+
"types": "./dist/adyen.d.cts",
|
|
75
|
+
"default": "./dist/adyen.cjs"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"files": [
|
|
80
|
+
"dist",
|
|
81
|
+
"ai"
|
|
82
|
+
],
|
|
83
|
+
"sideEffects": false,
|
|
84
|
+
"scripts": {
|
|
85
|
+
"build": "tsdown",
|
|
86
|
+
"typecheck": "tsc --noEmit -p .",
|
|
87
|
+
"prepack": "tsdown",
|
|
88
|
+
"vitest": "bunx vitest run --passWithNoTests"
|
|
89
|
+
},
|
|
90
|
+
"dependencies": {
|
|
91
|
+
"@puzzle-ui/commerce": "^0.17.0"
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@types/node": "^26.6.6",
|
|
95
|
+
"tsdown": "^0.23.1",
|
|
96
|
+
"typescript": "^7.0.2",
|
|
97
|
+
"vitest": "^5.1.0"
|
|
98
|
+
}
|
|
99
|
+
}
|