@strimz/shared-types 0.12.3 → 0.13.1
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 +10 -8
- package/dist/analytics.cjs +26 -2
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.d.cts +136 -136
- package/dist/analytics.d.ts +136 -136
- package/dist/analytics.js +26 -2
- package/dist/analytics.js.map +1 -1
- package/dist/api-keys.d.cts +20 -20
- package/dist/api-keys.d.ts +20 -20
- package/dist/compliance.d.cts +4 -4
- package/dist/compliance.d.ts +4 -4
- package/dist/customers.d.cts +6 -6
- package/dist/customers.d.ts +6 -6
- package/dist/events.cjs +26 -2
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +1435 -1435
- package/dist/events.d.ts +1435 -1435
- package/dist/events.js +26 -2
- package/dist/events.js.map +1 -1
- package/dist/index.cjs +29 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +27 -3
- package/dist/index.js.map +1 -1
- package/dist/invoices.d.cts +10 -10
- package/dist/invoices.d.ts +10 -10
- package/dist/merchants.d.cts +20 -20
- package/dist/merchants.d.ts +20 -20
- package/dist/payment-sessions.cjs +29 -2
- package/dist/payment-sessions.cjs.map +1 -1
- package/dist/payment-sessions.d.cts +60 -19
- package/dist/payment-sessions.d.ts +60 -19
- package/dist/payment-sessions.js +27 -3
- package/dist/payment-sessions.js.map +1 -1
- package/dist/refunds.d.cts +36 -36
- package/dist/refunds.d.ts +36 -36
- package/dist/storefronts.d.cts +27 -27
- package/dist/storefronts.d.ts +27 -27
- package/dist/subscriptions.d.cts +30 -30
- package/dist/subscriptions.d.ts +30 -30
- package/dist/transactions.d.cts +12 -12
- package/dist/transactions.d.ts +12 -12
- package/dist/webhooks.d.cts +22 -22
- package/dist/webhooks.d.ts +22 -22
- package/package.json +2 -2
- package/src/payment-sessions.ts +30 -2
|
@@ -70,16 +70,16 @@ declare const paymentSessionSchema: z.ZodObject<{
|
|
|
70
70
|
updatedAt: z.ZodString;
|
|
71
71
|
}, "strip", z.ZodTypeAny, {
|
|
72
72
|
status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
|
|
73
|
-
amount: string;
|
|
74
|
-
currency: "USDC" | "EURC";
|
|
75
|
-
customerId: string | null;
|
|
76
|
-
merchantId: string;
|
|
77
|
-
description: string | null;
|
|
78
73
|
id: string;
|
|
74
|
+
merchantId: string;
|
|
79
75
|
createdAt: string;
|
|
76
|
+
description: string | null;
|
|
77
|
+
currency: "USDC" | "EURC";
|
|
80
78
|
updatedAt: string;
|
|
81
79
|
chainMerchantId: string | null;
|
|
82
80
|
tokenAddress: string | null;
|
|
81
|
+
customerId: string | null;
|
|
82
|
+
amount: string;
|
|
83
83
|
feeAmount: string;
|
|
84
84
|
netAmount: string;
|
|
85
85
|
payerWalletAddress: string | null;
|
|
@@ -94,16 +94,16 @@ declare const paymentSessionSchema: z.ZodObject<{
|
|
|
94
94
|
expiresAt: string;
|
|
95
95
|
}, {
|
|
96
96
|
status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
|
|
97
|
-
amount: string;
|
|
98
|
-
currency: "USDC" | "EURC";
|
|
99
|
-
customerId: string | null;
|
|
100
|
-
merchantId: string;
|
|
101
|
-
description: string | null;
|
|
102
97
|
id: string;
|
|
98
|
+
merchantId: string;
|
|
103
99
|
createdAt: string;
|
|
100
|
+
description: string | null;
|
|
101
|
+
currency: "USDC" | "EURC";
|
|
104
102
|
updatedAt: string;
|
|
105
103
|
chainMerchantId: string | null;
|
|
106
104
|
tokenAddress: string | null;
|
|
105
|
+
customerId: string | null;
|
|
106
|
+
amount: string;
|
|
107
107
|
feeAmount: string;
|
|
108
108
|
netAmount: string;
|
|
109
109
|
payerWalletAddress: string | null;
|
|
@@ -127,16 +127,16 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
|
|
|
127
127
|
email: z.ZodOptional<z.ZodString>;
|
|
128
128
|
externalRef: z.ZodOptional<z.ZodString>;
|
|
129
129
|
}, "strip", z.ZodTypeAny, {
|
|
130
|
-
email?: string | undefined;
|
|
131
130
|
walletAddress?: string | undefined;
|
|
131
|
+
email?: string | undefined;
|
|
132
132
|
externalRef?: string | undefined;
|
|
133
133
|
}, {
|
|
134
|
-
email?: string | undefined;
|
|
135
134
|
walletAddress?: string | undefined;
|
|
135
|
+
email?: string | undefined;
|
|
136
136
|
externalRef?: string | undefined;
|
|
137
137
|
}>>;
|
|
138
|
-
successUrl: z.ZodOptional<z.ZodString
|
|
139
|
-
cancelUrl: z.ZodOptional<z.ZodString
|
|
138
|
+
successUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
139
|
+
cancelUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
140
140
|
/** Minutes until the session expires. Default 30, max 60*24 (one day). */
|
|
141
141
|
expiresInMinutes: z.ZodDefault<z.ZodNumber>;
|
|
142
142
|
/**
|
|
@@ -146,29 +146,29 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
|
|
|
146
146
|
supportedSourceChains: z.ZodOptional<z.ZodArray<z.ZodEnum<["arc", "ethereum", "base", "polygon", "arbitrum", "optimism", "avalanche", "solana"]>, "many">>;
|
|
147
147
|
metadata: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>>;
|
|
148
148
|
}, "strip", z.ZodTypeAny, {
|
|
149
|
-
amount: string;
|
|
150
149
|
currency: "USDC" | "EURC";
|
|
150
|
+
amount: string;
|
|
151
151
|
expiresInMinutes: number;
|
|
152
152
|
description?: string | undefined;
|
|
153
153
|
successUrl?: string | undefined;
|
|
154
154
|
cancelUrl?: string | undefined;
|
|
155
155
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
156
156
|
customer?: {
|
|
157
|
-
email?: string | undefined;
|
|
158
157
|
walletAddress?: string | undefined;
|
|
158
|
+
email?: string | undefined;
|
|
159
159
|
externalRef?: string | undefined;
|
|
160
160
|
} | undefined;
|
|
161
161
|
supportedSourceChains?: ("arc" | "ethereum" | "base" | "polygon" | "arbitrum" | "optimism" | "avalanche" | "solana")[] | undefined;
|
|
162
162
|
}, {
|
|
163
|
-
amount: string;
|
|
164
163
|
currency: "USDC" | "EURC";
|
|
164
|
+
amount: string;
|
|
165
165
|
description?: string | undefined;
|
|
166
166
|
successUrl?: string | undefined;
|
|
167
167
|
cancelUrl?: string | undefined;
|
|
168
168
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
169
169
|
customer?: {
|
|
170
|
-
email?: string | undefined;
|
|
171
170
|
walletAddress?: string | undefined;
|
|
171
|
+
email?: string | undefined;
|
|
172
172
|
externalRef?: string | undefined;
|
|
173
173
|
} | undefined;
|
|
174
174
|
expiresInMinutes?: number | undefined;
|
|
@@ -194,5 +194,46 @@ declare const submitPaymentSessionInputSchema: z.ZodObject<{
|
|
|
194
194
|
}>;
|
|
195
195
|
type SubmitPaymentSessionInput = z.input<typeof submitPaymentSessionInputSchema>;
|
|
196
196
|
type SubmitPaymentSessionParsed = z.output<typeof submitPaymentSessionInputSchema>;
|
|
197
|
+
declare const checkoutResultErrorCodes: readonly ["load_failed", "merchant_not_ready", "payment_reverted", "unsupported_wallet"];
|
|
198
|
+
declare const checkoutResultErrorCodeSchema: z.ZodEnum<["load_failed", "merchant_not_ready", "payment_reverted", "unsupported_wallet"]>;
|
|
199
|
+
type CheckoutResultErrorCode = z.infer<typeof checkoutResultErrorCodeSchema>;
|
|
200
|
+
declare const checkoutResultMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
201
|
+
type: z.ZodLiteral<"strimz:checkout:success">;
|
|
202
|
+
sessionId: z.ZodString;
|
|
203
|
+
txHash: z.ZodString;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
type: "strimz:checkout:success";
|
|
206
|
+
sessionId: string;
|
|
207
|
+
txHash: string;
|
|
208
|
+
}, {
|
|
209
|
+
type: "strimz:checkout:success";
|
|
210
|
+
sessionId: string;
|
|
211
|
+
txHash: string;
|
|
212
|
+
}>, z.ZodObject<{
|
|
213
|
+
type: z.ZodLiteral<"strimz:checkout:cancel">;
|
|
214
|
+
sessionId: z.ZodString;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
type: "strimz:checkout:cancel";
|
|
217
|
+
sessionId: string;
|
|
218
|
+
}, {
|
|
219
|
+
type: "strimz:checkout:cancel";
|
|
220
|
+
sessionId: string;
|
|
221
|
+
}>, z.ZodObject<{
|
|
222
|
+
type: z.ZodLiteral<"strimz:checkout:error">;
|
|
223
|
+
sessionId: z.ZodString;
|
|
224
|
+
code: z.ZodEnum<["load_failed", "merchant_not_ready", "payment_reverted", "unsupported_wallet"]>;
|
|
225
|
+
message: z.ZodString;
|
|
226
|
+
}, "strip", z.ZodTypeAny, {
|
|
227
|
+
code: "load_failed" | "merchant_not_ready" | "payment_reverted" | "unsupported_wallet";
|
|
228
|
+
message: string;
|
|
229
|
+
type: "strimz:checkout:error";
|
|
230
|
+
sessionId: string;
|
|
231
|
+
}, {
|
|
232
|
+
code: "load_failed" | "merchant_not_ready" | "payment_reverted" | "unsupported_wallet";
|
|
233
|
+
message: string;
|
|
234
|
+
type: "strimz:checkout:error";
|
|
235
|
+
sessionId: string;
|
|
236
|
+
}>]>;
|
|
237
|
+
type CheckoutResultMessage = z.infer<typeof checkoutResultMessageSchema>;
|
|
197
238
|
|
|
198
|
-
export { type CreatePaymentSessionInput, type CreatePaymentSessionParsed, type PaymentSession, type PaymentSessionStatus, type SubmitPaymentSessionInput, type SubmitPaymentSessionParsed, callbackUrlSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };
|
|
239
|
+
export { type CheckoutResultErrorCode, type CheckoutResultMessage, type CreatePaymentSessionInput, type CreatePaymentSessionParsed, type PaymentSession, type PaymentSessionStatus, type SubmitPaymentSessionInput, type SubmitPaymentSessionParsed, callbackUrlSchema, checkoutResultErrorCodeSchema, checkoutResultErrorCodes, checkoutResultMessageSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };
|
|
@@ -70,16 +70,16 @@ declare const paymentSessionSchema: z.ZodObject<{
|
|
|
70
70
|
updatedAt: z.ZodString;
|
|
71
71
|
}, "strip", z.ZodTypeAny, {
|
|
72
72
|
status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
|
|
73
|
-
amount: string;
|
|
74
|
-
currency: "USDC" | "EURC";
|
|
75
|
-
customerId: string | null;
|
|
76
|
-
merchantId: string;
|
|
77
|
-
description: string | null;
|
|
78
73
|
id: string;
|
|
74
|
+
merchantId: string;
|
|
79
75
|
createdAt: string;
|
|
76
|
+
description: string | null;
|
|
77
|
+
currency: "USDC" | "EURC";
|
|
80
78
|
updatedAt: string;
|
|
81
79
|
chainMerchantId: string | null;
|
|
82
80
|
tokenAddress: string | null;
|
|
81
|
+
customerId: string | null;
|
|
82
|
+
amount: string;
|
|
83
83
|
feeAmount: string;
|
|
84
84
|
netAmount: string;
|
|
85
85
|
payerWalletAddress: string | null;
|
|
@@ -94,16 +94,16 @@ declare const paymentSessionSchema: z.ZodObject<{
|
|
|
94
94
|
expiresAt: string;
|
|
95
95
|
}, {
|
|
96
96
|
status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
|
|
97
|
-
amount: string;
|
|
98
|
-
currency: "USDC" | "EURC";
|
|
99
|
-
customerId: string | null;
|
|
100
|
-
merchantId: string;
|
|
101
|
-
description: string | null;
|
|
102
97
|
id: string;
|
|
98
|
+
merchantId: string;
|
|
103
99
|
createdAt: string;
|
|
100
|
+
description: string | null;
|
|
101
|
+
currency: "USDC" | "EURC";
|
|
104
102
|
updatedAt: string;
|
|
105
103
|
chainMerchantId: string | null;
|
|
106
104
|
tokenAddress: string | null;
|
|
105
|
+
customerId: string | null;
|
|
106
|
+
amount: string;
|
|
107
107
|
feeAmount: string;
|
|
108
108
|
netAmount: string;
|
|
109
109
|
payerWalletAddress: string | null;
|
|
@@ -127,16 +127,16 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
|
|
|
127
127
|
email: z.ZodOptional<z.ZodString>;
|
|
128
128
|
externalRef: z.ZodOptional<z.ZodString>;
|
|
129
129
|
}, "strip", z.ZodTypeAny, {
|
|
130
|
-
email?: string | undefined;
|
|
131
130
|
walletAddress?: string | undefined;
|
|
131
|
+
email?: string | undefined;
|
|
132
132
|
externalRef?: string | undefined;
|
|
133
133
|
}, {
|
|
134
|
-
email?: string | undefined;
|
|
135
134
|
walletAddress?: string | undefined;
|
|
135
|
+
email?: string | undefined;
|
|
136
136
|
externalRef?: string | undefined;
|
|
137
137
|
}>>;
|
|
138
|
-
successUrl: z.ZodOptional<z.ZodString
|
|
139
|
-
cancelUrl: z.ZodOptional<z.ZodString
|
|
138
|
+
successUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
139
|
+
cancelUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
140
140
|
/** Minutes until the session expires. Default 30, max 60*24 (one day). */
|
|
141
141
|
expiresInMinutes: z.ZodDefault<z.ZodNumber>;
|
|
142
142
|
/**
|
|
@@ -146,29 +146,29 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
|
|
|
146
146
|
supportedSourceChains: z.ZodOptional<z.ZodArray<z.ZodEnum<["arc", "ethereum", "base", "polygon", "arbitrum", "optimism", "avalanche", "solana"]>, "many">>;
|
|
147
147
|
metadata: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>>;
|
|
148
148
|
}, "strip", z.ZodTypeAny, {
|
|
149
|
-
amount: string;
|
|
150
149
|
currency: "USDC" | "EURC";
|
|
150
|
+
amount: string;
|
|
151
151
|
expiresInMinutes: number;
|
|
152
152
|
description?: string | undefined;
|
|
153
153
|
successUrl?: string | undefined;
|
|
154
154
|
cancelUrl?: string | undefined;
|
|
155
155
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
156
156
|
customer?: {
|
|
157
|
-
email?: string | undefined;
|
|
158
157
|
walletAddress?: string | undefined;
|
|
158
|
+
email?: string | undefined;
|
|
159
159
|
externalRef?: string | undefined;
|
|
160
160
|
} | undefined;
|
|
161
161
|
supportedSourceChains?: ("arc" | "ethereum" | "base" | "polygon" | "arbitrum" | "optimism" | "avalanche" | "solana")[] | undefined;
|
|
162
162
|
}, {
|
|
163
|
-
amount: string;
|
|
164
163
|
currency: "USDC" | "EURC";
|
|
164
|
+
amount: string;
|
|
165
165
|
description?: string | undefined;
|
|
166
166
|
successUrl?: string | undefined;
|
|
167
167
|
cancelUrl?: string | undefined;
|
|
168
168
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
169
169
|
customer?: {
|
|
170
|
-
email?: string | undefined;
|
|
171
170
|
walletAddress?: string | undefined;
|
|
171
|
+
email?: string | undefined;
|
|
172
172
|
externalRef?: string | undefined;
|
|
173
173
|
} | undefined;
|
|
174
174
|
expiresInMinutes?: number | undefined;
|
|
@@ -194,5 +194,46 @@ declare const submitPaymentSessionInputSchema: z.ZodObject<{
|
|
|
194
194
|
}>;
|
|
195
195
|
type SubmitPaymentSessionInput = z.input<typeof submitPaymentSessionInputSchema>;
|
|
196
196
|
type SubmitPaymentSessionParsed = z.output<typeof submitPaymentSessionInputSchema>;
|
|
197
|
+
declare const checkoutResultErrorCodes: readonly ["load_failed", "merchant_not_ready", "payment_reverted", "unsupported_wallet"];
|
|
198
|
+
declare const checkoutResultErrorCodeSchema: z.ZodEnum<["load_failed", "merchant_not_ready", "payment_reverted", "unsupported_wallet"]>;
|
|
199
|
+
type CheckoutResultErrorCode = z.infer<typeof checkoutResultErrorCodeSchema>;
|
|
200
|
+
declare const checkoutResultMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
201
|
+
type: z.ZodLiteral<"strimz:checkout:success">;
|
|
202
|
+
sessionId: z.ZodString;
|
|
203
|
+
txHash: z.ZodString;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
type: "strimz:checkout:success";
|
|
206
|
+
sessionId: string;
|
|
207
|
+
txHash: string;
|
|
208
|
+
}, {
|
|
209
|
+
type: "strimz:checkout:success";
|
|
210
|
+
sessionId: string;
|
|
211
|
+
txHash: string;
|
|
212
|
+
}>, z.ZodObject<{
|
|
213
|
+
type: z.ZodLiteral<"strimz:checkout:cancel">;
|
|
214
|
+
sessionId: z.ZodString;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
type: "strimz:checkout:cancel";
|
|
217
|
+
sessionId: string;
|
|
218
|
+
}, {
|
|
219
|
+
type: "strimz:checkout:cancel";
|
|
220
|
+
sessionId: string;
|
|
221
|
+
}>, z.ZodObject<{
|
|
222
|
+
type: z.ZodLiteral<"strimz:checkout:error">;
|
|
223
|
+
sessionId: z.ZodString;
|
|
224
|
+
code: z.ZodEnum<["load_failed", "merchant_not_ready", "payment_reverted", "unsupported_wallet"]>;
|
|
225
|
+
message: z.ZodString;
|
|
226
|
+
}, "strip", z.ZodTypeAny, {
|
|
227
|
+
code: "load_failed" | "merchant_not_ready" | "payment_reverted" | "unsupported_wallet";
|
|
228
|
+
message: string;
|
|
229
|
+
type: "strimz:checkout:error";
|
|
230
|
+
sessionId: string;
|
|
231
|
+
}, {
|
|
232
|
+
code: "load_failed" | "merchant_not_ready" | "payment_reverted" | "unsupported_wallet";
|
|
233
|
+
message: string;
|
|
234
|
+
type: "strimz:checkout:error";
|
|
235
|
+
sessionId: string;
|
|
236
|
+
}>]>;
|
|
237
|
+
type CheckoutResultMessage = z.infer<typeof checkoutResultMessageSchema>;
|
|
197
238
|
|
|
198
|
-
export { type CreatePaymentSessionInput, type CreatePaymentSessionParsed, type PaymentSession, type PaymentSessionStatus, type SubmitPaymentSessionInput, type SubmitPaymentSessionParsed, callbackUrlSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };
|
|
239
|
+
export { type CheckoutResultErrorCode, type CheckoutResultMessage, type CreatePaymentSessionInput, type CreatePaymentSessionParsed, type PaymentSession, type PaymentSessionStatus, type SubmitPaymentSessionInput, type SubmitPaymentSessionParsed, callbackUrlSchema, checkoutResultErrorCodeSchema, checkoutResultErrorCodes, checkoutResultMessageSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };
|
package/dist/payment-sessions.js
CHANGED
|
@@ -89,8 +89,8 @@ var createPaymentSessionInputSchema = z.object({
|
|
|
89
89
|
email: z.string().email().optional(),
|
|
90
90
|
externalRef: z.string().max(120).optional()
|
|
91
91
|
}).optional(),
|
|
92
|
-
successUrl:
|
|
93
|
-
cancelUrl:
|
|
92
|
+
successUrl: callbackUrlSchema.optional(),
|
|
93
|
+
cancelUrl: callbackUrlSchema.optional(),
|
|
94
94
|
/** Minutes until the session expires. Default 30, max 60*24 (one day). */
|
|
95
95
|
expiresInMinutes: z.number().int().min(1).max(60 * 24).default(30),
|
|
96
96
|
/**
|
|
@@ -117,7 +117,31 @@ var submitPaymentSessionInputSchema = z.object({
|
|
|
117
117
|
bridgeTxHash: evmTxHashSchema.optional(),
|
|
118
118
|
payerWalletAddress: evmAddressSchema
|
|
119
119
|
});
|
|
120
|
+
var checkoutResultErrorCodes = [
|
|
121
|
+
"load_failed",
|
|
122
|
+
"merchant_not_ready",
|
|
123
|
+
"payment_reverted",
|
|
124
|
+
"unsupported_wallet"
|
|
125
|
+
];
|
|
126
|
+
var checkoutResultErrorCodeSchema = z.enum(checkoutResultErrorCodes);
|
|
127
|
+
var checkoutResultMessageSchema = z.discriminatedUnion("type", [
|
|
128
|
+
z.object({
|
|
129
|
+
type: z.literal("strimz:checkout:success"),
|
|
130
|
+
sessionId: idSchema,
|
|
131
|
+
txHash: evmTxHashSchema
|
|
132
|
+
}),
|
|
133
|
+
z.object({
|
|
134
|
+
type: z.literal("strimz:checkout:cancel"),
|
|
135
|
+
sessionId: idSchema
|
|
136
|
+
}),
|
|
137
|
+
z.object({
|
|
138
|
+
type: z.literal("strimz:checkout:error"),
|
|
139
|
+
sessionId: idSchema,
|
|
140
|
+
code: checkoutResultErrorCodeSchema,
|
|
141
|
+
message: z.string().min(1).max(500)
|
|
142
|
+
})
|
|
143
|
+
]);
|
|
120
144
|
|
|
121
|
-
export { callbackUrlSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };
|
|
145
|
+
export { callbackUrlSchema, checkoutResultErrorCodeSchema, checkoutResultErrorCodes, checkoutResultMessageSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };
|
|
122
146
|
//# sourceMappingURL=payment-sessions.js.map
|
|
123
147
|
//# sourceMappingURL=payment-sessions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common.ts","../src/payment-sessions.ts"],"names":["z"],"mappings":";;;AAQO,IAAM,QAAA,GAAW,CAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAG5B,IAAM,kBAAkB,CAAA,CAC5B,MAAA,EAAO,CACP,KAAA,C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":"payment-sessions.js","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.input<typeof paginationInputSchema>\nexport type PaginationParsed = z.output<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'starter', 'growth', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Payment session. A one-shot checkout intent.\n *\n * State machine:\n * created → awaiting_payment → submitted → confirmed\n * \\\n * → failed\n * → expired\n * → cancelled\n */\n\nimport { z } from 'zod'\nimport {\n evmAddressSchema,\n evmTxHashSchema,\n idSchema,\n isoTimestampSchema,\n metadataSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const paymentSessionStatusSchema = z.enum([\n 'created',\n 'awaiting_payment',\n 'submitted',\n 'confirmed',\n 'failed',\n 'expired',\n 'cancelled',\n])\nexport type PaymentSessionStatus = z.infer<typeof paymentSessionStatusSchema>\n\n/**\n * Merchant-supplied callback URL. The hosted checkout dispatches with\n * `window.location.href = redirectUrl` on completion / cancellation,\n * so we MUST reject anything other than `http://` and `https://`.\n *\n * Why this is a real risk: Zod's `.url()` validates RFC syntax, which\n * accepts `javascript:`, `data:`, `vbscript:`, `file:`, blob:`, etc.\n * A compromised merchant integration or an XSS upstream could ship a\n * session whose redirect URL executes script (or exfiltrates session\n * tokens) on every payer's browser. The damage is per-payer, but the\n * blast radius is \"every checkout the merchant runs.\"\n *\n * Mailto / tel and other handler protocols are also rejected — there\n * is no legitimate flow on a payment checkout that would benefit.\n */\nexport const callbackUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://') || v.startsWith('http://'), {\n message: 'must be an http:// or https:// URL',\n })\n\nexport const paymentSessionSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n /**\n * On-chain StrimzRegistry merchant id (uint96) as a decimal string.\n * Set when the merchant has been registered on-chain; null when the\n * merchant exists in our DB but the registry transaction hasn't\n * been broadcast yet. Hosted checkout uses this to populate the\n * meta-tx calldata; if null, the checkout refuses to accept\n * payments.\n */\n chainMerchantId: z\n .string()\n .regex(/^[0-9]+$/u, 'must be a non-negative decimal integer string')\n .nullable(),\n /**\n * ERC-20 token contract address resolved from `currency` on the\n * active chain (Arc Testnet / Mainnet). Used as the `verifyingContract`\n * in the EIP-712 domain for both EIP-3009 and EIP-2612 signing.\n * Null on the (vanishingly unlikely) path where the API has no\n * configured address for the session's currency.\n */\n tokenAddress: evmAddressSchema.nullable(),\n customerId: idSchema.nullable(),\n status: paymentSessionStatusSchema,\n amount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n feeAmount: tokenAmountSchema,\n netAmount: tokenAmountSchema,\n description: z.string().max(500).nullable(),\n payerWalletAddress: evmAddressSchema.nullable(),\n payerEmail: z.string().email().nullable(),\n successUrl: callbackUrlSchema.nullable(),\n cancelUrl: callbackUrlSchema.nullable(),\n sourceChain: z\n .enum(['arc', 'ethereum', 'base', 'polygon', 'arbitrum', 'optimism', 'avalanche', 'solana'])\n .nullable(),\n bridgeTxHash: evmTxHashSchema.nullable(),\n onchainTxHash: evmTxHashSchema.nullable(),\n checkoutUrl: z.string().url(),\n metadata: metadataSchema,\n expiresAt: isoTimestampSchema,\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type PaymentSession = z.infer<typeof paymentSessionSchema>\n\n// ---------- DTOs ----------\n\nexport const createPaymentSessionInputSchema = z.object({\n amount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n description: z.string().max(500).optional(),\n customer: z\n .object({\n walletAddress: evmAddressSchema.optional(),\n email: z.string().email().optional(),\n externalRef: z.string().max(120).optional(),\n })\n .optional(),\n successUrl: z.string().url().optional(),\n cancelUrl: z.string().url().optional(),\n /** Minutes until the session expires. Default 30, max 60*24 (one day). */\n expiresInMinutes: z\n .number()\n .int()\n .min(1)\n .max(60 * 24)\n .default(30),\n /**\n * Allowed source chains a payer can bridge USDC from via CCTP. Omit to\n * accept every CCTP-supported chain.\n */\n supportedSourceChains: z\n .array(\n z.enum(['arc', 'ethereum', 'base', 'polygon', 'arbitrum', 'optimism', 'avalanche', 'solana']),\n )\n .optional(),\n metadata: metadataSchema.optional(),\n})\nexport type CreatePaymentSessionInput = z.input<typeof createPaymentSessionInputSchema>\nexport type CreatePaymentSessionParsed = z.output<typeof createPaymentSessionInputSchema>\n\nexport const submitPaymentSessionInputSchema = z.object({\n sourceChain: z.enum([\n 'arc',\n 'ethereum',\n 'base',\n 'polygon',\n 'arbitrum',\n 'optimism',\n 'avalanche',\n 'solana',\n ]),\n onchainTxHash: evmTxHashSchema,\n bridgeTxHash: evmTxHashSchema.optional(),\n payerWalletAddress: evmAddressSchema,\n})\nexport type SubmitPaymentSessionInput = z.input<typeof submitPaymentSessionInputSchema>\nexport type SubmitPaymentSessionParsed = z.output<typeof submitPaymentSessionInputSchema>\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/common.ts","../src/payment-sessions.ts"],"names":["z"],"mappings":";;;AAQO,IAAM,QAAA,GAAW,CAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAG5B,IAAM,kBAAkB,CAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D,CAAA;AAGlE,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG;AAG5C,CAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC;AAG0B,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AAOjC,IAAM,oBAAoB,CAAA,CAC9B,MAAA,EAAO,CACP,KAAA,CAAM,YAAY,iDAAiD,CAAA;AAG5C,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,MAAA,CAAO,gBAAgB;AAGtE,IAAM,kBAAA,GA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AA,IACvC,SAAA,EAAW,QAAA;AAAA,IACX,IAAA,EAAM,6BAAA;AAAA,IACN,OAAA,EAASA,EAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,GAAG;AAAA,GACnC;AACH,CAAC","file":"payment-sessions.js","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.input<typeof paginationInputSchema>\nexport type PaginationParsed = z.output<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'starter', 'growth', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Payment session. A one-shot checkout intent.\n *\n * State machine:\n * created → awaiting_payment → submitted → confirmed\n * \\\n * → failed\n * → expired\n * → cancelled\n */\n\nimport { z } from 'zod'\nimport {\n evmAddressSchema,\n evmTxHashSchema,\n idSchema,\n isoTimestampSchema,\n metadataSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const paymentSessionStatusSchema = z.enum([\n 'created',\n 'awaiting_payment',\n 'submitted',\n 'confirmed',\n 'failed',\n 'expired',\n 'cancelled',\n])\nexport type PaymentSessionStatus = z.infer<typeof paymentSessionStatusSchema>\n\n/**\n * Merchant-supplied callback URL. The hosted checkout dispatches with\n * `window.location.href = redirectUrl` on completion / cancellation,\n * so we MUST reject anything other than `http://` and `https://`.\n *\n * Why this is a real risk: Zod's `.url()` validates RFC syntax, which\n * accepts `javascript:`, `data:`, `vbscript:`, `file:`, blob:`, etc.\n * A compromised merchant integration or an XSS upstream could ship a\n * session whose redirect URL executes script (or exfiltrates session\n * tokens) on every payer's browser. The damage is per-payer, but the\n * blast radius is \"every checkout the merchant runs.\"\n *\n * Mailto / tel and other handler protocols are also rejected — there\n * is no legitimate flow on a payment checkout that would benefit.\n */\nexport const callbackUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://') || v.startsWith('http://'), {\n message: 'must be an http:// or https:// URL',\n })\n\nexport const paymentSessionSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n /**\n * On-chain StrimzRegistry merchant id (uint96) as a decimal string.\n * Set when the merchant has been registered on-chain; null when the\n * merchant exists in our DB but the registry transaction hasn't\n * been broadcast yet. Hosted checkout uses this to populate the\n * meta-tx calldata; if null, the checkout refuses to accept\n * payments.\n */\n chainMerchantId: z\n .string()\n .regex(/^[0-9]+$/u, 'must be a non-negative decimal integer string')\n .nullable(),\n /**\n * ERC-20 token contract address resolved from `currency` on the\n * active chain (Arc Testnet / Mainnet). Used as the `verifyingContract`\n * in the EIP-712 domain for both EIP-3009 and EIP-2612 signing.\n * Null on the (vanishingly unlikely) path where the API has no\n * configured address for the session's currency.\n */\n tokenAddress: evmAddressSchema.nullable(),\n customerId: idSchema.nullable(),\n status: paymentSessionStatusSchema,\n amount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n feeAmount: tokenAmountSchema,\n netAmount: tokenAmountSchema,\n description: z.string().max(500).nullable(),\n payerWalletAddress: evmAddressSchema.nullable(),\n payerEmail: z.string().email().nullable(),\n successUrl: callbackUrlSchema.nullable(),\n cancelUrl: callbackUrlSchema.nullable(),\n sourceChain: z\n .enum(['arc', 'ethereum', 'base', 'polygon', 'arbitrum', 'optimism', 'avalanche', 'solana'])\n .nullable(),\n bridgeTxHash: evmTxHashSchema.nullable(),\n onchainTxHash: evmTxHashSchema.nullable(),\n checkoutUrl: z.string().url(),\n metadata: metadataSchema,\n expiresAt: isoTimestampSchema,\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type PaymentSession = z.infer<typeof paymentSessionSchema>\n\n// ---------- DTOs ----------\n\nexport const createPaymentSessionInputSchema = z.object({\n amount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n description: z.string().max(500).optional(),\n customer: z\n .object({\n walletAddress: evmAddressSchema.optional(),\n email: z.string().email().optional(),\n externalRef: z.string().max(120).optional(),\n })\n .optional(),\n successUrl: callbackUrlSchema.optional(),\n cancelUrl: callbackUrlSchema.optional(),\n /** Minutes until the session expires. Default 30, max 60*24 (one day). */\n expiresInMinutes: z\n .number()\n .int()\n .min(1)\n .max(60 * 24)\n .default(30),\n /**\n * Allowed source chains a payer can bridge USDC from via CCTP. Omit to\n * accept every CCTP-supported chain.\n */\n supportedSourceChains: z\n .array(\n z.enum(['arc', 'ethereum', 'base', 'polygon', 'arbitrum', 'optimism', 'avalanche', 'solana']),\n )\n .optional(),\n metadata: metadataSchema.optional(),\n})\nexport type CreatePaymentSessionInput = z.input<typeof createPaymentSessionInputSchema>\nexport type CreatePaymentSessionParsed = z.output<typeof createPaymentSessionInputSchema>\n\nexport const submitPaymentSessionInputSchema = z.object({\n sourceChain: z.enum([\n 'arc',\n 'ethereum',\n 'base',\n 'polygon',\n 'arbitrum',\n 'optimism',\n 'avalanche',\n 'solana',\n ]),\n onchainTxHash: evmTxHashSchema,\n bridgeTxHash: evmTxHashSchema.optional(),\n payerWalletAddress: evmAddressSchema,\n})\nexport type SubmitPaymentSessionInput = z.input<typeof submitPaymentSessionInputSchema>\nexport type SubmitPaymentSessionParsed = z.output<typeof submitPaymentSessionInputSchema>\n\nexport const checkoutResultErrorCodes = [\n 'load_failed',\n 'merchant_not_ready',\n 'payment_reverted',\n 'unsupported_wallet',\n] as const\nexport const checkoutResultErrorCodeSchema = z.enum(checkoutResultErrorCodes)\nexport type CheckoutResultErrorCode = z.infer<typeof checkoutResultErrorCodeSchema>\n\nexport const checkoutResultMessageSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('strimz:checkout:success'),\n sessionId: idSchema,\n txHash: evmTxHashSchema,\n }),\n z.object({\n type: z.literal('strimz:checkout:cancel'),\n sessionId: idSchema,\n }),\n z.object({\n type: z.literal('strimz:checkout:error'),\n sessionId: idSchema,\n code: checkoutResultErrorCodeSchema,\n message: z.string().min(1).max(500),\n }),\n])\nexport type CheckoutResultMessage = z.infer<typeof checkoutResultMessageSchema>\n"]}
|
package/dist/refunds.d.cts
CHANGED
|
@@ -29,12 +29,12 @@ declare const refundSchema: z.ZodObject<{
|
|
|
29
29
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
30
30
|
}, "strip", z.ZodTypeAny, {
|
|
31
31
|
status: "submitted" | "failed" | "cancelled" | "pending" | "awaiting_signature" | "completed";
|
|
32
|
-
amount: string;
|
|
33
|
-
currency: "USDC" | "EURC";
|
|
34
|
-
merchantId: string;
|
|
35
32
|
id: string;
|
|
36
|
-
|
|
33
|
+
merchantId: string;
|
|
37
34
|
createdAt: string;
|
|
35
|
+
currency: "USDC" | "EURC";
|
|
36
|
+
note: string | null;
|
|
37
|
+
amount: string;
|
|
38
38
|
transactionId: string;
|
|
39
39
|
reason: "customer_request" | "product_issue" | "duplicate_charge" | "fraudulent" | "other";
|
|
40
40
|
payerAddress: string;
|
|
@@ -44,12 +44,12 @@ declare const refundSchema: z.ZodObject<{
|
|
|
44
44
|
completedAt: string | null;
|
|
45
45
|
}, {
|
|
46
46
|
status: "submitted" | "failed" | "cancelled" | "pending" | "awaiting_signature" | "completed";
|
|
47
|
-
amount: string;
|
|
48
|
-
currency: "USDC" | "EURC";
|
|
49
|
-
merchantId: string;
|
|
50
47
|
id: string;
|
|
51
|
-
|
|
48
|
+
merchantId: string;
|
|
52
49
|
createdAt: string;
|
|
50
|
+
currency: "USDC" | "EURC";
|
|
51
|
+
note: string | null;
|
|
52
|
+
amount: string;
|
|
53
53
|
transactionId: string;
|
|
54
54
|
reason: "customer_request" | "product_issue" | "duplicate_charge" | "fraudulent" | "other";
|
|
55
55
|
payerAddress: string;
|
|
@@ -100,15 +100,15 @@ declare const refundSigningInstructionsSchema: z.ZodObject<{
|
|
|
100
100
|
amount: z.ZodString;
|
|
101
101
|
note: z.ZodString;
|
|
102
102
|
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
amount: string;
|
|
104
|
-
to: string;
|
|
105
103
|
note: string;
|
|
106
|
-
token: string;
|
|
107
|
-
}, {
|
|
108
104
|
amount: string;
|
|
105
|
+
token: string;
|
|
109
106
|
to: string;
|
|
107
|
+
}, {
|
|
110
108
|
note: string;
|
|
109
|
+
amount: string;
|
|
111
110
|
token: string;
|
|
111
|
+
to: string;
|
|
112
112
|
}>;
|
|
113
113
|
type RefundSigningInstructions = z.infer<typeof refundSigningInstructionsSchema>;
|
|
114
114
|
declare const refundCreateOutputSchema: z.ZodObject<{
|
|
@@ -129,12 +129,12 @@ declare const refundCreateOutputSchema: z.ZodObject<{
|
|
|
129
129
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
130
130
|
}, "strip", z.ZodTypeAny, {
|
|
131
131
|
status: "submitted" | "failed" | "cancelled" | "pending" | "awaiting_signature" | "completed";
|
|
132
|
-
amount: string;
|
|
133
|
-
currency: "USDC" | "EURC";
|
|
134
|
-
merchantId: string;
|
|
135
132
|
id: string;
|
|
136
|
-
|
|
133
|
+
merchantId: string;
|
|
137
134
|
createdAt: string;
|
|
135
|
+
currency: "USDC" | "EURC";
|
|
136
|
+
note: string | null;
|
|
137
|
+
amount: string;
|
|
138
138
|
transactionId: string;
|
|
139
139
|
reason: "customer_request" | "product_issue" | "duplicate_charge" | "fraudulent" | "other";
|
|
140
140
|
payerAddress: string;
|
|
@@ -144,12 +144,12 @@ declare const refundCreateOutputSchema: z.ZodObject<{
|
|
|
144
144
|
completedAt: string | null;
|
|
145
145
|
}, {
|
|
146
146
|
status: "submitted" | "failed" | "cancelled" | "pending" | "awaiting_signature" | "completed";
|
|
147
|
-
amount: string;
|
|
148
|
-
currency: "USDC" | "EURC";
|
|
149
|
-
merchantId: string;
|
|
150
147
|
id: string;
|
|
151
|
-
|
|
148
|
+
merchantId: string;
|
|
152
149
|
createdAt: string;
|
|
150
|
+
currency: "USDC" | "EURC";
|
|
151
|
+
note: string | null;
|
|
152
|
+
amount: string;
|
|
153
153
|
transactionId: string;
|
|
154
154
|
reason: "customer_request" | "product_issue" | "duplicate_charge" | "fraudulent" | "other";
|
|
155
155
|
payerAddress: string;
|
|
@@ -164,25 +164,25 @@ declare const refundCreateOutputSchema: z.ZodObject<{
|
|
|
164
164
|
amount: z.ZodString;
|
|
165
165
|
note: z.ZodString;
|
|
166
166
|
}, "strip", z.ZodTypeAny, {
|
|
167
|
-
amount: string;
|
|
168
|
-
to: string;
|
|
169
167
|
note: string;
|
|
170
|
-
token: string;
|
|
171
|
-
}, {
|
|
172
168
|
amount: string;
|
|
169
|
+
token: string;
|
|
173
170
|
to: string;
|
|
171
|
+
}, {
|
|
174
172
|
note: string;
|
|
173
|
+
amount: string;
|
|
175
174
|
token: string;
|
|
175
|
+
to: string;
|
|
176
176
|
}>;
|
|
177
177
|
}, "strip", z.ZodTypeAny, {
|
|
178
178
|
refund: {
|
|
179
179
|
status: "submitted" | "failed" | "cancelled" | "pending" | "awaiting_signature" | "completed";
|
|
180
|
-
amount: string;
|
|
181
|
-
currency: "USDC" | "EURC";
|
|
182
|
-
merchantId: string;
|
|
183
180
|
id: string;
|
|
184
|
-
|
|
181
|
+
merchantId: string;
|
|
185
182
|
createdAt: string;
|
|
183
|
+
currency: "USDC" | "EURC";
|
|
184
|
+
note: string | null;
|
|
185
|
+
amount: string;
|
|
186
186
|
transactionId: string;
|
|
187
187
|
reason: "customer_request" | "product_issue" | "duplicate_charge" | "fraudulent" | "other";
|
|
188
188
|
payerAddress: string;
|
|
@@ -192,20 +192,20 @@ declare const refundCreateOutputSchema: z.ZodObject<{
|
|
|
192
192
|
completedAt: string | null;
|
|
193
193
|
};
|
|
194
194
|
signingInstructions: {
|
|
195
|
-
amount: string;
|
|
196
|
-
to: string;
|
|
197
195
|
note: string;
|
|
196
|
+
amount: string;
|
|
198
197
|
token: string;
|
|
198
|
+
to: string;
|
|
199
199
|
};
|
|
200
200
|
}, {
|
|
201
201
|
refund: {
|
|
202
202
|
status: "submitted" | "failed" | "cancelled" | "pending" | "awaiting_signature" | "completed";
|
|
203
|
-
amount: string;
|
|
204
|
-
currency: "USDC" | "EURC";
|
|
205
|
-
merchantId: string;
|
|
206
203
|
id: string;
|
|
207
|
-
|
|
204
|
+
merchantId: string;
|
|
208
205
|
createdAt: string;
|
|
206
|
+
currency: "USDC" | "EURC";
|
|
207
|
+
note: string | null;
|
|
208
|
+
amount: string;
|
|
209
209
|
transactionId: string;
|
|
210
210
|
reason: "customer_request" | "product_issue" | "duplicate_charge" | "fraudulent" | "other";
|
|
211
211
|
payerAddress: string;
|
|
@@ -215,10 +215,10 @@ declare const refundCreateOutputSchema: z.ZodObject<{
|
|
|
215
215
|
completedAt: string | null;
|
|
216
216
|
};
|
|
217
217
|
signingInstructions: {
|
|
218
|
-
amount: string;
|
|
219
|
-
to: string;
|
|
220
218
|
note: string;
|
|
219
|
+
amount: string;
|
|
221
220
|
token: string;
|
|
221
|
+
to: string;
|
|
222
222
|
};
|
|
223
223
|
}>;
|
|
224
224
|
type RefundCreateOutput = z.infer<typeof refundCreateOutputSchema>;
|