@gr4vy/sdk 2.0.52 → 2.0.53

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 (61) hide show
  1. package/README.md +2 -0
  2. package/funcs/digitalWalletsSessionsPazeMobileSessionCreate.d.ts +18 -0
  3. package/funcs/digitalWalletsSessionsPazeMobileSessionCreate.d.ts.map +1 -0
  4. package/funcs/digitalWalletsSessionsPazeMobileSessionCreate.js +127 -0
  5. package/funcs/digitalWalletsSessionsPazeMobileSessionCreate.js.map +1 -0
  6. package/jsr.json +1 -1
  7. package/lib/config.d.ts +3 -3
  8. package/lib/config.js +3 -3
  9. package/lib/config.js.map +1 -1
  10. package/models/components/index.d.ts +5 -0
  11. package/models/components/index.d.ts.map +1 -1
  12. package/models/components/index.js +5 -0
  13. package/models/components/index.js.map +1 -1
  14. package/models/components/pazeclient.d.ts +25 -0
  15. package/models/components/pazeclient.d.ts.map +1 -0
  16. package/models/components/pazeclient.js +51 -0
  17. package/models/components/pazeclient.js.map +1 -0
  18. package/models/components/pazecobranditem.d.ts +20 -0
  19. package/models/components/pazecobranditem.d.ts.map +1 -0
  20. package/models/components/pazecobranditem.js +50 -0
  21. package/models/components/pazecobranditem.js.map +1 -0
  22. package/models/components/pazemobilesessioncreate.d.ts +25 -0
  23. package/models/components/pazemobilesessioncreate.d.ts.map +1 -0
  24. package/models/components/pazemobilesessioncreate.js +58 -0
  25. package/models/components/pazemobilesessioncreate.js.map +1 -0
  26. package/models/components/pazemobilesessioncreaterequest.d.ts +130 -0
  27. package/models/components/pazemobilesessioncreaterequest.d.ts.map +1 -0
  28. package/models/components/pazemobilesessioncreaterequest.js +103 -0
  29. package/models/components/pazemobilesessioncreaterequest.js.map +1 -0
  30. package/models/components/pazetransactionvalue.d.ts +20 -0
  31. package/models/components/pazetransactionvalue.d.ts.map +1 -0
  32. package/models/components/pazetransactionvalue.js +50 -0
  33. package/models/components/pazetransactionvalue.js.map +1 -0
  34. package/models/operations/createpazemobilesession.d.ts +21 -0
  35. package/models/operations/createpazemobilesession.d.ts.map +1 -0
  36. package/models/operations/createpazemobilesession.js +56 -0
  37. package/models/operations/createpazemobilesession.js.map +1 -0
  38. package/models/operations/index.d.ts +1 -0
  39. package/models/operations/index.d.ts.map +1 -1
  40. package/models/operations/index.js +1 -0
  41. package/models/operations/index.js.map +1 -1
  42. package/package.json +1 -1
  43. package/sdk/sessions.d.ts +7 -0
  44. package/sdk/sessions.d.ts.map +1 -1
  45. package/sdk/sessions.js +10 -0
  46. package/sdk/sessions.js.map +1 -1
  47. package/src/funcs/digitalWalletsSessionsPazeMobileSessionCreate.ts +232 -0
  48. package/src/lib/config.ts +3 -3
  49. package/src/models/components/index.ts +5 -0
  50. package/src/models/components/pazeclient.ts +42 -0
  51. package/src/models/components/pazecobranditem.ts +38 -0
  52. package/src/models/components/pazemobilesessioncreate.ts +54 -0
  53. package/src/models/components/pazemobilesessioncreaterequest.ts +212 -0
  54. package/src/models/components/pazetransactionvalue.ts +40 -0
  55. package/src/models/operations/createpazemobilesession.ts +51 -0
  56. package/src/models/operations/index.ts +1 -0
  57. package/src/sdk/sessions.ts +20 -0
  58. package/src/types/async.ts +8 -7
  59. package/types/async.d.ts.map +1 -1
  60. package/types/async.js +8 -7
  61. package/types/async.js.map +1 -1
@@ -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
+ * Create a Paze mobile session
32
+ *
33
+ * @remarks
34
+ * Create a mobile session for use with Paze.
35
+ */
36
+ export function digitalWalletsSessionsPazeMobileSessionCreate(
37
+ client: Gr4vyCore,
38
+ pazeMobileSessionCreateRequest: components.PazeMobileSessionCreateRequest,
39
+ merchantAccountId?: string | null | undefined,
40
+ options?: RequestOptions,
41
+ ): APIPromise<
42
+ Result<
43
+ components.PazeMobileSessionCreate,
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
+ pazeMobileSessionCreateRequest,
69
+ merchantAccountId,
70
+ options,
71
+ ));
72
+ }
73
+
74
+ async function $do(
75
+ client: Gr4vyCore,
76
+ pazeMobileSessionCreateRequest: components.PazeMobileSessionCreateRequest,
77
+ merchantAccountId?: string | null | undefined,
78
+ options?: RequestOptions,
79
+ ): Promise<
80
+ [
81
+ Result<
82
+ components.PazeMobileSessionCreate,
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.CreatePazeMobileSessionRequest = {
108
+ pazeMobileSessionCreateRequest: pazeMobileSessionCreateRequest,
109
+ merchantAccountId: merchantAccountId,
110
+ };
111
+
112
+ const parsed = safeParse(
113
+ input,
114
+ (value) =>
115
+ operations.CreatePazeMobileSessionRequest$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.PazeMobileSessionCreateRequest, {
123
+ explode: true,
124
+ });
125
+
126
+ const path = pathToFunc("/digital-wallets/paze/session/create")();
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: "create_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.PazeMobileSessionCreate,
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.PazeMobileSessionCreate$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.52",
81
- genVersion: "2.884.11",
82
- userAgent: "speakeasy-sdk/typescript 2.0.52 2.884.11 1.0.0 @gr4vy/sdk",
80
+ sdkVersion: "2.0.53",
81
+ genVersion: "2.885.1",
82
+ userAgent: "speakeasy-sdk/typescript 2.0.53 2.885.1 1.0.0 @gr4vy/sdk",
83
83
  } as const;
@@ -208,18 +208,23 @@ export * from "./paypalshippingoptions.js";
208
208
  export * from "./paypalshippingoptionsitem.js";
209
209
  export * from "./paypalshippingoptionsitemamount.js";
210
210
  export * from "./pazebillingaddress.js";
211
+ export * from "./pazeclient.js";
212
+ export * from "./pazecobranditem.js";
211
213
  export * from "./pazeconsumer.js";
212
214
  export * from "./pazedeliverycontactdetails.js";
213
215
  export * from "./pazedigitalcarddata.js";
214
216
  export * from "./pazemaskedcard.js";
215
217
  export * from "./pazemobilenumber.js";
216
218
  export * from "./pazemobilesession.js";
219
+ export * from "./pazemobilesessioncreate.js";
220
+ export * from "./pazemobilesessioncreaterequest.js";
217
221
  export * from "./pazepaymentmethodcreate.js";
218
222
  export * from "./pazesessionrequest.js";
219
223
  export * from "./pazesessionreview.js";
220
224
  export * from "./pazesessionreviewlinks.js";
221
225
  export * from "./pazesessionreviewrequest.js";
222
226
  export * from "./pazeshippingaddress.js";
227
+ export * from "./pazetransactionvalue.js";
223
228
  export * from "./pazewebsession.js";
224
229
  export * from "./plaidpaymentmethodcreate.js";
225
230
  export * from "./powertranzoptions.js";
@@ -0,0 +1,42 @@
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 PazeClient = {
8
+ /**
9
+ * Client identifier generated by Paze and shared during onboarding.
10
+ */
11
+ id: string;
12
+ /**
13
+ * Display name associated with the client for presentation purposes.
14
+ */
15
+ name?: string | null | undefined;
16
+ /**
17
+ * Client profile to use during checkout.
18
+ */
19
+ profileId?: string | null | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export type PazeClient$Outbound = {
24
+ id: string;
25
+ name?: string | null | undefined;
26
+ profileId?: string | null | undefined;
27
+ };
28
+
29
+ /** @internal */
30
+ export const PazeClient$outboundSchema: z.ZodType<
31
+ PazeClient$Outbound,
32
+ z.ZodTypeDef,
33
+ PazeClient
34
+ > = z.object({
35
+ id: z.string(),
36
+ name: z.nullable(z.string()).optional(),
37
+ profileId: z.nullable(z.string()).optional(),
38
+ });
39
+
40
+ export function pazeClientToJSON(pazeClient: PazeClient): string {
41
+ return JSON.stringify(PazeClient$outboundSchema.parse(pazeClient));
42
+ }
@@ -0,0 +1,38 @@
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 PazeCobrandItem = {
8
+ /**
9
+ * Product name of the cobrand card. Must match exactly with the card name from the network.
10
+ */
11
+ name: string;
12
+ /**
13
+ * Whether benefits are offered for this cobrand card.
14
+ */
15
+ benefitsOffered?: boolean | null | undefined;
16
+ };
17
+
18
+ /** @internal */
19
+ export type PazeCobrandItem$Outbound = {
20
+ name: string;
21
+ benefitsOffered?: boolean | null | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const PazeCobrandItem$outboundSchema: z.ZodType<
26
+ PazeCobrandItem$Outbound,
27
+ z.ZodTypeDef,
28
+ PazeCobrandItem
29
+ > = z.object({
30
+ name: z.string(),
31
+ benefitsOffered: z.nullable(z.boolean()).optional(),
32
+ });
33
+
34
+ export function pazeCobrandItemToJSON(
35
+ pazeCobrandItem: PazeCobrandItem,
36
+ ): string {
37
+ return JSON.stringify(PazeCobrandItem$outboundSchema.parse(pazeCobrandItem));
38
+ }
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type PazeMobileSessionCreate = {
12
+ /**
13
+ * Session URL for launching the Paze checkout UI from the native mobile app.
14
+ */
15
+ pazeCheckoutUrl: string;
16
+ /**
17
+ * Merchant-defined transaction identifier echoed from the request.
18
+ */
19
+ clientContext: string;
20
+ /**
21
+ * Globally unique session identifier generated by Paze.
22
+ */
23
+ ewSID: string;
24
+ /**
25
+ * Timestamp when the response was sent by Paze, in ISO 8601 format.
26
+ */
27
+ timestampIso8601: string;
28
+ };
29
+
30
+ /** @internal */
31
+ export const PazeMobileSessionCreate$inboundSchema: z.ZodType<
32
+ PazeMobileSessionCreate,
33
+ z.ZodTypeDef,
34
+ unknown
35
+ > = z.object({
36
+ pazeCheckoutUrl: z.string(),
37
+ clientContext: z.string(),
38
+ ewSID: z.string(),
39
+ timestampISO8601: z.string(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "timestampISO8601": "timestampIso8601",
43
+ });
44
+ });
45
+
46
+ export function pazeMobileSessionCreateFromJSON(
47
+ jsonString: string,
48
+ ): SafeParseResult<PazeMobileSessionCreate, SDKValidationError> {
49
+ return safeParse(
50
+ jsonString,
51
+ (x) => PazeMobileSessionCreate$inboundSchema.parse(JSON.parse(x)),
52
+ `Failed to parse 'PazeMobileSessionCreate' from JSON`,
53
+ );
54
+ }
@@ -0,0 +1,212 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import * as openEnums from "../../types/enums.js";
7
+ import { OpenEnum } from "../../types/enums.js";
8
+ import {
9
+ PazeClient,
10
+ PazeClient$Outbound,
11
+ PazeClient$outboundSchema,
12
+ } from "./pazeclient.js";
13
+ import {
14
+ PazeCobrandItem,
15
+ PazeCobrandItem$Outbound,
16
+ PazeCobrandItem$outboundSchema,
17
+ } from "./pazecobranditem.js";
18
+ import {
19
+ PazeTransactionValue,
20
+ PazeTransactionValue$Outbound,
21
+ PazeTransactionValue$outboundSchema,
22
+ } from "./pazetransactionvalue.js";
23
+
24
+ /**
25
+ * Primary intent of the checkout session.
26
+ */
27
+ export const Intent = {
28
+ ReviewAndPay: "REVIEW_AND_PAY",
29
+ ExpressCheckout: "EXPRESS_CHECKOUT",
30
+ AddCard: "ADD_CARD",
31
+ } as const;
32
+ /**
33
+ * Primary intent of the checkout session.
34
+ */
35
+ export type Intent = OpenEnum<typeof Intent>;
36
+
37
+ export const TransactionType = {
38
+ Purchase: "PURCHASE",
39
+ CardOnFile: "CARD_ON_FILE",
40
+ Both: "BOTH",
41
+ } as const;
42
+ export type TransactionType = OpenEnum<typeof TransactionType>;
43
+
44
+ export const ShippingPreference = {
45
+ All: "ALL",
46
+ None: "NONE",
47
+ } as const;
48
+ export type ShippingPreference = OpenEnum<typeof ShippingPreference>;
49
+
50
+ export const BillingPreference = {
51
+ All: "ALL",
52
+ ZipCountry: "ZIP_COUNTRY",
53
+ None: "NONE",
54
+ } as const;
55
+ export type BillingPreference = OpenEnum<typeof BillingPreference>;
56
+
57
+ export const AcceptedPaymentCardNetworks = {
58
+ Visa: "VISA",
59
+ Mastercard: "MASTERCARD",
60
+ } as const;
61
+ export type AcceptedPaymentCardNetworks = OpenEnum<
62
+ typeof AcceptedPaymentCardNetworks
63
+ >;
64
+
65
+ export type PazeMobileSessionCreateRequest = {
66
+ client: PazeClient;
67
+ /**
68
+ * Session reference identifier generated by the merchant. Must be reused across all Paze APIs in a checkout session.
69
+ */
70
+ sessionId: string;
71
+ /**
72
+ * Access token obtained from the Paze session endpoint with source=mobile.
73
+ */
74
+ accessToken: string;
75
+ /**
76
+ * Merchant app's ID (iOS bundle identifier or Android application ID) used as the callback URL scheme.
77
+ */
78
+ callbackURLScheme: string;
79
+ /**
80
+ * Primary intent of the checkout session.
81
+ */
82
+ intent: Intent;
83
+ /**
84
+ * Currency and amount of the transaction. Required when intent is EXPRESS_CHECKOUT.
85
+ */
86
+ transactionValue?: PazeTransactionValue | null | undefined;
87
+ /**
88
+ * Type of transaction.
89
+ */
90
+ transactionType?: TransactionType | null | undefined;
91
+ /**
92
+ * Whether to collect a shipping address from the consumer.
93
+ */
94
+ shippingPreference?: ShippingPreference | null | undefined;
95
+ /**
96
+ * Verbosity of billing address required.
97
+ */
98
+ billingPreference?: BillingPreference | null | undefined;
99
+ /**
100
+ * Consumer email address for checkout flow optimization.
101
+ */
102
+ emailAddress?: string | null | undefined;
103
+ /**
104
+ * Consumer phone number for checkout flow optimization.
105
+ */
106
+ phoneNumber?: string | null | undefined;
107
+ /**
108
+ * Details for cobranded cards offered by the merchant.
109
+ */
110
+ cobrand?: Array<PazeCobrandItem> | null | undefined;
111
+ /**
112
+ * ISO 3166-1 alpha-2 country codes restricting eligible shipping addresses. Empty list or absence means all countries accepted.
113
+ */
114
+ acceptedShippingCountries?: Array<string> | null | undefined;
115
+ /**
116
+ * Accepted payment card networks. Empty list or absence means all networks accepted.
117
+ */
118
+ acceptedPaymentCardNetworks?:
119
+ | Array<AcceptedPaymentCardNetworks>
120
+ | null
121
+ | undefined;
122
+ /**
123
+ * Set to true to enable Paze checkout even if the provided email address or phone number does not match a Paze wallet.
124
+ */
125
+ alwaysEnableCheckout?: boolean | undefined;
126
+ };
127
+
128
+ /** @internal */
129
+ export const Intent$outboundSchema: z.ZodType<string, z.ZodTypeDef, Intent> =
130
+ openEnums.outboundSchema(Intent);
131
+
132
+ /** @internal */
133
+ export const TransactionType$outboundSchema: z.ZodType<
134
+ string,
135
+ z.ZodTypeDef,
136
+ TransactionType
137
+ > = openEnums.outboundSchema(TransactionType);
138
+
139
+ /** @internal */
140
+ export const ShippingPreference$outboundSchema: z.ZodType<
141
+ string,
142
+ z.ZodTypeDef,
143
+ ShippingPreference
144
+ > = openEnums.outboundSchema(ShippingPreference);
145
+
146
+ /** @internal */
147
+ export const BillingPreference$outboundSchema: z.ZodType<
148
+ string,
149
+ z.ZodTypeDef,
150
+ BillingPreference
151
+ > = openEnums.outboundSchema(BillingPreference);
152
+
153
+ /** @internal */
154
+ export const AcceptedPaymentCardNetworks$outboundSchema: z.ZodType<
155
+ string,
156
+ z.ZodTypeDef,
157
+ AcceptedPaymentCardNetworks
158
+ > = openEnums.outboundSchema(AcceptedPaymentCardNetworks);
159
+
160
+ /** @internal */
161
+ export type PazeMobileSessionCreateRequest$Outbound = {
162
+ client: PazeClient$Outbound;
163
+ sessionId: string;
164
+ accessToken: string;
165
+ callbackURLScheme: string;
166
+ intent: string;
167
+ transactionValue?: PazeTransactionValue$Outbound | null | undefined;
168
+ transactionType?: string | null | undefined;
169
+ shippingPreference?: string | null | undefined;
170
+ billingPreference?: string | null | undefined;
171
+ emailAddress?: string | null | undefined;
172
+ phoneNumber?: string | null | undefined;
173
+ cobrand?: Array<PazeCobrandItem$Outbound> | null | undefined;
174
+ acceptedShippingCountries?: Array<string> | null | undefined;
175
+ acceptedPaymentCardNetworks?: Array<string> | null | undefined;
176
+ alwaysEnableCheckout: boolean;
177
+ };
178
+
179
+ /** @internal */
180
+ export const PazeMobileSessionCreateRequest$outboundSchema: z.ZodType<
181
+ PazeMobileSessionCreateRequest$Outbound,
182
+ z.ZodTypeDef,
183
+ PazeMobileSessionCreateRequest
184
+ > = z.object({
185
+ client: PazeClient$outboundSchema,
186
+ sessionId: z.string(),
187
+ accessToken: z.string(),
188
+ callbackURLScheme: z.string(),
189
+ intent: Intent$outboundSchema,
190
+ transactionValue: z.nullable(PazeTransactionValue$outboundSchema).optional(),
191
+ transactionType: z.nullable(TransactionType$outboundSchema).optional(),
192
+ shippingPreference: z.nullable(ShippingPreference$outboundSchema).optional(),
193
+ billingPreference: z.nullable(BillingPreference$outboundSchema).optional(),
194
+ emailAddress: z.nullable(z.string()).optional(),
195
+ phoneNumber: z.nullable(z.string()).optional(),
196
+ cobrand: z.nullable(z.array(PazeCobrandItem$outboundSchema)).optional(),
197
+ acceptedShippingCountries: z.nullable(z.array(z.string())).optional(),
198
+ acceptedPaymentCardNetworks: z.nullable(
199
+ z.array(AcceptedPaymentCardNetworks$outboundSchema),
200
+ ).optional(),
201
+ alwaysEnableCheckout: z.boolean().default(false),
202
+ });
203
+
204
+ export function pazeMobileSessionCreateRequestToJSON(
205
+ pazeMobileSessionCreateRequest: PazeMobileSessionCreateRequest,
206
+ ): string {
207
+ return JSON.stringify(
208
+ PazeMobileSessionCreateRequest$outboundSchema.parse(
209
+ pazeMobileSessionCreateRequest,
210
+ ),
211
+ );
212
+ }
@@ -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
+
7
+ export type PazeTransactionValue = {
8
+ /**
9
+ * ISO 4217 currency code of the transaction.
10
+ */
11
+ transactionCurrency: string;
12
+ /**
13
+ * Amount of the transaction including dollar and cents, e.g. '99.95'.
14
+ */
15
+ transactionAmount: string;
16
+ };
17
+
18
+ /** @internal */
19
+ export type PazeTransactionValue$Outbound = {
20
+ transactionCurrency: string;
21
+ transactionAmount: string;
22
+ };
23
+
24
+ /** @internal */
25
+ export const PazeTransactionValue$outboundSchema: z.ZodType<
26
+ PazeTransactionValue$Outbound,
27
+ z.ZodTypeDef,
28
+ PazeTransactionValue
29
+ > = z.object({
30
+ transactionCurrency: z.string(),
31
+ transactionAmount: z.string(),
32
+ });
33
+
34
+ export function pazeTransactionValueToJSON(
35
+ pazeTransactionValue: PazeTransactionValue,
36
+ ): string {
37
+ return JSON.stringify(
38
+ PazeTransactionValue$outboundSchema.parse(pazeTransactionValue),
39
+ );
40
+ }