@gr4vy/sdk 2.0.50 → 2.0.52

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.
Files changed (91) hide show
  1. package/README.md +2 -0
  2. package/funcs/digitalWalletsSessionsPazeMobileSessionReview.d.ts +18 -0
  3. package/funcs/digitalWalletsSessionsPazeMobileSessionReview.d.ts.map +1 -0
  4. package/funcs/digitalWalletsSessionsPazeMobileSessionReview.js +127 -0
  5. package/funcs/digitalWalletsSessionsPazeMobileSessionReview.js.map +1 -0
  6. package/jsr.json +1 -1
  7. package/lib/config.d.ts +2 -2
  8. package/lib/config.js +2 -2
  9. package/models/components/index.d.ts +10 -0
  10. package/models/components/index.d.ts.map +1 -1
  11. package/models/components/index.js +10 -0
  12. package/models/components/index.js.map +1 -1
  13. package/models/components/paymentmethod.d.ts +4 -0
  14. package/models/components/paymentmethod.d.ts.map +1 -1
  15. package/models/components/paymentmethod.js +2 -0
  16. package/models/components/paymentmethod.js.map +1 -1
  17. package/models/components/paymentmethodsummary.d.ts +4 -0
  18. package/models/components/paymentmethodsummary.d.ts.map +1 -1
  19. package/models/components/paymentmethodsummary.js +2 -0
  20. package/models/components/paymentmethodsummary.js.map +1 -1
  21. package/models/components/pazebillingaddress.d.ts +41 -0
  22. package/models/components/pazebillingaddress.d.ts.map +1 -0
  23. package/models/components/pazebillingaddress.js +57 -0
  24. package/models/components/pazebillingaddress.js.map +1 -0
  25. package/models/components/pazeconsumer.d.ts +35 -0
  26. package/models/components/pazeconsumer.d.ts.map +1 -0
  27. package/models/components/pazeconsumer.js +57 -0
  28. package/models/components/pazeconsumer.js.map +1 -0
  29. package/models/components/pazedeliverycontactdetails.d.ts +15 -0
  30. package/models/components/pazedeliverycontactdetails.d.ts.map +1 -0
  31. package/models/components/pazedeliverycontactdetails.js +52 -0
  32. package/models/components/pazedeliverycontactdetails.js.map +1 -0
  33. package/models/components/pazedigitalcarddata.d.ts +21 -0
  34. package/models/components/pazedigitalcarddata.d.ts.map +1 -0
  35. package/models/components/pazedigitalcarddata.js +52 -0
  36. package/models/components/pazedigitalcarddata.js.map +1 -0
  37. package/models/components/pazemaskedcard.d.ts +87 -0
  38. package/models/components/pazemaskedcard.d.ts.map +1 -0
  39. package/models/components/pazemaskedcard.js +91 -0
  40. package/models/components/pazemaskedcard.js.map +1 -0
  41. package/models/components/pazemobilenumber.d.ts +17 -0
  42. package/models/components/pazemobilenumber.d.ts.map +1 -0
  43. package/models/components/pazemobilenumber.js +51 -0
  44. package/models/components/pazemobilenumber.js.map +1 -0
  45. package/models/components/pazesessionreview.d.ts +21 -0
  46. package/models/components/pazesessionreview.d.ts.map +1 -0
  47. package/models/components/pazesessionreview.js +58 -0
  48. package/models/components/pazesessionreview.js.map +1 -0
  49. package/models/components/pazesessionreviewlinks.d.ts +17 -0
  50. package/models/components/pazesessionreviewlinks.d.ts.map +1 -0
  51. package/models/components/pazesessionreviewlinks.js +57 -0
  52. package/models/components/pazesessionreviewlinks.js.map +1 -0
  53. package/models/components/pazesessionreviewrequest.d.ts +25 -0
  54. package/models/components/pazesessionreviewrequest.d.ts.map +1 -0
  55. package/models/components/pazesessionreviewrequest.js +51 -0
  56. package/models/components/pazesessionreviewrequest.js.map +1 -0
  57. package/models/components/pazeshippingaddress.d.ts +39 -0
  58. package/models/components/pazeshippingaddress.d.ts.map +1 -0
  59. package/models/components/pazeshippingaddress.js +58 -0
  60. package/models/components/pazeshippingaddress.js.map +1 -0
  61. package/models/operations/index.d.ts +1 -0
  62. package/models/operations/index.d.ts.map +1 -1
  63. package/models/operations/index.js +1 -0
  64. package/models/operations/index.js.map +1 -1
  65. package/models/operations/reviewpazemobilesession.d.ts +21 -0
  66. package/models/operations/reviewpazemobilesession.d.ts.map +1 -0
  67. package/models/operations/reviewpazemobilesession.js +56 -0
  68. package/models/operations/reviewpazemobilesession.js.map +1 -0
  69. package/package.json +1 -1
  70. package/sdk/sessions.d.ts +7 -0
  71. package/sdk/sessions.d.ts.map +1 -1
  72. package/sdk/sessions.js +10 -0
  73. package/sdk/sessions.js.map +1 -1
  74. package/src/funcs/digitalWalletsSessionsPazeMobileSessionReview.ts +232 -0
  75. package/src/lib/config.ts +2 -2
  76. package/src/models/components/index.ts +10 -0
  77. package/src/models/components/paymentmethod.ts +6 -0
  78. package/src/models/components/paymentmethodsummary.ts +6 -0
  79. package/src/models/components/pazebillingaddress.ts +69 -0
  80. package/src/models/components/pazeconsumer.ts +65 -0
  81. package/src/models/components/pazedeliverycontactdetails.ts +40 -0
  82. package/src/models/components/pazedigitalcarddata.ts +44 -0
  83. package/src/models/components/pazemaskedcard.ts +142 -0
  84. package/src/models/components/pazemobilenumber.ts +39 -0
  85. package/src/models/components/pazesessionreview.ts +55 -0
  86. package/src/models/components/pazesessionreviewlinks.ts +45 -0
  87. package/src/models/components/pazesessionreviewrequest.ts +46 -0
  88. package/src/models/components/pazeshippingaddress.ts +70 -0
  89. package/src/models/operations/index.ts +1 -0
  90. package/src/models/operations/reviewpazemobilesession.ts +49 -0
  91. package/src/sdk/sessions.ts +20 -0
@@ -0,0 +1,232 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { Gr4vyCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import { Gr4vyError } from "../models/errors/gr4vyerror.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/httpclienterrors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Review a Paze session
32
+ *
33
+ * @remarks
34
+ * Review a Paze checkout session and retrieve the selected card, consumer, and shipping address details.
35
+ */
36
+ export function digitalWalletsSessionsPazeMobileSessionReview(
37
+ client: Gr4vyCore,
38
+ pazeSessionReviewRequest: components.PazeSessionReviewRequest,
39
+ merchantAccountId?: string | null | undefined,
40
+ options?: RequestOptions,
41
+ ): APIPromise<
42
+ Result<
43
+ components.PazeSessionReview,
44
+ | errors.Error400
45
+ | errors.Error401
46
+ | errors.Error403
47
+ | errors.Error404
48
+ | errors.Error405
49
+ | errors.Error409
50
+ | errors.HTTPValidationError
51
+ | errors.Error425
52
+ | errors.Error429
53
+ | errors.Error500
54
+ | errors.Error502
55
+ | errors.Error504
56
+ | Gr4vyError
57
+ | ResponseValidationError
58
+ | ConnectionError
59
+ | RequestAbortedError
60
+ | RequestTimeoutError
61
+ | InvalidRequestError
62
+ | UnexpectedClientError
63
+ | SDKValidationError
64
+ >
65
+ > {
66
+ return new APIPromise($do(
67
+ client,
68
+ pazeSessionReviewRequest,
69
+ merchantAccountId,
70
+ options,
71
+ ));
72
+ }
73
+
74
+ async function $do(
75
+ client: Gr4vyCore,
76
+ pazeSessionReviewRequest: components.PazeSessionReviewRequest,
77
+ merchantAccountId?: string | null | undefined,
78
+ options?: RequestOptions,
79
+ ): Promise<
80
+ [
81
+ Result<
82
+ components.PazeSessionReview,
83
+ | errors.Error400
84
+ | errors.Error401
85
+ | errors.Error403
86
+ | errors.Error404
87
+ | errors.Error405
88
+ | errors.Error409
89
+ | errors.HTTPValidationError
90
+ | errors.Error425
91
+ | errors.Error429
92
+ | errors.Error500
93
+ | errors.Error502
94
+ | errors.Error504
95
+ | Gr4vyError
96
+ | ResponseValidationError
97
+ | ConnectionError
98
+ | RequestAbortedError
99
+ | RequestTimeoutError
100
+ | InvalidRequestError
101
+ | UnexpectedClientError
102
+ | SDKValidationError
103
+ >,
104
+ APICall,
105
+ ]
106
+ > {
107
+ const input: operations.ReviewPazeMobileSessionRequest = {
108
+ pazeSessionReviewRequest: pazeSessionReviewRequest,
109
+ merchantAccountId: merchantAccountId,
110
+ };
111
+
112
+ const parsed = safeParse(
113
+ input,
114
+ (value) =>
115
+ operations.ReviewPazeMobileSessionRequest$outboundSchema.parse(value),
116
+ "Input validation failed",
117
+ );
118
+ if (!parsed.ok) {
119
+ return [parsed, { status: "invalid" }];
120
+ }
121
+ const payload = parsed.value;
122
+ const body = encodeJSON("body", payload.PazeSessionReviewRequest, {
123
+ explode: true,
124
+ });
125
+
126
+ const path = pathToFunc("/digital-wallets/paze/session/review")();
127
+
128
+ const headers = new Headers(compactMap({
129
+ "Content-Type": "application/json",
130
+ Accept: "application/json",
131
+ "x-gr4vy-merchant-account-id": encodeSimple(
132
+ "x-gr4vy-merchant-account-id",
133
+ payload.merchantAccountId ?? client._options.merchantAccountId,
134
+ { explode: false, charEncoding: "none" },
135
+ ),
136
+ }));
137
+
138
+ const secConfig = await extractSecurity(client._options.bearerAuth);
139
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
140
+ const requestSecurity = resolveGlobalSecurity(securityInput);
141
+
142
+ const context = {
143
+ options: client._options,
144
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
145
+ operationID: "review_paze_mobile_session",
146
+ oAuth2Scopes: null,
147
+
148
+ resolvedSecurity: requestSecurity,
149
+
150
+ securitySource: client._options.bearerAuth,
151
+ retryConfig: options?.retries
152
+ || client._options.retryConfig
153
+ || { strategy: "none" },
154
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
155
+ };
156
+
157
+ const requestRes = client._createRequest(context, {
158
+ security: requestSecurity,
159
+ method: "POST",
160
+ baseURL: options?.serverURL,
161
+ path: path,
162
+ headers: headers,
163
+ body: body,
164
+ userAgent: client._options.userAgent,
165
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
166
+ }, options);
167
+ if (!requestRes.ok) {
168
+ return [requestRes, { status: "invalid" }];
169
+ }
170
+ const req = requestRes.value;
171
+
172
+ const doResult = await client._do(req, {
173
+ context,
174
+ isErrorStatusCode: (statusCode: number) =>
175
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
176
+ retryConfig: context.retryConfig,
177
+ retryCodes: context.retryCodes,
178
+ });
179
+ if (!doResult.ok) {
180
+ return [doResult, { status: "request-error", request: req }];
181
+ }
182
+ const response = doResult.value;
183
+
184
+ const responseFields = {
185
+ HttpMeta: { Response: response, Request: req },
186
+ };
187
+
188
+ const [result] = await M.match<
189
+ components.PazeSessionReview,
190
+ | errors.Error400
191
+ | errors.Error401
192
+ | errors.Error403
193
+ | errors.Error404
194
+ | errors.Error405
195
+ | errors.Error409
196
+ | errors.HTTPValidationError
197
+ | errors.Error425
198
+ | errors.Error429
199
+ | errors.Error500
200
+ | errors.Error502
201
+ | errors.Error504
202
+ | Gr4vyError
203
+ | ResponseValidationError
204
+ | ConnectionError
205
+ | RequestAbortedError
206
+ | RequestTimeoutError
207
+ | InvalidRequestError
208
+ | UnexpectedClientError
209
+ | SDKValidationError
210
+ >(
211
+ M.json(200, components.PazeSessionReview$inboundSchema),
212
+ M.jsonErr(400, errors.Error400$inboundSchema),
213
+ M.jsonErr(401, errors.Error401$inboundSchema),
214
+ M.jsonErr(403, errors.Error403$inboundSchema),
215
+ M.jsonErr(404, errors.Error404$inboundSchema),
216
+ M.jsonErr(405, errors.Error405$inboundSchema),
217
+ M.jsonErr(409, errors.Error409$inboundSchema),
218
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
219
+ M.jsonErr(425, errors.Error425$inboundSchema),
220
+ M.jsonErr(429, errors.Error429$inboundSchema),
221
+ M.jsonErr(500, errors.Error500$inboundSchema),
222
+ M.jsonErr(502, errors.Error502$inboundSchema),
223
+ M.jsonErr(504, errors.Error504$inboundSchema),
224
+ M.fail("4XX"),
225
+ M.fail("5XX"),
226
+ )(response, req, { extraFields: responseFields });
227
+ if (!result.ok) {
228
+ return [result, { status: "complete", request: req, response }];
229
+ }
230
+
231
+ return [result, { status: "complete", request: req, response }];
232
+ }
package/src/lib/config.ts CHANGED
@@ -77,7 +77,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
77
77
  export const SDK_METADATA = {
78
78
  language: "typescript",
79
79
  openapiDocVersion: "1.0.0",
80
- sdkVersion: "2.0.50",
80
+ sdkVersion: "2.0.52",
81
81
  genVersion: "2.884.11",
82
- userAgent: "speakeasy-sdk/typescript 2.0.50 2.884.11 1.0.0 @gr4vy/sdk",
82
+ userAgent: "speakeasy-sdk/typescript 2.0.52 2.884.11 1.0.0 @gr4vy/sdk",
83
83
  } as const;
@@ -207,9 +207,19 @@ export * from "./paypaloptions.js";
207
207
  export * from "./paypalshippingoptions.js";
208
208
  export * from "./paypalshippingoptionsitem.js";
209
209
  export * from "./paypalshippingoptionsitemamount.js";
210
+ export * from "./pazebillingaddress.js";
211
+ export * from "./pazeconsumer.js";
212
+ export * from "./pazedeliverycontactdetails.js";
213
+ export * from "./pazedigitalcarddata.js";
214
+ export * from "./pazemaskedcard.js";
215
+ export * from "./pazemobilenumber.js";
210
216
  export * from "./pazemobilesession.js";
211
217
  export * from "./pazepaymentmethodcreate.js";
212
218
  export * from "./pazesessionrequest.js";
219
+ export * from "./pazesessionreview.js";
220
+ export * from "./pazesessionreviewlinks.js";
221
+ export * from "./pazesessionreviewrequest.js";
222
+ export * from "./pazeshippingaddress.js";
213
223
  export * from "./pazewebsession.js";
214
224
  export * from "./plaidpaymentmethodcreate.js";
215
225
  export * from "./powertranzoptions.js";
@@ -113,6 +113,10 @@ export type PaymentMethod = {
113
113
  * The scheme associated with scheme_transaction_id. Only applies to card payments.
114
114
  */
115
115
  schemeTransactionIdScheme: CardScheme | null;
116
+ /**
117
+ * The transaction link identifier stored against this payment method.
118
+ */
119
+ transactionLinkId?: string | null | undefined;
116
120
  /**
117
121
  * The optional buyer for which this payment method has been stored.
118
122
  */
@@ -166,6 +170,7 @@ export const PaymentMethod$inboundSchema: z.ZodType<
166
170
  usage_count: z.number().int(),
167
171
  scheme_transaction_id: z.nullable(z.string()),
168
172
  scheme_transaction_id_scheme: z.nullable(CardScheme$inboundSchema),
173
+ transaction_link_id: z.nullable(z.string()).optional(),
169
174
  buyer: z.nullable(Buyer$inboundSchema).optional(),
170
175
  external_identifier: z.nullable(z.string()).optional(),
171
176
  status: PaymentMethodStatus$inboundSchema,
@@ -185,6 +190,7 @@ export const PaymentMethod$inboundSchema: z.ZodType<
185
190
  "usage_count": "usageCount",
186
191
  "scheme_transaction_id": "schemeTransactionId",
187
192
  "scheme_transaction_id_scheme": "schemeTransactionIdScheme",
193
+ "transaction_link_id": "transactionLinkId",
188
194
  "external_identifier": "externalIdentifier",
189
195
  "created_at": "createdAt",
190
196
  "updated_at": "updatedAt",
@@ -108,6 +108,10 @@ export type PaymentMethodSummary = {
108
108
  * The scheme associated with scheme_transaction_id. Only applies to card payments.
109
109
  */
110
110
  schemeTransactionIdScheme: CardScheme | null;
111
+ /**
112
+ * The transaction link identifier stored against this payment method.
113
+ */
114
+ transactionLinkId?: string | null | undefined;
111
115
  };
112
116
 
113
117
  /** @internal */
@@ -144,6 +148,7 @@ export const PaymentMethodSummary$inboundSchema: z.ZodType<
144
148
  usage_count: z.number().int(),
145
149
  scheme_transaction_id: z.nullable(z.string()),
146
150
  scheme_transaction_id_scheme: z.nullable(CardScheme$inboundSchema),
151
+ transaction_link_id: z.nullable(z.string()).optional(),
147
152
  }).transform((v) => {
148
153
  return remap$(v, {
149
154
  "approval_url": "approvalUrl",
@@ -158,6 +163,7 @@ export const PaymentMethodSummary$inboundSchema: z.ZodType<
158
163
  "usage_count": "usageCount",
159
164
  "scheme_transaction_id": "schemeTransactionId",
160
165
  "scheme_transaction_id_scheme": "schemeTransactionIdScheme",
166
+ "transaction_link_id": "transactionLinkId",
161
167
  });
162
168
  });
163
169
 
@@ -0,0 +1,69 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type PazeBillingAddress = {
11
+ /**
12
+ * Name of the organization or entity at the address.
13
+ */
14
+ name: string | null;
15
+ /**
16
+ * Line 1 of the address.
17
+ */
18
+ line1: string;
19
+ /**
20
+ * Line 2 of the address.
21
+ */
22
+ line2: string | null;
23
+ /**
24
+ * Line 3 of the address.
25
+ */
26
+ line3: string | null;
27
+ /**
28
+ * City.
29
+ */
30
+ city: string;
31
+ /**
32
+ * State or region.
33
+ */
34
+ state: string;
35
+ /**
36
+ * Postal code.
37
+ */
38
+ zip: string;
39
+ /**
40
+ * ISO 3166-1 alpha-2 country code.
41
+ */
42
+ countryCode: string | null;
43
+ };
44
+
45
+ /** @internal */
46
+ export const PazeBillingAddress$inboundSchema: z.ZodType<
47
+ PazeBillingAddress,
48
+ z.ZodTypeDef,
49
+ unknown
50
+ > = z.object({
51
+ name: z.nullable(z.string()),
52
+ line1: z.string(),
53
+ line2: z.nullable(z.string()),
54
+ line3: z.nullable(z.string()),
55
+ city: z.string(),
56
+ state: z.string(),
57
+ zip: z.string(),
58
+ countryCode: z.nullable(z.string()),
59
+ });
60
+
61
+ export function pazeBillingAddressFromJSON(
62
+ jsonString: string,
63
+ ): SafeParseResult<PazeBillingAddress, SDKValidationError> {
64
+ return safeParse(
65
+ jsonString,
66
+ (x) => PazeBillingAddress$inboundSchema.parse(JSON.parse(x)),
67
+ `Failed to parse 'PazeBillingAddress' from JSON`,
68
+ );
69
+ }
@@ -0,0 +1,65 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ PazeMobileNumber,
11
+ PazeMobileNumber$inboundSchema,
12
+ } from "./pazemobilenumber.js";
13
+
14
+ export type PazeConsumer = {
15
+ /**
16
+ * First name of the consumer.
17
+ */
18
+ firstName: string | null;
19
+ /**
20
+ * Last name of the consumer.
21
+ */
22
+ lastName: string | null;
23
+ /**
24
+ * Full name of the consumer.
25
+ */
26
+ fullName: string;
27
+ /**
28
+ * ISO 3166-1 alpha-2 country code.
29
+ */
30
+ countryCode: string | null;
31
+ /**
32
+ * ISO 639-1 language code associated with the wallet.
33
+ */
34
+ languageCode: string | null;
35
+ /**
36
+ * Email address of the consumer.
37
+ */
38
+ emailAddress: string;
39
+ mobileNumber: PazeMobileNumber | null;
40
+ };
41
+
42
+ /** @internal */
43
+ export const PazeConsumer$inboundSchema: z.ZodType<
44
+ PazeConsumer,
45
+ z.ZodTypeDef,
46
+ unknown
47
+ > = z.object({
48
+ firstName: z.nullable(z.string()),
49
+ lastName: z.nullable(z.string()),
50
+ fullName: z.string(),
51
+ countryCode: z.nullable(z.string()),
52
+ languageCode: z.nullable(z.string()),
53
+ emailAddress: z.string(),
54
+ mobileNumber: z.nullable(PazeMobileNumber$inboundSchema),
55
+ });
56
+
57
+ export function pazeConsumerFromJSON(
58
+ jsonString: string,
59
+ ): SafeParseResult<PazeConsumer, SDKValidationError> {
60
+ return safeParse(
61
+ jsonString,
62
+ (x) => PazeConsumer$inboundSchema.parse(JSON.parse(x)),
63
+ `Failed to parse 'PazeConsumer' from JSON`,
64
+ );
65
+ }
@@ -0,0 +1,40 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ PazeMobileNumber,
11
+ PazeMobileNumber$inboundSchema,
12
+ } from "./pazemobilenumber.js";
13
+
14
+ export type PazeDeliveryContactDetails = {
15
+ /**
16
+ * Consumer-provided name of the contact person.
17
+ */
18
+ contactFullName: string | null;
19
+ contactPhoneNumber: PazeMobileNumber | null;
20
+ };
21
+
22
+ /** @internal */
23
+ export const PazeDeliveryContactDetails$inboundSchema: z.ZodType<
24
+ PazeDeliveryContactDetails,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ contactFullName: z.nullable(z.string()),
29
+ contactPhoneNumber: z.nullable(PazeMobileNumber$inboundSchema),
30
+ });
31
+
32
+ export function pazeDeliveryContactDetailsFromJSON(
33
+ jsonString: string,
34
+ ): SafeParseResult<PazeDeliveryContactDetails, SDKValidationError> {
35
+ return safeParse(
36
+ jsonString,
37
+ (x) => PazeDeliveryContactDetails$inboundSchema.parse(JSON.parse(x)),
38
+ `Failed to parse 'PazeDeliveryContactDetails' from JSON`,
39
+ );
40
+ }
@@ -0,0 +1,44 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type PazeDigitalCardData = {
11
+ /**
12
+ * URI hosting the card art image.
13
+ */
14
+ artUri: string;
15
+ /**
16
+ * Card art height in pixels.
17
+ */
18
+ artHeight: number;
19
+ /**
20
+ * Card art width in pixels.
21
+ */
22
+ artWidth: number;
23
+ };
24
+
25
+ /** @internal */
26
+ export const PazeDigitalCardData$inboundSchema: z.ZodType<
27
+ PazeDigitalCardData,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ artUri: z.string(),
32
+ artHeight: z.number().int(),
33
+ artWidth: z.number().int(),
34
+ });
35
+
36
+ export function pazeDigitalCardDataFromJSON(
37
+ jsonString: string,
38
+ ): SafeParseResult<PazeDigitalCardData, SDKValidationError> {
39
+ return safeParse(
40
+ jsonString,
41
+ (x) => PazeDigitalCardData$inboundSchema.parse(JSON.parse(x)),
42
+ `Failed to parse 'PazeDigitalCardData' from JSON`,
43
+ );
44
+ }
@@ -0,0 +1,142 @@
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 * as openEnums from "../../types/enums.js";
8
+ import { OpenEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ PazeBillingAddress,
13
+ PazeBillingAddress$inboundSchema,
14
+ } from "./pazebillingaddress.js";
15
+ import {
16
+ PazeDigitalCardData,
17
+ PazeDigitalCardData$inboundSchema,
18
+ } from "./pazedigitalcarddata.js";
19
+
20
+ /**
21
+ * Card type.
22
+ */
23
+ export const Paymentcardtype = {
24
+ Credit: "CREDIT",
25
+ Debit: "DEBIT",
26
+ } as const;
27
+ /**
28
+ * Card type.
29
+ */
30
+ export type Paymentcardtype = OpenEnum<typeof Paymentcardtype>;
31
+
32
+ /**
33
+ * Card brand.
34
+ */
35
+ export const Paymentcardbrand = {
36
+ Visa: "VISA",
37
+ Mastercard: "MASTERCARD",
38
+ Discover: "DISCOVER",
39
+ } as const;
40
+ /**
41
+ * Card brand.
42
+ */
43
+ export type Paymentcardbrand = OpenEnum<typeof Paymentcardbrand>;
44
+
45
+ /**
46
+ * Card network.
47
+ */
48
+ export const Paymentcardnetwork = {
49
+ Visa: "VISA",
50
+ Mastercard: "MASTERCARD",
51
+ Discover: "DISCOVER",
52
+ } as const;
53
+ /**
54
+ * Card network.
55
+ */
56
+ export type Paymentcardnetwork = OpenEnum<typeof Paymentcardnetwork>;
57
+
58
+ export type PazeMaskedCard = {
59
+ /**
60
+ * Last four digits of the PAN.
61
+ */
62
+ panLastFour: string;
63
+ /**
64
+ * Payment Account Reference (PAR). A non-financial reference assigned to each unique PAN.
65
+ */
66
+ paymentAccountReference: string;
67
+ /**
68
+ * 2-digit PAN expiration month.
69
+ */
70
+ panExpirationMonth: string | null;
71
+ /**
72
+ * 4-digit PAN expiration year.
73
+ */
74
+ panExpirationYear: string | null;
75
+ /**
76
+ * Free-form string used for card or program recognition.
77
+ */
78
+ paymentCardDescriptor: string;
79
+ /**
80
+ * Card type.
81
+ */
82
+ paymentCardType: Paymentcardtype;
83
+ /**
84
+ * Card brand.
85
+ */
86
+ paymentCardBrand: Paymentcardbrand;
87
+ /**
88
+ * Card network.
89
+ */
90
+ paymentCardNetwork: Paymentcardnetwork;
91
+ digitalCardData: PazeDigitalCardData;
92
+ billingAddress: PazeBillingAddress | null;
93
+ };
94
+
95
+ /** @internal */
96
+ export const Paymentcardtype$inboundSchema: z.ZodType<
97
+ Paymentcardtype,
98
+ z.ZodTypeDef,
99
+ unknown
100
+ > = openEnums.inboundSchema(Paymentcardtype);
101
+
102
+ /** @internal */
103
+ export const Paymentcardbrand$inboundSchema: z.ZodType<
104
+ Paymentcardbrand,
105
+ z.ZodTypeDef,
106
+ unknown
107
+ > = openEnums.inboundSchema(Paymentcardbrand);
108
+
109
+ /** @internal */
110
+ export const Paymentcardnetwork$inboundSchema: z.ZodType<
111
+ Paymentcardnetwork,
112
+ z.ZodTypeDef,
113
+ unknown
114
+ > = openEnums.inboundSchema(Paymentcardnetwork);
115
+
116
+ /** @internal */
117
+ export const PazeMaskedCard$inboundSchema: z.ZodType<
118
+ PazeMaskedCard,
119
+ z.ZodTypeDef,
120
+ unknown
121
+ > = z.object({
122
+ panLastFour: z.string(),
123
+ paymentAccountReference: z.string(),
124
+ panExpirationMonth: z.nullable(z.string()),
125
+ panExpirationYear: z.nullable(z.string()),
126
+ paymentCardDescriptor: z.string(),
127
+ paymentCardType: Paymentcardtype$inboundSchema,
128
+ paymentCardBrand: Paymentcardbrand$inboundSchema,
129
+ paymentCardNetwork: Paymentcardnetwork$inboundSchema,
130
+ digitalCardData: PazeDigitalCardData$inboundSchema,
131
+ billingAddress: z.nullable(PazeBillingAddress$inboundSchema),
132
+ });
133
+
134
+ export function pazeMaskedCardFromJSON(
135
+ jsonString: string,
136
+ ): SafeParseResult<PazeMaskedCard, SDKValidationError> {
137
+ return safeParse(
138
+ jsonString,
139
+ (x) => PazeMaskedCard$inboundSchema.parse(JSON.parse(x)),
140
+ `Failed to parse 'PazeMaskedCard' from JSON`,
141
+ );
142
+ }