@gr4vy/sdk 2.0.51 → 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.
- package/README.md +4 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionCreate.d.ts +18 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionCreate.d.ts.map +1 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionCreate.js +127 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionCreate.js.map +1 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionReview.d.ts +18 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionReview.d.ts.map +1 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionReview.js +127 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionReview.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/models/components/index.d.ts +15 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +15 -0
- package/models/components/index.js.map +1 -1
- package/models/components/pazebillingaddress.d.ts +41 -0
- package/models/components/pazebillingaddress.d.ts.map +1 -0
- package/models/components/pazebillingaddress.js +57 -0
- package/models/components/pazebillingaddress.js.map +1 -0
- package/models/components/pazeclient.d.ts +25 -0
- package/models/components/pazeclient.d.ts.map +1 -0
- package/models/components/pazeclient.js +51 -0
- package/models/components/pazeclient.js.map +1 -0
- package/models/components/pazecobranditem.d.ts +20 -0
- package/models/components/pazecobranditem.d.ts.map +1 -0
- package/models/components/pazecobranditem.js +50 -0
- package/models/components/pazecobranditem.js.map +1 -0
- package/models/components/pazeconsumer.d.ts +35 -0
- package/models/components/pazeconsumer.d.ts.map +1 -0
- package/models/components/pazeconsumer.js +57 -0
- package/models/components/pazeconsumer.js.map +1 -0
- package/models/components/pazedeliverycontactdetails.d.ts +15 -0
- package/models/components/pazedeliverycontactdetails.d.ts.map +1 -0
- package/models/components/pazedeliverycontactdetails.js +52 -0
- package/models/components/pazedeliverycontactdetails.js.map +1 -0
- package/models/components/pazedigitalcarddata.d.ts +21 -0
- package/models/components/pazedigitalcarddata.d.ts.map +1 -0
- package/models/components/pazedigitalcarddata.js +52 -0
- package/models/components/pazedigitalcarddata.js.map +1 -0
- package/models/components/pazemaskedcard.d.ts +87 -0
- package/models/components/pazemaskedcard.d.ts.map +1 -0
- package/models/components/pazemaskedcard.js +91 -0
- package/models/components/pazemaskedcard.js.map +1 -0
- package/models/components/pazemobilenumber.d.ts +17 -0
- package/models/components/pazemobilenumber.d.ts.map +1 -0
- package/models/components/pazemobilenumber.js +51 -0
- package/models/components/pazemobilenumber.js.map +1 -0
- package/models/components/pazemobilesessioncreate.d.ts +25 -0
- package/models/components/pazemobilesessioncreate.d.ts.map +1 -0
- package/models/components/pazemobilesessioncreate.js +58 -0
- package/models/components/pazemobilesessioncreate.js.map +1 -0
- package/models/components/pazemobilesessioncreaterequest.d.ts +130 -0
- package/models/components/pazemobilesessioncreaterequest.d.ts.map +1 -0
- package/models/components/pazemobilesessioncreaterequest.js +103 -0
- package/models/components/pazemobilesessioncreaterequest.js.map +1 -0
- package/models/components/pazesessionreview.d.ts +21 -0
- package/models/components/pazesessionreview.d.ts.map +1 -0
- package/models/components/pazesessionreview.js +58 -0
- package/models/components/pazesessionreview.js.map +1 -0
- package/models/components/pazesessionreviewlinks.d.ts +17 -0
- package/models/components/pazesessionreviewlinks.d.ts.map +1 -0
- package/models/components/pazesessionreviewlinks.js +57 -0
- package/models/components/pazesessionreviewlinks.js.map +1 -0
- package/models/components/pazesessionreviewrequest.d.ts +25 -0
- package/models/components/pazesessionreviewrequest.d.ts.map +1 -0
- package/models/components/pazesessionreviewrequest.js +51 -0
- package/models/components/pazesessionreviewrequest.js.map +1 -0
- package/models/components/pazeshippingaddress.d.ts +39 -0
- package/models/components/pazeshippingaddress.d.ts.map +1 -0
- package/models/components/pazeshippingaddress.js +58 -0
- package/models/components/pazeshippingaddress.js.map +1 -0
- package/models/components/pazetransactionvalue.d.ts +20 -0
- package/models/components/pazetransactionvalue.d.ts.map +1 -0
- package/models/components/pazetransactionvalue.js +50 -0
- package/models/components/pazetransactionvalue.js.map +1 -0
- package/models/operations/createpazemobilesession.d.ts +21 -0
- package/models/operations/createpazemobilesession.d.ts.map +1 -0
- package/models/operations/createpazemobilesession.js +56 -0
- package/models/operations/createpazemobilesession.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/reviewpazemobilesession.d.ts +21 -0
- package/models/operations/reviewpazemobilesession.d.ts.map +1 -0
- package/models/operations/reviewpazemobilesession.js +56 -0
- package/models/operations/reviewpazemobilesession.js.map +1 -0
- package/package.json +1 -1
- package/sdk/sessions.d.ts +14 -0
- package/sdk/sessions.d.ts.map +1 -1
- package/sdk/sessions.js +20 -0
- package/sdk/sessions.js.map +1 -1
- package/src/funcs/digitalWalletsSessionsPazeMobileSessionCreate.ts +232 -0
- package/src/funcs/digitalWalletsSessionsPazeMobileSessionReview.ts +232 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +15 -0
- package/src/models/components/pazebillingaddress.ts +69 -0
- package/src/models/components/pazeclient.ts +42 -0
- package/src/models/components/pazecobranditem.ts +38 -0
- package/src/models/components/pazeconsumer.ts +65 -0
- package/src/models/components/pazedeliverycontactdetails.ts +40 -0
- package/src/models/components/pazedigitalcarddata.ts +44 -0
- package/src/models/components/pazemaskedcard.ts +142 -0
- package/src/models/components/pazemobilenumber.ts +39 -0
- package/src/models/components/pazemobilesessioncreate.ts +54 -0
- package/src/models/components/pazemobilesessioncreaterequest.ts +212 -0
- package/src/models/components/pazesessionreview.ts +55 -0
- package/src/models/components/pazesessionreviewlinks.ts +45 -0
- package/src/models/components/pazesessionreviewrequest.ts +46 -0
- package/src/models/components/pazeshippingaddress.ts +70 -0
- package/src/models/components/pazetransactionvalue.ts +40 -0
- package/src/models/operations/createpazemobilesession.ts +51 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/reviewpazemobilesession.ts +49 -0
- package/src/sdk/sessions.ts +40 -0
- package/src/types/async.ts +8 -7
- package/types/async.d.ts.map +1 -1
- package/types/async.js +8 -7
- package/types/async.js.map +1 -1
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 PazeMobileNumber = {
|
|
11
|
+
/**
|
|
12
|
+
* ITU country dialing code.
|
|
13
|
+
*/
|
|
14
|
+
countryCode: string;
|
|
15
|
+
/**
|
|
16
|
+
* Phone number without country code.
|
|
17
|
+
*/
|
|
18
|
+
phoneNumber: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const PazeMobileNumber$inboundSchema: z.ZodType<
|
|
23
|
+
PazeMobileNumber,
|
|
24
|
+
z.ZodTypeDef,
|
|
25
|
+
unknown
|
|
26
|
+
> = z.object({
|
|
27
|
+
countryCode: z.string(),
|
|
28
|
+
phoneNumber: z.string(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export function pazeMobileNumberFromJSON(
|
|
32
|
+
jsonString: string,
|
|
33
|
+
): SafeParseResult<PazeMobileNumber, SDKValidationError> {
|
|
34
|
+
return safeParse(
|
|
35
|
+
jsonString,
|
|
36
|
+
(x) => PazeMobileNumber$inboundSchema.parse(JSON.parse(x)),
|
|
37
|
+
`Failed to parse 'PazeMobileNumber' from JSON`,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -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,55 @@
|
|
|
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 { PazeConsumer, PazeConsumer$inboundSchema } from "./pazeconsumer.js";
|
|
10
|
+
import {
|
|
11
|
+
PazeMaskedCard,
|
|
12
|
+
PazeMaskedCard$inboundSchema,
|
|
13
|
+
} from "./pazemaskedcard.js";
|
|
14
|
+
import {
|
|
15
|
+
PazeSessionReviewLinks,
|
|
16
|
+
PazeSessionReviewLinks$inboundSchema,
|
|
17
|
+
} from "./pazesessionreviewlinks.js";
|
|
18
|
+
import {
|
|
19
|
+
PazeShippingAddress,
|
|
20
|
+
PazeShippingAddress$inboundSchema,
|
|
21
|
+
} from "./pazeshippingaddress.js";
|
|
22
|
+
|
|
23
|
+
export type PazeSessionReview = {
|
|
24
|
+
consumer: PazeConsumer;
|
|
25
|
+
shippingAddress: PazeShippingAddress | null;
|
|
26
|
+
maskedCard: PazeMaskedCard;
|
|
27
|
+
links: PazeSessionReviewLinks;
|
|
28
|
+
/**
|
|
29
|
+
* Opaque token issued by the Paze service to be used in the next Paze interaction.
|
|
30
|
+
*/
|
|
31
|
+
code: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const PazeSessionReview$inboundSchema: z.ZodType<
|
|
36
|
+
PazeSessionReview,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
unknown
|
|
39
|
+
> = z.object({
|
|
40
|
+
consumer: PazeConsumer$inboundSchema,
|
|
41
|
+
shippingAddress: z.nullable(PazeShippingAddress$inboundSchema),
|
|
42
|
+
maskedCard: PazeMaskedCard$inboundSchema,
|
|
43
|
+
links: PazeSessionReviewLinks$inboundSchema,
|
|
44
|
+
code: z.string(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export function pazeSessionReviewFromJSON(
|
|
48
|
+
jsonString: string,
|
|
49
|
+
): SafeParseResult<PazeSessionReview, SDKValidationError> {
|
|
50
|
+
return safeParse(
|
|
51
|
+
jsonString,
|
|
52
|
+
(x) => PazeSessionReview$inboundSchema.parse(JSON.parse(x)),
|
|
53
|
+
`Failed to parse 'PazeSessionReview' from JSON`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 PazeSessionReviewLinks = {
|
|
12
|
+
/**
|
|
13
|
+
* Follow-up link to change the selected card.
|
|
14
|
+
*/
|
|
15
|
+
changeCard: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Follow-up link to change the shipping address.
|
|
18
|
+
*/
|
|
19
|
+
changeShippingAddress: string | null;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const PazeSessionReviewLinks$inboundSchema: z.ZodType<
|
|
24
|
+
PazeSessionReviewLinks,
|
|
25
|
+
z.ZodTypeDef,
|
|
26
|
+
unknown
|
|
27
|
+
> = z.object({
|
|
28
|
+
CHANGE_CARD: z.nullable(z.string()),
|
|
29
|
+
CHANGE_SHIPPING_ADDRESS: z.nullable(z.string()),
|
|
30
|
+
}).transform((v) => {
|
|
31
|
+
return remap$(v, {
|
|
32
|
+
"CHANGE_CARD": "changeCard",
|
|
33
|
+
"CHANGE_SHIPPING_ADDRESS": "changeShippingAddress",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export function pazeSessionReviewLinksFromJSON(
|
|
38
|
+
jsonString: string,
|
|
39
|
+
): SafeParseResult<PazeSessionReviewLinks, SDKValidationError> {
|
|
40
|
+
return safeParse(
|
|
41
|
+
jsonString,
|
|
42
|
+
(x) => PazeSessionReviewLinks$inboundSchema.parse(JSON.parse(x)),
|
|
43
|
+
`Failed to parse 'PazeSessionReviewLinks' from JSON`,
|
|
44
|
+
);
|
|
45
|
+
}
|