@paygentic/sdk 0.6.11 → 0.6.13
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 +16 -5
- package/dist/commonjs/funcs/billableMetricsMeter.d.ts +19 -0
- package/dist/commonjs/funcs/billableMetricsMeter.d.ts.map +1 -0
- package/dist/commonjs/funcs/billableMetricsMeter.js +133 -0
- package/dist/commonjs/funcs/billableMetricsMeter.js.map +1 -0
- package/dist/commonjs/funcs/customersDelete.d.ts +15 -0
- package/dist/commonjs/funcs/customersDelete.d.ts.map +1 -0
- package/dist/commonjs/funcs/customersDelete.js +121 -0
- package/dist/commonjs/funcs/customersDelete.js.map +1 -0
- package/dist/commonjs/funcs/entitlementsList.js +1 -0
- package/dist/commonjs/funcs/entitlementsList.js.map +1 -1
- package/dist/commonjs/funcs/paymentsCreate.d.ts +19 -0
- package/dist/commonjs/funcs/paymentsCreate.d.ts.map +1 -0
- package/dist/commonjs/funcs/paymentsCreate.js +119 -0
- package/dist/commonjs/funcs/paymentsCreate.js.map +1 -0
- package/dist/commonjs/funcs/paymentsGet.d.ts +19 -0
- package/dist/commonjs/funcs/paymentsGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/paymentsGet.js +124 -0
- package/dist/commonjs/funcs/paymentsGet.js.map +1 -0
- package/dist/commonjs/funcs/paymentsList.d.ts +18 -0
- package/dist/commonjs/funcs/paymentsList.d.ts.map +1 -0
- package/dist/commonjs/funcs/paymentsList.js +125 -0
- package/dist/commonjs/funcs/paymentsList.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/matchers.d.ts.map +1 -1
- package/dist/commonjs/lib/matchers.js +0 -1
- package/dist/commonjs/lib/matchers.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +1 -2
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +2 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/operations/createpayment.d.ts +113 -0
- package/dist/commonjs/models/operations/createpayment.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createpayment.js +82 -0
- package/dist/commonjs/models/operations/createpayment.js.map +1 -0
- package/dist/commonjs/models/operations/createpaymentsession.d.ts +113 -0
- package/dist/commonjs/models/operations/createpaymentsession.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createpaymentsession.js +82 -0
- package/dist/commonjs/models/operations/createpaymentsession.js.map +1 -0
- package/dist/commonjs/models/operations/createplan.d.ts +18 -0
- package/dist/commonjs/models/operations/createplan.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createplan.js +11 -1
- package/dist/commonjs/models/operations/createplan.js.map +1 -1
- package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts +57 -0
- package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getbillablemetricmeter.js +66 -0
- package/dist/commonjs/models/operations/getbillablemetricmeter.js.map +1 -0
- package/dist/commonjs/models/operations/getpayment.d.ts +15 -0
- package/dist/commonjs/models/operations/getpayment.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getpayment.js +49 -0
- package/dist/commonjs/models/operations/getpayment.js.map +1 -0
- package/dist/commonjs/models/operations/getpaymentsession.d.ts +15 -0
- package/dist/commonjs/models/operations/getpaymentsession.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getpaymentsession.js +49 -0
- package/dist/commonjs/models/operations/getpaymentsession.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +4 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +4 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listentitlements.d.ts +5 -0
- package/dist/commonjs/models/operations/listentitlements.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listentitlements.js +1 -0
- package/dist/commonjs/models/operations/listentitlements.js.map +1 -1
- package/dist/commonjs/models/operations/listpayments.d.ts +75 -0
- package/dist/commonjs/models/operations/listpayments.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listpayments.js +82 -0
- package/dist/commonjs/models/operations/listpayments.js.map +1 -0
- package/dist/commonjs/models/operations/listpaymentsessions.d.ts +75 -0
- package/dist/commonjs/models/operations/listpaymentsessions.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listpaymentsessions.js +82 -0
- package/dist/commonjs/models/operations/listpaymentsessions.js.map +1 -0
- package/dist/commonjs/models/payment.d.ts +91 -0
- package/dist/commonjs/models/payment.d.ts.map +1 -0
- package/dist/commonjs/models/payment.js +90 -0
- package/dist/commonjs/models/payment.js.map +1 -0
- package/dist/commonjs/models/subscription.d.ts +8 -4
- package/dist/commonjs/models/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/subscription.js +7 -6
- package/dist/commonjs/models/subscription.js.map +1 -1
- package/dist/commonjs/models/usageresponse.d.ts +50 -0
- package/dist/commonjs/models/usageresponse.d.ts.map +1 -0
- package/dist/commonjs/models/usageresponse.js +78 -0
- package/dist/commonjs/models/usageresponse.js.map +1 -0
- package/dist/commonjs/sdk/billablemetrics.d.ts +7 -0
- package/dist/commonjs/sdk/billablemetrics.d.ts.map +1 -1
- package/dist/commonjs/sdk/billablemetrics.js +10 -0
- package/dist/commonjs/sdk/billablemetrics.js.map +1 -1
- package/dist/commonjs/sdk/customers.d.ts +1 -1
- package/dist/commonjs/sdk/customers.d.ts.map +1 -1
- package/dist/commonjs/sdk/customers.js +3 -3
- package/dist/commonjs/sdk/customers.js.map +1 -1
- package/dist/commonjs/sdk/payments.d.ts +27 -0
- package/dist/commonjs/sdk/payments.d.ts.map +1 -0
- package/dist/commonjs/sdk/payments.js +42 -0
- package/dist/commonjs/sdk/payments.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/billableMetricsMeter.d.ts +19 -0
- package/dist/esm/funcs/billableMetricsMeter.d.ts.map +1 -0
- package/dist/esm/funcs/billableMetricsMeter.js +97 -0
- package/dist/esm/funcs/billableMetricsMeter.js.map +1 -0
- package/dist/esm/funcs/customersDelete.d.ts +15 -0
- package/dist/esm/funcs/customersDelete.d.ts.map +1 -0
- package/dist/esm/funcs/customersDelete.js +85 -0
- package/dist/esm/funcs/customersDelete.js.map +1 -0
- package/dist/esm/funcs/entitlementsList.js +1 -0
- package/dist/esm/funcs/entitlementsList.js.map +1 -1
- package/dist/esm/funcs/paymentsCreate.d.ts +19 -0
- package/dist/esm/funcs/paymentsCreate.d.ts.map +1 -0
- package/dist/esm/funcs/paymentsCreate.js +83 -0
- package/dist/esm/funcs/paymentsCreate.js.map +1 -0
- package/dist/esm/funcs/paymentsGet.d.ts +19 -0
- package/dist/esm/funcs/paymentsGet.d.ts.map +1 -0
- package/dist/esm/funcs/paymentsGet.js +88 -0
- package/dist/esm/funcs/paymentsGet.js.map +1 -0
- package/dist/esm/funcs/paymentsList.d.ts +18 -0
- package/dist/esm/funcs/paymentsList.d.ts.map +1 -0
- package/dist/esm/funcs/paymentsList.js +89 -0
- package/dist/esm/funcs/paymentsList.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/matchers.d.ts.map +1 -1
- package/dist/esm/lib/matchers.js +0 -1
- package/dist/esm/lib/matchers.js.map +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +1 -2
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/operations/createpayment.d.ts +113 -0
- package/dist/esm/models/operations/createpayment.d.ts.map +1 -0
- package/dist/esm/models/operations/createpayment.js +44 -0
- package/dist/esm/models/operations/createpayment.js.map +1 -0
- package/dist/esm/models/operations/createpaymentsession.d.ts +113 -0
- package/dist/esm/models/operations/createpaymentsession.d.ts.map +1 -0
- package/dist/esm/models/operations/createpaymentsession.js +44 -0
- package/dist/esm/models/operations/createpaymentsession.js.map +1 -0
- package/dist/esm/models/operations/createplan.d.ts +18 -0
- package/dist/esm/models/operations/createplan.d.ts.map +1 -1
- package/dist/esm/models/operations/createplan.js +10 -0
- package/dist/esm/models/operations/createplan.js.map +1 -1
- package/dist/esm/models/operations/getbillablemetricmeter.d.ts +57 -0
- package/dist/esm/models/operations/getbillablemetricmeter.d.ts.map +1 -0
- package/dist/esm/models/operations/getbillablemetricmeter.js +29 -0
- package/dist/esm/models/operations/getbillablemetricmeter.js.map +1 -0
- package/dist/esm/models/operations/getpayment.d.ts +15 -0
- package/dist/esm/models/operations/getpayment.d.ts.map +1 -0
- package/dist/esm/models/operations/getpayment.js +12 -0
- package/dist/esm/models/operations/getpayment.js.map +1 -0
- package/dist/esm/models/operations/getpaymentsession.d.ts +15 -0
- package/dist/esm/models/operations/getpaymentsession.d.ts.map +1 -0
- package/dist/esm/models/operations/getpaymentsession.js +12 -0
- package/dist/esm/models/operations/getpaymentsession.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +4 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +4 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listentitlements.d.ts +5 -0
- package/dist/esm/models/operations/listentitlements.d.ts.map +1 -1
- package/dist/esm/models/operations/listentitlements.js +1 -0
- package/dist/esm/models/operations/listentitlements.js.map +1 -1
- package/dist/esm/models/operations/listpayments.d.ts +75 -0
- package/dist/esm/models/operations/listpayments.d.ts.map +1 -0
- package/dist/esm/models/operations/listpayments.js +44 -0
- package/dist/esm/models/operations/listpayments.js.map +1 -0
- package/dist/esm/models/operations/listpaymentsessions.d.ts +75 -0
- package/dist/esm/models/operations/listpaymentsessions.d.ts.map +1 -0
- package/dist/esm/models/operations/listpaymentsessions.js +44 -0
- package/dist/esm/models/operations/listpaymentsessions.js.map +1 -0
- package/dist/esm/models/payment.d.ts +91 -0
- package/dist/esm/models/payment.d.ts.map +1 -0
- package/dist/esm/models/payment.js +52 -0
- package/dist/esm/models/payment.js.map +1 -0
- package/dist/esm/models/subscription.d.ts +8 -4
- package/dist/esm/models/subscription.d.ts.map +1 -1
- package/dist/esm/models/subscription.js +5 -4
- package/dist/esm/models/subscription.js.map +1 -1
- package/dist/esm/models/usageresponse.d.ts +50 -0
- package/dist/esm/models/usageresponse.d.ts.map +1 -0
- package/dist/esm/models/usageresponse.js +39 -0
- package/dist/esm/models/usageresponse.js.map +1 -0
- package/dist/esm/sdk/billablemetrics.d.ts +7 -0
- package/dist/esm/sdk/billablemetrics.d.ts.map +1 -1
- package/dist/esm/sdk/billablemetrics.js +10 -0
- package/dist/esm/sdk/billablemetrics.js.map +1 -1
- package/dist/esm/sdk/customers.d.ts +1 -1
- package/dist/esm/sdk/customers.d.ts.map +1 -1
- package/dist/esm/sdk/customers.js +3 -3
- package/dist/esm/sdk/customers.js.map +1 -1
- package/dist/esm/sdk/payments.d.ts +27 -0
- package/dist/esm/sdk/payments.d.ts.map +1 -0
- package/dist/esm/sdk/payments.js +38 -0
- package/dist/esm/sdk/payments.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/billableMetricsMeter.ts +192 -0
- package/src/funcs/customersDelete.ts +178 -0
- package/src/funcs/entitlementsList.ts +1 -0
- package/src/funcs/paymentsCreate.ts +175 -0
- package/src/funcs/paymentsGet.ts +177 -0
- package/src/funcs/paymentsList.ts +179 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/matchers.ts +3 -2
- package/src/lib/security.ts +1 -2
- package/src/models/index.ts +2 -0
- package/src/models/operations/createpayment.ts +156 -0
- package/src/models/operations/createpaymentsession.ts +158 -0
- package/src/models/operations/createplan.ts +23 -0
- package/src/models/operations/getbillablemetricmeter.ts +87 -0
- package/src/models/operations/getpayment.ts +34 -0
- package/src/models/operations/getpaymentsession.ts +34 -0
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/listentitlements.ts +6 -0
- package/src/models/operations/listpayments.ts +126 -0
- package/src/models/operations/listpaymentsessions.ts +130 -0
- package/src/models/payment.ts +149 -0
- package/src/models/subscription.ts +24 -16
- package/src/models/usageresponse.ts +116 -0
- package/src/sdk/billablemetrics.ts +18 -0
- package/src/sdk/customers.ts +3 -3
- package/src/sdk/payments.ts +64 -0
- package/src/sdk/sdk.ts +6 -0
- package/.devcontainer/devcontainer.json +0 -45
- package/examples/package-lock.json +0 -612
- package/examples/package.json +0 -18
- package/tsconfig.json +0 -40
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ISO 4217 currency code.
|
|
10
|
+
*/
|
|
11
|
+
export const Currency = {
|
|
12
|
+
Usd: "USD",
|
|
13
|
+
Eur: "EUR",
|
|
14
|
+
Gbp: "GBP",
|
|
15
|
+
Aud: "AUD",
|
|
16
|
+
} as const;
|
|
17
|
+
/**
|
|
18
|
+
* ISO 4217 currency code.
|
|
19
|
+
*/
|
|
20
|
+
export type Currency = ClosedEnum<typeof Currency>;
|
|
21
|
+
|
|
22
|
+
export type LineItem = {
|
|
23
|
+
/**
|
|
24
|
+
* Line item description.
|
|
25
|
+
*/
|
|
26
|
+
description: string;
|
|
27
|
+
/**
|
|
28
|
+
* Line item amount in decimal format (e.g. '5.00').
|
|
29
|
+
*/
|
|
30
|
+
amount: string;
|
|
31
|
+
/**
|
|
32
|
+
* Quantity of this line item. Defaults to 1.
|
|
33
|
+
*/
|
|
34
|
+
quantity?: number | undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type CreatePaymentSessionRequest = {
|
|
38
|
+
/**
|
|
39
|
+
* Payment amount in decimal format (e.g. '10.50'). Minimum 1.00, maximum 5,000.00. Contact support for higher limits.
|
|
40
|
+
*/
|
|
41
|
+
amount: string;
|
|
42
|
+
/**
|
|
43
|
+
* ISO 4217 currency code.
|
|
44
|
+
*/
|
|
45
|
+
currency: Currency;
|
|
46
|
+
/**
|
|
47
|
+
* Merchant organization ID. Required when using an API key that is not scoped to a single merchant.
|
|
48
|
+
*/
|
|
49
|
+
merchantId?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Optional customer ID. Must belong to this merchant.
|
|
52
|
+
*/
|
|
53
|
+
customerId?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Client-provided key for safe retries. If a payment with the same key already exists, the existing payment is returned.
|
|
56
|
+
*/
|
|
57
|
+
idempotencyKey?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Merchant-defined reference for this payment (e.g. order ID, invoice number).
|
|
60
|
+
*/
|
|
61
|
+
reference?: string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Arbitrary key-value string pairs to attach to the payment.
|
|
64
|
+
*/
|
|
65
|
+
metadata?: { [k: string]: string } | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Optional breakdown of what the customer is being charged for.
|
|
68
|
+
*/
|
|
69
|
+
lineItems?: Array<LineItem> | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* URL to redirect the customer to after a successful payment.
|
|
72
|
+
*/
|
|
73
|
+
successRedirectUrl?: string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* URL to redirect the customer to after a failed payment.
|
|
76
|
+
*/
|
|
77
|
+
failureRedirectUrl?: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Whether to save the customer's payment method for future use. Defaults to false.
|
|
80
|
+
*/
|
|
81
|
+
savePaymentMethod?: boolean | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* ISO 8601 duration for the payment lifetime. Defaults to P30D (30 days). Maximum is P31D (31 days). Examples: PT1H, P1D, P7D, P30D.
|
|
84
|
+
*/
|
|
85
|
+
expiresIn?: string | undefined;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const Currency$outboundSchema: z.ZodNativeEnum<typeof Currency> = z
|
|
90
|
+
.nativeEnum(Currency);
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export type LineItem$Outbound = {
|
|
94
|
+
description: string;
|
|
95
|
+
amount: string;
|
|
96
|
+
quantity: number;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export const LineItem$outboundSchema: z.ZodType<
|
|
101
|
+
LineItem$Outbound,
|
|
102
|
+
z.ZodTypeDef,
|
|
103
|
+
LineItem
|
|
104
|
+
> = z.object({
|
|
105
|
+
description: z.string(),
|
|
106
|
+
amount: z.string(),
|
|
107
|
+
quantity: z.number().int().default(1),
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export function lineItemToJSON(lineItem: LineItem): string {
|
|
111
|
+
return JSON.stringify(LineItem$outboundSchema.parse(lineItem));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** @internal */
|
|
115
|
+
export type CreatePaymentSessionRequest$Outbound = {
|
|
116
|
+
amount: string;
|
|
117
|
+
currency: string;
|
|
118
|
+
merchantId?: string | undefined;
|
|
119
|
+
customerId?: string | undefined;
|
|
120
|
+
idempotencyKey?: string | undefined;
|
|
121
|
+
reference?: string | undefined;
|
|
122
|
+
metadata?: { [k: string]: string } | undefined;
|
|
123
|
+
lineItems?: Array<LineItem$Outbound> | undefined;
|
|
124
|
+
successRedirectUrl?: string | undefined;
|
|
125
|
+
failureRedirectUrl?: string | undefined;
|
|
126
|
+
savePaymentMethod: boolean;
|
|
127
|
+
expiresIn?: string | undefined;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/** @internal */
|
|
131
|
+
export const CreatePaymentSessionRequest$outboundSchema: z.ZodType<
|
|
132
|
+
CreatePaymentSessionRequest$Outbound,
|
|
133
|
+
z.ZodTypeDef,
|
|
134
|
+
CreatePaymentSessionRequest
|
|
135
|
+
> = z.object({
|
|
136
|
+
amount: z.string(),
|
|
137
|
+
currency: Currency$outboundSchema,
|
|
138
|
+
merchantId: z.string().optional(),
|
|
139
|
+
customerId: z.string().optional(),
|
|
140
|
+
idempotencyKey: z.string().optional(),
|
|
141
|
+
reference: z.string().optional(),
|
|
142
|
+
metadata: z.record(z.string()).optional(),
|
|
143
|
+
lineItems: z.array(z.lazy(() => LineItem$outboundSchema)).optional(),
|
|
144
|
+
successRedirectUrl: z.string().optional(),
|
|
145
|
+
failureRedirectUrl: z.string().optional(),
|
|
146
|
+
savePaymentMethod: z.boolean().default(false),
|
|
147
|
+
expiresIn: z.string().optional(),
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
export function createPaymentSessionRequestToJSON(
|
|
151
|
+
createPaymentSessionRequest: CreatePaymentSessionRequest,
|
|
152
|
+
): string {
|
|
153
|
+
return JSON.stringify(
|
|
154
|
+
CreatePaymentSessionRequest$outboundSchema.parse(
|
|
155
|
+
createPaymentSessionRequest,
|
|
156
|
+
),
|
|
157
|
+
);
|
|
158
|
+
}
|
|
@@ -17,6 +17,18 @@ export const CreatePlanTaxBehavior = {
|
|
|
17
17
|
*/
|
|
18
18
|
export type CreatePlanTaxBehavior = ClosedEnum<typeof CreatePlanTaxBehavior>;
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Billing engine version. 0 = legacy fee-schedule billing (Legacy), 1 = line-item billing with metered usage support (Standard).
|
|
22
|
+
*/
|
|
23
|
+
export const BillingVersion = {
|
|
24
|
+
Zero: 0,
|
|
25
|
+
One: 1,
|
|
26
|
+
} as const;
|
|
27
|
+
/**
|
|
28
|
+
* Billing engine version. 0 = legacy fee-schedule billing (Legacy), 1 = line-item billing with metered usage support (Standard).
|
|
29
|
+
*/
|
|
30
|
+
export type BillingVersion = ClosedEnum<typeof BillingVersion>;
|
|
31
|
+
|
|
20
32
|
export type CreatePlanRequest = {
|
|
21
33
|
/**
|
|
22
34
|
* Recurring billing period frequency. Sample values: 'monthly' for monthly billing, 'yearly' for annual billing, 'weekly' for weekly billing
|
|
@@ -70,6 +82,10 @@ export type CreatePlanRequest = {
|
|
|
70
82
|
* Number of days before renewal to send the reminder email
|
|
71
83
|
*/
|
|
72
84
|
renewalReminderDays?: number | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Billing engine version. 0 = legacy fee-schedule billing (Legacy), 1 = line-item billing with metered usage support (Standard).
|
|
87
|
+
*/
|
|
88
|
+
billingVersion?: BillingVersion | undefined;
|
|
73
89
|
};
|
|
74
90
|
|
|
75
91
|
/** @internal */
|
|
@@ -77,6 +93,11 @@ export const CreatePlanTaxBehavior$outboundSchema: z.ZodNativeEnum<
|
|
|
77
93
|
typeof CreatePlanTaxBehavior
|
|
78
94
|
> = z.nativeEnum(CreatePlanTaxBehavior);
|
|
79
95
|
|
|
96
|
+
/** @internal */
|
|
97
|
+
export const BillingVersion$outboundSchema: z.ZodNativeEnum<
|
|
98
|
+
typeof BillingVersion
|
|
99
|
+
> = z.nativeEnum(BillingVersion);
|
|
100
|
+
|
|
80
101
|
/** @internal */
|
|
81
102
|
export type CreatePlanRequest$Outbound = {
|
|
82
103
|
billingInterval?: string | undefined;
|
|
@@ -92,6 +113,7 @@ export type CreatePlanRequest$Outbound = {
|
|
|
92
113
|
taxBehavior: string;
|
|
93
114
|
renewalReminderEnabled: boolean;
|
|
94
115
|
renewalReminderDays: number;
|
|
116
|
+
billingVersion: number;
|
|
95
117
|
};
|
|
96
118
|
|
|
97
119
|
/** @internal */
|
|
@@ -113,6 +135,7 @@ export const CreatePlanRequest$outboundSchema: z.ZodType<
|
|
|
113
135
|
taxBehavior: CreatePlanTaxBehavior$outboundSchema.default("exclusive"),
|
|
114
136
|
renewalReminderEnabled: z.boolean().default(true),
|
|
115
137
|
renewalReminderDays: z.number().int().default(3),
|
|
138
|
+
billingVersion: BillingVersion$outboundSchema.default(0),
|
|
116
139
|
});
|
|
117
140
|
|
|
118
141
|
export function createPlanRequestToJSON(
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Time bucket granularity
|
|
10
|
+
*/
|
|
11
|
+
export const WindowSize = {
|
|
12
|
+
Minute: "MINUTE",
|
|
13
|
+
Hour: "HOUR",
|
|
14
|
+
Day: "DAY",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* Time bucket granularity
|
|
18
|
+
*/
|
|
19
|
+
export type WindowSize = ClosedEnum<typeof WindowSize>;
|
|
20
|
+
|
|
21
|
+
export type GetBillableMetricMeterRequest = {
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* Start of query window (ISO 8601)
|
|
25
|
+
*/
|
|
26
|
+
from: Date;
|
|
27
|
+
/**
|
|
28
|
+
* End of query window (ISO 8601)
|
|
29
|
+
*/
|
|
30
|
+
to: Date;
|
|
31
|
+
/**
|
|
32
|
+
* Filter by customer/user ID
|
|
33
|
+
*/
|
|
34
|
+
subject?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Time bucket granularity
|
|
37
|
+
*/
|
|
38
|
+
windowSize?: WindowSize | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* JSON-encoded dimension filter (e.g. {"key":"value"})
|
|
41
|
+
*/
|
|
42
|
+
filterGroupBy?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Comma-separated dimension keys
|
|
45
|
+
*/
|
|
46
|
+
groupBy?: string | undefined;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const WindowSize$outboundSchema: z.ZodNativeEnum<typeof WindowSize> = z
|
|
51
|
+
.nativeEnum(WindowSize);
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type GetBillableMetricMeterRequest$Outbound = {
|
|
55
|
+
id: string;
|
|
56
|
+
from: string;
|
|
57
|
+
to: string;
|
|
58
|
+
subject?: string | undefined;
|
|
59
|
+
windowSize?: string | undefined;
|
|
60
|
+
filterGroupBy?: string | undefined;
|
|
61
|
+
groupBy?: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const GetBillableMetricMeterRequest$outboundSchema: z.ZodType<
|
|
66
|
+
GetBillableMetricMeterRequest$Outbound,
|
|
67
|
+
z.ZodTypeDef,
|
|
68
|
+
GetBillableMetricMeterRequest
|
|
69
|
+
> = z.object({
|
|
70
|
+
id: z.string(),
|
|
71
|
+
from: z.date().transform(v => v.toISOString()),
|
|
72
|
+
to: z.date().transform(v => v.toISOString()),
|
|
73
|
+
subject: z.string().optional(),
|
|
74
|
+
windowSize: WindowSize$outboundSchema.optional(),
|
|
75
|
+
filterGroupBy: z.string().optional(),
|
|
76
|
+
groupBy: z.string().optional(),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export function getBillableMetricMeterRequestToJSON(
|
|
80
|
+
getBillableMetricMeterRequest: GetBillableMetricMeterRequest,
|
|
81
|
+
): string {
|
|
82
|
+
return JSON.stringify(
|
|
83
|
+
GetBillableMetricMeterRequest$outboundSchema.parse(
|
|
84
|
+
getBillableMetricMeterRequest,
|
|
85
|
+
),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
|
|
7
|
+
export type GetPaymentRequest = {
|
|
8
|
+
/**
|
|
9
|
+
* Payment session ID
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type GetPaymentRequest$Outbound = {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const GetPaymentRequest$outboundSchema: z.ZodType<
|
|
21
|
+
GetPaymentRequest$Outbound,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
GetPaymentRequest
|
|
24
|
+
> = z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function getPaymentRequestToJSON(
|
|
29
|
+
getPaymentRequest: GetPaymentRequest,
|
|
30
|
+
): string {
|
|
31
|
+
return JSON.stringify(
|
|
32
|
+
GetPaymentRequest$outboundSchema.parse(getPaymentRequest),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
|
|
7
|
+
export type GetPaymentSessionRequest = {
|
|
8
|
+
/**
|
|
9
|
+
* Payment session ID
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type GetPaymentSessionRequest$Outbound = {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const GetPaymentSessionRequest$outboundSchema: z.ZodType<
|
|
21
|
+
GetPaymentSessionRequest$Outbound,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
GetPaymentSessionRequest
|
|
24
|
+
> = z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function getPaymentSessionRequestToJSON(
|
|
29
|
+
getPaymentSessionRequest: GetPaymentSessionRequest,
|
|
30
|
+
): string {
|
|
31
|
+
return JSON.stringify(
|
|
32
|
+
GetPaymentSessionRequest$outboundSchema.parse(getPaymentSessionRequest),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -11,6 +11,7 @@ export * from "./createbillablemetric.js";
|
|
|
11
11
|
export * from "./createcustomer.js";
|
|
12
12
|
export * from "./createfeature.js";
|
|
13
13
|
export * from "./createfee.js";
|
|
14
|
+
export * from "./createpayment.js";
|
|
14
15
|
export * from "./createplan.js";
|
|
15
16
|
export * from "./createprice.js";
|
|
16
17
|
export * from "./createproduct.js";
|
|
@@ -26,6 +27,7 @@ export * from "./deletetestclock.js";
|
|
|
26
27
|
export * from "./generateportallink.js";
|
|
27
28
|
export * from "./getactiveentitlements.js";
|
|
28
29
|
export * from "./getbillablemetric.js";
|
|
30
|
+
export * from "./getbillablemetricmeter.js";
|
|
29
31
|
export * from "./getcustomer.js";
|
|
30
32
|
export * from "./getentitlement.js";
|
|
31
33
|
export * from "./getfeature.js";
|
|
@@ -33,6 +35,7 @@ export * from "./getfee.js";
|
|
|
33
35
|
export * from "./getfeeprice.js";
|
|
34
36
|
export * from "./getinvoice.js";
|
|
35
37
|
export * from "./getinvoicelineitems.js";
|
|
38
|
+
export * from "./getpayment.js";
|
|
36
39
|
export * from "./getplan.js";
|
|
37
40
|
export * from "./getprice.js";
|
|
38
41
|
export * from "./getproduct.js";
|
|
@@ -52,6 +55,7 @@ export * from "./listentitlements.js";
|
|
|
52
55
|
export * from "./listfeatures.js";
|
|
53
56
|
export * from "./listfees.js";
|
|
54
57
|
export * from "./listinvoices.js";
|
|
58
|
+
export * from "./listpayments.js";
|
|
55
59
|
export * from "./listplans.js";
|
|
56
60
|
export * from "./listprices.js";
|
|
57
61
|
export * from "./listproducts.js";
|
|
@@ -22,6 +22,10 @@ export type ListEntitlementsRequest = {
|
|
|
22
22
|
* Filter results to entitlements for a specific product. Required when `featureKey` is specified since feature keys are scoped to products.
|
|
23
23
|
*/
|
|
24
24
|
productId?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Filter results to entitlements for a specific subscription.
|
|
27
|
+
*/
|
|
28
|
+
subscriptionId?: string | undefined;
|
|
25
29
|
/**
|
|
26
30
|
* Maximum number of entitlements to return per page. Use with `offset` for pagination.
|
|
27
31
|
*/
|
|
@@ -57,6 +61,7 @@ export type ListEntitlementsRequest$Outbound = {
|
|
|
57
61
|
customerId: string;
|
|
58
62
|
featureKey?: string | undefined;
|
|
59
63
|
productId?: string | undefined;
|
|
64
|
+
subscriptionId?: string | undefined;
|
|
60
65
|
limit: number;
|
|
61
66
|
offset: number;
|
|
62
67
|
};
|
|
@@ -70,6 +75,7 @@ export const ListEntitlementsRequest$outboundSchema: z.ZodType<
|
|
|
70
75
|
customerId: z.string(),
|
|
71
76
|
featureKey: z.string().optional(),
|
|
72
77
|
productId: z.string().optional(),
|
|
78
|
+
subscriptionId: z.string().optional(),
|
|
73
79
|
limit: z.number().int().default(10),
|
|
74
80
|
offset: z.number().int().default(0),
|
|
75
81
|
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import * as models from "../index.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Filter by payment status.
|
|
14
|
+
*/
|
|
15
|
+
export const ListPaymentsStatus = {
|
|
16
|
+
Pending: "pending",
|
|
17
|
+
Processing: "processing",
|
|
18
|
+
Completed: "completed",
|
|
19
|
+
Expired: "expired",
|
|
20
|
+
Cancelled: "cancelled",
|
|
21
|
+
} as const;
|
|
22
|
+
/**
|
|
23
|
+
* Filter by payment status.
|
|
24
|
+
*/
|
|
25
|
+
export type ListPaymentsStatus = ClosedEnum<typeof ListPaymentsStatus>;
|
|
26
|
+
|
|
27
|
+
export type ListPaymentsRequest = {
|
|
28
|
+
/**
|
|
29
|
+
* Merchant organization ID. Required when using an API key that is not scoped to a single merchant.
|
|
30
|
+
*/
|
|
31
|
+
merchantId?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Filter by payment status.
|
|
34
|
+
*/
|
|
35
|
+
status?: ListPaymentsStatus | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Filter by customer ID.
|
|
38
|
+
*/
|
|
39
|
+
customerId?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Number of payments to return.
|
|
42
|
+
*/
|
|
43
|
+
limit?: number | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Number of payments to skip.
|
|
46
|
+
*/
|
|
47
|
+
offset?: number | undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const ListPaymentsObject = {
|
|
51
|
+
List: "list",
|
|
52
|
+
} as const;
|
|
53
|
+
export type ListPaymentsObject = ClosedEnum<typeof ListPaymentsObject>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* List of payments
|
|
57
|
+
*/
|
|
58
|
+
export type ListPaymentsResponse = {
|
|
59
|
+
object: ListPaymentsObject;
|
|
60
|
+
data: Array<models.Payment>;
|
|
61
|
+
/**
|
|
62
|
+
* Offset-based pagination response.
|
|
63
|
+
*/
|
|
64
|
+
pagination: models.OffsetPagination;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const ListPaymentsStatus$outboundSchema: z.ZodNativeEnum<
|
|
69
|
+
typeof ListPaymentsStatus
|
|
70
|
+
> = z.nativeEnum(ListPaymentsStatus);
|
|
71
|
+
|
|
72
|
+
/** @internal */
|
|
73
|
+
export type ListPaymentsRequest$Outbound = {
|
|
74
|
+
merchantId?: string | undefined;
|
|
75
|
+
status?: string | undefined;
|
|
76
|
+
customerId?: string | undefined;
|
|
77
|
+
limit: number;
|
|
78
|
+
offset: number;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** @internal */
|
|
82
|
+
export const ListPaymentsRequest$outboundSchema: z.ZodType<
|
|
83
|
+
ListPaymentsRequest$Outbound,
|
|
84
|
+
z.ZodTypeDef,
|
|
85
|
+
ListPaymentsRequest
|
|
86
|
+
> = z.object({
|
|
87
|
+
merchantId: z.string().optional(),
|
|
88
|
+
status: ListPaymentsStatus$outboundSchema.optional(),
|
|
89
|
+
customerId: z.string().optional(),
|
|
90
|
+
limit: z.number().int().default(10),
|
|
91
|
+
offset: z.number().int().default(0),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export function listPaymentsRequestToJSON(
|
|
95
|
+
listPaymentsRequest: ListPaymentsRequest,
|
|
96
|
+
): string {
|
|
97
|
+
return JSON.stringify(
|
|
98
|
+
ListPaymentsRequest$outboundSchema.parse(listPaymentsRequest),
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** @internal */
|
|
103
|
+
export const ListPaymentsObject$inboundSchema: z.ZodNativeEnum<
|
|
104
|
+
typeof ListPaymentsObject
|
|
105
|
+
> = z.nativeEnum(ListPaymentsObject);
|
|
106
|
+
|
|
107
|
+
/** @internal */
|
|
108
|
+
export const ListPaymentsResponse$inboundSchema: z.ZodType<
|
|
109
|
+
ListPaymentsResponse,
|
|
110
|
+
z.ZodTypeDef,
|
|
111
|
+
unknown
|
|
112
|
+
> = z.object({
|
|
113
|
+
object: ListPaymentsObject$inboundSchema,
|
|
114
|
+
data: z.array(models.Payment$inboundSchema),
|
|
115
|
+
pagination: models.OffsetPagination$inboundSchema,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export function listPaymentsResponseFromJSON(
|
|
119
|
+
jsonString: string,
|
|
120
|
+
): SafeParseResult<ListPaymentsResponse, SDKValidationError> {
|
|
121
|
+
return safeParse(
|
|
122
|
+
jsonString,
|
|
123
|
+
(x) => ListPaymentsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
124
|
+
`Failed to parse 'ListPaymentsResponse' from JSON`,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import * as models from "../index.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Filter by payment status.
|
|
14
|
+
*/
|
|
15
|
+
export const ListPaymentSessionsStatus = {
|
|
16
|
+
Pending: "pending",
|
|
17
|
+
Processing: "processing",
|
|
18
|
+
Completed: "completed",
|
|
19
|
+
Expired: "expired",
|
|
20
|
+
Cancelled: "cancelled",
|
|
21
|
+
} as const;
|
|
22
|
+
/**
|
|
23
|
+
* Filter by payment status.
|
|
24
|
+
*/
|
|
25
|
+
export type ListPaymentSessionsStatus = ClosedEnum<
|
|
26
|
+
typeof ListPaymentSessionsStatus
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
export type ListPaymentSessionsRequest = {
|
|
30
|
+
/**
|
|
31
|
+
* Merchant organization ID. Required when using an API key that is not scoped to a single merchant.
|
|
32
|
+
*/
|
|
33
|
+
merchantId?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Filter by payment status.
|
|
36
|
+
*/
|
|
37
|
+
status?: ListPaymentSessionsStatus | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Filter by customer ID.
|
|
40
|
+
*/
|
|
41
|
+
customerId?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Number of payments to return.
|
|
44
|
+
*/
|
|
45
|
+
limit?: number | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Number of payments to skip.
|
|
48
|
+
*/
|
|
49
|
+
offset?: number | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const ListPaymentSessionsObject = {
|
|
53
|
+
List: "list",
|
|
54
|
+
} as const;
|
|
55
|
+
export type ListPaymentSessionsObject = ClosedEnum<
|
|
56
|
+
typeof ListPaymentSessionsObject
|
|
57
|
+
>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* List of payments
|
|
61
|
+
*/
|
|
62
|
+
export type ListPaymentSessionsResponse = {
|
|
63
|
+
object: ListPaymentSessionsObject;
|
|
64
|
+
data: Array<models.Payment>;
|
|
65
|
+
/**
|
|
66
|
+
* Offset-based pagination response.
|
|
67
|
+
*/
|
|
68
|
+
pagination: models.OffsetPagination;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const ListPaymentSessionsStatus$outboundSchema: z.ZodNativeEnum<
|
|
73
|
+
typeof ListPaymentSessionsStatus
|
|
74
|
+
> = z.nativeEnum(ListPaymentSessionsStatus);
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export type ListPaymentSessionsRequest$Outbound = {
|
|
78
|
+
merchantId?: string | undefined;
|
|
79
|
+
status?: string | undefined;
|
|
80
|
+
customerId?: string | undefined;
|
|
81
|
+
limit: number;
|
|
82
|
+
offset: number;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const ListPaymentSessionsRequest$outboundSchema: z.ZodType<
|
|
87
|
+
ListPaymentSessionsRequest$Outbound,
|
|
88
|
+
z.ZodTypeDef,
|
|
89
|
+
ListPaymentSessionsRequest
|
|
90
|
+
> = z.object({
|
|
91
|
+
merchantId: z.string().optional(),
|
|
92
|
+
status: ListPaymentSessionsStatus$outboundSchema.optional(),
|
|
93
|
+
customerId: z.string().optional(),
|
|
94
|
+
limit: z.number().int().default(10),
|
|
95
|
+
offset: z.number().int().default(0),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export function listPaymentSessionsRequestToJSON(
|
|
99
|
+
listPaymentSessionsRequest: ListPaymentSessionsRequest,
|
|
100
|
+
): string {
|
|
101
|
+
return JSON.stringify(
|
|
102
|
+
ListPaymentSessionsRequest$outboundSchema.parse(listPaymentSessionsRequest),
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** @internal */
|
|
107
|
+
export const ListPaymentSessionsObject$inboundSchema: z.ZodNativeEnum<
|
|
108
|
+
typeof ListPaymentSessionsObject
|
|
109
|
+
> = z.nativeEnum(ListPaymentSessionsObject);
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const ListPaymentSessionsResponse$inboundSchema: z.ZodType<
|
|
113
|
+
ListPaymentSessionsResponse,
|
|
114
|
+
z.ZodTypeDef,
|
|
115
|
+
unknown
|
|
116
|
+
> = z.object({
|
|
117
|
+
object: ListPaymentSessionsObject$inboundSchema,
|
|
118
|
+
data: z.array(models.Payment$inboundSchema),
|
|
119
|
+
pagination: models.OffsetPagination$inboundSchema,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export function listPaymentSessionsResponseFromJSON(
|
|
123
|
+
jsonString: string,
|
|
124
|
+
): SafeParseResult<ListPaymentSessionsResponse, SDKValidationError> {
|
|
125
|
+
return safeParse(
|
|
126
|
+
jsonString,
|
|
127
|
+
(x) => ListPaymentSessionsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
128
|
+
`Failed to parse 'ListPaymentSessionsResponse' from JSON`,
|
|
129
|
+
);
|
|
130
|
+
}
|