@gr4vy/sdk 2.0.55 → 2.1.0
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 +2 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionComplete.d.ts +18 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionComplete.d.ts.map +1 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionComplete.js +127 -0
- package/funcs/digitalWalletsSessionsPazeMobileSessionComplete.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 +7 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +7 -0
- package/models/components/index.js.map +1 -1
- package/models/components/pazebillingaddress.d.ts +4 -4
- package/models/components/pazebillingaddress.d.ts.map +1 -1
- package/models/components/pazebillingaddress.js +4 -4
- package/models/components/pazebillingaddress.js.map +1 -1
- package/models/components/pazedeliverycontactdetails.d.ts +9 -1
- package/models/components/pazedeliverycontactdetails.d.ts.map +1 -1
- package/models/components/pazedeliverycontactdetails.js +10 -1
- package/models/components/pazedeliverycontactdetails.js.map +1 -1
- package/models/components/pazeecomdata.d.ts +36 -0
- package/models/components/pazeecomdata.d.ts.map +1 -0
- package/models/components/pazeecomdata.js +55 -0
- package/models/components/pazeecomdata.js.map +1 -0
- package/models/components/pazeenhancedtransactiondata.d.ts +22 -0
- package/models/components/pazeenhancedtransactiondata.d.ts.map +1 -0
- package/models/components/pazeenhancedtransactiondata.js +52 -0
- package/models/components/pazeenhancedtransactiondata.js.map +1 -0
- package/models/components/pazelocationaddress.d.ts +50 -0
- package/models/components/pazelocationaddress.d.ts.map +1 -0
- package/models/components/pazelocationaddress.js +56 -0
- package/models/components/pazelocationaddress.js.map +1 -0
- package/models/components/pazemobilenumber.d.ts +8 -0
- package/models/components/pazemobilenumber.d.ts.map +1 -1
- package/models/components/pazemobilenumber.js +10 -1
- package/models/components/pazemobilenumber.js.map +1 -1
- package/models/components/pazesessioncomplete.d.ts +33 -0
- package/models/components/pazesessioncomplete.d.ts.map +1 -0
- package/models/components/pazesessioncomplete.js +60 -0
- package/models/components/pazesessioncomplete.js.map +1 -0
- package/models/components/pazesessioncompleterequest.d.ts +76 -0
- package/models/components/pazesessioncompleterequest.d.ts.map +1 -0
- package/models/components/pazesessioncompleterequest.js +78 -0
- package/models/components/pazesessioncompleterequest.js.map +1 -0
- package/models/components/pazeshippingaddress.d.ts +17 -3
- package/models/components/pazeshippingaddress.d.ts.map +1 -1
- package/models/components/pazeshippingaddress.js +18 -3
- package/models/components/pazeshippingaddress.js.map +1 -1
- package/models/components/pazetransactionoptions.d.ts +40 -0
- package/models/components/pazetransactionoptions.d.ts.map +1 -0
- package/models/components/pazetransactionoptions.js +65 -0
- package/models/components/pazetransactionoptions.js.map +1 -0
- package/models/components/pazetraveldata.d.ts +41 -0
- package/models/components/pazetraveldata.d.ts.map +1 -0
- package/models/components/pazetraveldata.js +55 -0
- package/models/components/pazetraveldata.js.map +1 -0
- package/models/operations/completepazemobilesession.d.ts +21 -0
- package/models/operations/completepazemobilesession.d.ts.map +1 -0
- package/models/operations/completepazemobilesession.js +56 -0
- package/models/operations/completepazemobilesession.js.map +1 -0
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/sessions.d.ts +7 -0
- package/sdk/sessions.d.ts.map +1 -1
- package/sdk/sessions.js +10 -0
- package/sdk/sessions.js.map +1 -1
- package/src/funcs/digitalWalletsSessionsPazeMobileSessionComplete.ts +232 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +7 -0
- package/src/models/components/pazebillingaddress.ts +8 -8
- package/src/models/components/pazedeliverycontactdetails.ts +24 -0
- package/src/models/components/pazeecomdata.ts +60 -0
- package/src/models/components/pazeenhancedtransactiondata.ts +52 -0
- package/src/models/components/pazelocationaddress.ts +76 -0
- package/src/models/components/pazemobilenumber.ts +22 -0
- package/src/models/components/pazesessioncomplete.ts +64 -0
- package/src/models/components/pazesessioncompleterequest.ts +133 -0
- package/src/models/components/pazeshippingaddress.ts +40 -4
- package/src/models/components/pazetransactionoptions.ts +82 -0
- package/src/models/components/pazetraveldata.ts +65 -0
- package/src/models/operations/completepazemobilesession.ts +50 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/sessions.ts +20 -0
|
@@ -11,7 +11,7 @@ export type PazeBillingAddress = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Name of the organization or entity at the address.
|
|
13
13
|
*/
|
|
14
|
-
name
|
|
14
|
+
name?: string | null | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Line 1 of the address.
|
|
17
17
|
*/
|
|
@@ -19,11 +19,11 @@ export type PazeBillingAddress = {
|
|
|
19
19
|
/**
|
|
20
20
|
* Line 2 of the address.
|
|
21
21
|
*/
|
|
22
|
-
line2
|
|
22
|
+
line2?: string | null | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* Line 3 of the address.
|
|
25
25
|
*/
|
|
26
|
-
line3
|
|
26
|
+
line3?: string | null | undefined;
|
|
27
27
|
/**
|
|
28
28
|
* City.
|
|
29
29
|
*/
|
|
@@ -39,7 +39,7 @@ export type PazeBillingAddress = {
|
|
|
39
39
|
/**
|
|
40
40
|
* ISO 3166-1 alpha-2 country code.
|
|
41
41
|
*/
|
|
42
|
-
countryCode
|
|
42
|
+
countryCode?: string | null | undefined;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/** @internal */
|
|
@@ -48,14 +48,14 @@ export const PazeBillingAddress$inboundSchema: z.ZodType<
|
|
|
48
48
|
z.ZodTypeDef,
|
|
49
49
|
unknown
|
|
50
50
|
> = z.object({
|
|
51
|
-
name: z.nullable(z.string()),
|
|
51
|
+
name: z.nullable(z.string()).optional(),
|
|
52
52
|
line1: z.string(),
|
|
53
|
-
line2: z.nullable(z.string()),
|
|
54
|
-
line3: z.nullable(z.string()),
|
|
53
|
+
line2: z.nullable(z.string()).optional(),
|
|
54
|
+
line3: z.nullable(z.string()).optional(),
|
|
55
55
|
city: z.string(),
|
|
56
56
|
state: z.string(),
|
|
57
57
|
zip: z.string(),
|
|
58
|
-
countryCode: z.nullable(z.string()),
|
|
58
|
+
countryCode: z.nullable(z.string()).optional(),
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
export function pazeBillingAddressFromJSON(
|
|
@@ -9,6 +9,8 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
9
9
|
import {
|
|
10
10
|
PazeMobileNumber,
|
|
11
11
|
PazeMobileNumber$inboundSchema,
|
|
12
|
+
PazeMobileNumber$Outbound,
|
|
13
|
+
PazeMobileNumber$outboundSchema,
|
|
12
14
|
} from "./pazemobilenumber.js";
|
|
13
15
|
|
|
14
16
|
export type PazeDeliveryContactDetails = {
|
|
@@ -28,7 +30,29 @@ export const PazeDeliveryContactDetails$inboundSchema: z.ZodType<
|
|
|
28
30
|
contactFullName: z.nullable(z.string()),
|
|
29
31
|
contactPhoneNumber: z.nullable(PazeMobileNumber$inboundSchema),
|
|
30
32
|
});
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type PazeDeliveryContactDetails$Outbound = {
|
|
35
|
+
contactFullName: string | null;
|
|
36
|
+
contactPhoneNumber: PazeMobileNumber$Outbound | null;
|
|
37
|
+
};
|
|
31
38
|
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const PazeDeliveryContactDetails$outboundSchema: z.ZodType<
|
|
41
|
+
PazeDeliveryContactDetails$Outbound,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
PazeDeliveryContactDetails
|
|
44
|
+
> = z.object({
|
|
45
|
+
contactFullName: z.nullable(z.string()),
|
|
46
|
+
contactPhoneNumber: z.nullable(PazeMobileNumber$outboundSchema),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export function pazeDeliveryContactDetailsToJSON(
|
|
50
|
+
pazeDeliveryContactDetails: PazeDeliveryContactDetails,
|
|
51
|
+
): string {
|
|
52
|
+
return JSON.stringify(
|
|
53
|
+
PazeDeliveryContactDetails$outboundSchema.parse(pazeDeliveryContactDetails),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
32
56
|
export function pazeDeliveryContactDetailsFromJSON(
|
|
33
57
|
jsonString: string,
|
|
34
58
|
): SafeParseResult<PazeDeliveryContactDetails, SDKValidationError> {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import {
|
|
7
|
+
PazeShippingAddress,
|
|
8
|
+
PazeShippingAddress$Outbound,
|
|
9
|
+
PazeShippingAddress$outboundSchema,
|
|
10
|
+
} from "./pazeshippingaddress.js";
|
|
11
|
+
|
|
12
|
+
export type PazeEcomData = {
|
|
13
|
+
/**
|
|
14
|
+
* Whether the current transaction includes a gift card purchase.
|
|
15
|
+
*/
|
|
16
|
+
cartContainsGiftCard?: boolean | null | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the consumer order will be picked up rather than shipped.
|
|
19
|
+
*/
|
|
20
|
+
orderForPickup?: boolean | null | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Dollar value of the most expensive item ordered.
|
|
23
|
+
*/
|
|
24
|
+
orderHighestCost?: string | null | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Number of items ordered.
|
|
27
|
+
*/
|
|
28
|
+
orderQuantity?: string | null | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The selected shipping address. Returned only when `shippingPreference` is not `NONE`.
|
|
31
|
+
*/
|
|
32
|
+
finalShippingAddress?: PazeShippingAddress | null | undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export type PazeEcomData$Outbound = {
|
|
37
|
+
cartContainsGiftCard?: boolean | null | undefined;
|
|
38
|
+
orderForPickup?: boolean | null | undefined;
|
|
39
|
+
orderHighestCost?: string | null | undefined;
|
|
40
|
+
orderQuantity?: string | null | undefined;
|
|
41
|
+
finalShippingAddress?: PazeShippingAddress$Outbound | null | undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const PazeEcomData$outboundSchema: z.ZodType<
|
|
46
|
+
PazeEcomData$Outbound,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
PazeEcomData
|
|
49
|
+
> = z.object({
|
|
50
|
+
cartContainsGiftCard: z.nullable(z.boolean()).optional(),
|
|
51
|
+
orderForPickup: z.nullable(z.boolean()).optional(),
|
|
52
|
+
orderHighestCost: z.nullable(z.string()).optional(),
|
|
53
|
+
orderQuantity: z.nullable(z.string()).optional(),
|
|
54
|
+
finalShippingAddress: z.nullable(PazeShippingAddress$outboundSchema)
|
|
55
|
+
.optional(),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export function pazeEcomDataToJSON(pazeEcomData: PazeEcomData): string {
|
|
59
|
+
return JSON.stringify(PazeEcomData$outboundSchema.parse(pazeEcomData));
|
|
60
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import {
|
|
7
|
+
PazeEcomData,
|
|
8
|
+
PazeEcomData$Outbound,
|
|
9
|
+
PazeEcomData$outboundSchema,
|
|
10
|
+
} from "./pazeecomdata.js";
|
|
11
|
+
import {
|
|
12
|
+
PazeTravelData,
|
|
13
|
+
PazeTravelData$Outbound,
|
|
14
|
+
PazeTravelData$outboundSchema,
|
|
15
|
+
} from "./pazetraveldata.js";
|
|
16
|
+
|
|
17
|
+
export type PazeEnhancedTransactionData = {
|
|
18
|
+
/**
|
|
19
|
+
* Details pertaining to electronic commerce purchases.
|
|
20
|
+
*/
|
|
21
|
+
ecomData?: PazeEcomData | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Details pertaining to travel bookings.
|
|
24
|
+
*/
|
|
25
|
+
travelData?: PazeTravelData | null | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type PazeEnhancedTransactionData$Outbound = {
|
|
30
|
+
ecomData?: PazeEcomData$Outbound | null | undefined;
|
|
31
|
+
travelData?: PazeTravelData$Outbound | null | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const PazeEnhancedTransactionData$outboundSchema: z.ZodType<
|
|
36
|
+
PazeEnhancedTransactionData$Outbound,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
PazeEnhancedTransactionData
|
|
39
|
+
> = z.object({
|
|
40
|
+
ecomData: z.nullable(PazeEcomData$outboundSchema).optional(),
|
|
41
|
+
travelData: z.nullable(PazeTravelData$outboundSchema).optional(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export function pazeEnhancedTransactionDataToJSON(
|
|
45
|
+
pazeEnhancedTransactionData: PazeEnhancedTransactionData,
|
|
46
|
+
): string {
|
|
47
|
+
return JSON.stringify(
|
|
48
|
+
PazeEnhancedTransactionData$outboundSchema.parse(
|
|
49
|
+
pazeEnhancedTransactionData,
|
|
50
|
+
),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 PazeLocationAddress = {
|
|
8
|
+
/**
|
|
9
|
+
* Name of the organization or entity at the address.
|
|
10
|
+
*/
|
|
11
|
+
name?: string | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Line 1 of the address.
|
|
14
|
+
*/
|
|
15
|
+
line1: string;
|
|
16
|
+
/**
|
|
17
|
+
* Line 2 of the address.
|
|
18
|
+
*/
|
|
19
|
+
line2?: string | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Line 3 of the address.
|
|
22
|
+
*/
|
|
23
|
+
line3?: string | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* City.
|
|
26
|
+
*/
|
|
27
|
+
city: string;
|
|
28
|
+
/**
|
|
29
|
+
* State or region.
|
|
30
|
+
*/
|
|
31
|
+
state: string;
|
|
32
|
+
/**
|
|
33
|
+
* Postal code.
|
|
34
|
+
*/
|
|
35
|
+
zip: string;
|
|
36
|
+
/**
|
|
37
|
+
* ISO 3166-1 alpha-2 country code.
|
|
38
|
+
*/
|
|
39
|
+
countryCode: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type PazeLocationAddress$Outbound = {
|
|
44
|
+
name?: string | null | undefined;
|
|
45
|
+
line1: string;
|
|
46
|
+
line2?: string | null | undefined;
|
|
47
|
+
line3?: string | null | undefined;
|
|
48
|
+
city: string;
|
|
49
|
+
state: string;
|
|
50
|
+
zip: string;
|
|
51
|
+
countryCode: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const PazeLocationAddress$outboundSchema: z.ZodType<
|
|
56
|
+
PazeLocationAddress$Outbound,
|
|
57
|
+
z.ZodTypeDef,
|
|
58
|
+
PazeLocationAddress
|
|
59
|
+
> = z.object({
|
|
60
|
+
name: z.nullable(z.string()).optional(),
|
|
61
|
+
line1: z.string(),
|
|
62
|
+
line2: z.nullable(z.string()).optional(),
|
|
63
|
+
line3: z.nullable(z.string()).optional(),
|
|
64
|
+
city: z.string(),
|
|
65
|
+
state: z.string(),
|
|
66
|
+
zip: z.string(),
|
|
67
|
+
countryCode: z.string(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export function pazeLocationAddressToJSON(
|
|
71
|
+
pazeLocationAddress: PazeLocationAddress,
|
|
72
|
+
): string {
|
|
73
|
+
return JSON.stringify(
|
|
74
|
+
PazeLocationAddress$outboundSchema.parse(pazeLocationAddress),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -27,7 +27,29 @@ export const PazeMobileNumber$inboundSchema: z.ZodType<
|
|
|
27
27
|
countryCode: z.string(),
|
|
28
28
|
phoneNumber: z.string(),
|
|
29
29
|
});
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type PazeMobileNumber$Outbound = {
|
|
32
|
+
countryCode: string;
|
|
33
|
+
phoneNumber: string;
|
|
34
|
+
};
|
|
30
35
|
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const PazeMobileNumber$outboundSchema: z.ZodType<
|
|
38
|
+
PazeMobileNumber$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
PazeMobileNumber
|
|
41
|
+
> = z.object({
|
|
42
|
+
countryCode: z.string(),
|
|
43
|
+
phoneNumber: z.string(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export function pazeMobileNumberToJSON(
|
|
47
|
+
pazeMobileNumber: PazeMobileNumber,
|
|
48
|
+
): string {
|
|
49
|
+
return JSON.stringify(
|
|
50
|
+
PazeMobileNumber$outboundSchema.parse(pazeMobileNumber),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
31
53
|
export function pazeMobileNumberFromJSON(
|
|
32
54
|
jsonString: string,
|
|
33
55
|
): SafeParseResult<PazeMobileNumber, SDKValidationError> {
|
|
@@ -0,0 +1,64 @@
|
|
|
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 PazeSessionComplete = {
|
|
12
|
+
/**
|
|
13
|
+
* Unique identifier generated by Paze to track and link the wallet transaction. Used as the wallet transaction identifier.
|
|
14
|
+
*/
|
|
15
|
+
payloadId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Opaque token returned by Paze for the completion call.
|
|
18
|
+
*/
|
|
19
|
+
completeResponse: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Signed and encrypted payload containing the data necessary to process the payment. Returned when `payloadTypeIndicator` is PAYMENT.
|
|
22
|
+
*/
|
|
23
|
+
securePayload: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Echo of the `clientContext` sent on the request. Returned by Paze for client-side tracing.
|
|
26
|
+
*/
|
|
27
|
+
clientContext: string;
|
|
28
|
+
/**
|
|
29
|
+
* Paze-issued session identifier returned for tracing.
|
|
30
|
+
*/
|
|
31
|
+
ewSID: string;
|
|
32
|
+
/**
|
|
33
|
+
* Server timestamp of the Paze response in ISO 8601 format. Returned for tracing.
|
|
34
|
+
*/
|
|
35
|
+
timestampIso8601: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const PazeSessionComplete$inboundSchema: z.ZodType<
|
|
40
|
+
PazeSessionComplete,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
unknown
|
|
43
|
+
> = z.object({
|
|
44
|
+
payloadId: z.string(),
|
|
45
|
+
completeResponse: z.nullable(z.string()),
|
|
46
|
+
securePayload: z.nullable(z.string()),
|
|
47
|
+
clientContext: z.string(),
|
|
48
|
+
ewSID: z.string(),
|
|
49
|
+
timestampISO8601: z.string(),
|
|
50
|
+
}).transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
"timestampISO8601": "timestampIso8601",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export function pazeSessionCompleteFromJSON(
|
|
57
|
+
jsonString: string,
|
|
58
|
+
): SafeParseResult<PazeSessionComplete, SDKValidationError> {
|
|
59
|
+
return safeParse(
|
|
60
|
+
jsonString,
|
|
61
|
+
(x) => PazeSessionComplete$inboundSchema.parse(JSON.parse(x)),
|
|
62
|
+
`Failed to parse 'PazeSessionComplete' from JSON`,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
PazeEnhancedTransactionData,
|
|
10
|
+
PazeEnhancedTransactionData$Outbound,
|
|
11
|
+
PazeEnhancedTransactionData$outboundSchema,
|
|
12
|
+
} from "./pazeenhancedtransactiondata.js";
|
|
13
|
+
import {
|
|
14
|
+
PazeTransactionOptions,
|
|
15
|
+
PazeTransactionOptions$Outbound,
|
|
16
|
+
PazeTransactionOptions$outboundSchema,
|
|
17
|
+
} from "./pazetransactionoptions.js";
|
|
18
|
+
import {
|
|
19
|
+
PazeTransactionValue,
|
|
20
|
+
PazeTransactionValue$Outbound,
|
|
21
|
+
PazeTransactionValue$outboundSchema,
|
|
22
|
+
} from "./pazetransactionvalue.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The type of transaction being completed. PURCHASE for a one-off checkout, CARD_ON_FILE to retain the card for future use, or BOTH.
|
|
26
|
+
*/
|
|
27
|
+
export const PazeSessionCompleteRequestTransactiontype = {
|
|
28
|
+
Purchase: "PURCHASE",
|
|
29
|
+
CardOnFile: "CARD_ON_FILE",
|
|
30
|
+
Both: "BOTH",
|
|
31
|
+
} as const;
|
|
32
|
+
/**
|
|
33
|
+
* The type of transaction being completed. PURCHASE for a one-off checkout, CARD_ON_FILE to retain the card for future use, or BOTH.
|
|
34
|
+
*/
|
|
35
|
+
export type PazeSessionCompleteRequestTransactiontype = OpenEnum<
|
|
36
|
+
typeof PazeSessionCompleteRequestTransactiontype
|
|
37
|
+
>;
|
|
38
|
+
|
|
39
|
+
export const ProcessingNetwork = {
|
|
40
|
+
Visa: "VISA",
|
|
41
|
+
Mastercard: "MASTERCARD",
|
|
42
|
+
Discover: "DISCOVER",
|
|
43
|
+
} as const;
|
|
44
|
+
export type ProcessingNetwork = OpenEnum<typeof ProcessingNetwork>;
|
|
45
|
+
|
|
46
|
+
export type PazeSessionCompleteRequest = {
|
|
47
|
+
/**
|
|
48
|
+
* Session reference identifier generated by the merchant. Must match the value sent in the Paze session create call.
|
|
49
|
+
*/
|
|
50
|
+
sessionId: string;
|
|
51
|
+
/**
|
|
52
|
+
* Opaque token issued by the Paze service in the response from the most recent Paze UX interaction.
|
|
53
|
+
*/
|
|
54
|
+
code: string;
|
|
55
|
+
/**
|
|
56
|
+
* The Paze OAuth access token returned by the Paze mobile session create call. Used to authenticate the request to Paze.
|
|
57
|
+
*/
|
|
58
|
+
accessToken: string;
|
|
59
|
+
/**
|
|
60
|
+
* The type of transaction being completed. PURCHASE for a one-off checkout, CARD_ON_FILE to retain the card for future use, or BOTH.
|
|
61
|
+
*/
|
|
62
|
+
transactionType: PazeSessionCompleteRequestTransactiontype;
|
|
63
|
+
/**
|
|
64
|
+
* Client configuration data overriding values configured during merchant onboarding.
|
|
65
|
+
*/
|
|
66
|
+
transactionOptions?: PazeTransactionOptions | null | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Required when `transactionType` is PURCHASE or BOTH. Must be omitted when `transactionType` is CARD_ON_FILE.
|
|
69
|
+
*/
|
|
70
|
+
transactionValue?: PazeTransactionValue | null | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Card network to process the transaction on. If not provided, Paze defaults to the network on the front of the card.
|
|
73
|
+
*/
|
|
74
|
+
processingNetwork?: ProcessingNetwork | null | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Additional purchase context used by Paze for risk scoring.
|
|
77
|
+
*/
|
|
78
|
+
enhancedTransactionData?: PazeEnhancedTransactionData | null | undefined;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** @internal */
|
|
82
|
+
export const PazeSessionCompleteRequestTransactiontype$outboundSchema:
|
|
83
|
+
z.ZodType<string, z.ZodTypeDef, PazeSessionCompleteRequestTransactiontype> =
|
|
84
|
+
openEnums.outboundSchema(PazeSessionCompleteRequestTransactiontype);
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const ProcessingNetwork$outboundSchema: z.ZodType<
|
|
88
|
+
string,
|
|
89
|
+
z.ZodTypeDef,
|
|
90
|
+
ProcessingNetwork
|
|
91
|
+
> = openEnums.outboundSchema(ProcessingNetwork);
|
|
92
|
+
|
|
93
|
+
/** @internal */
|
|
94
|
+
export type PazeSessionCompleteRequest$Outbound = {
|
|
95
|
+
sessionId: string;
|
|
96
|
+
code: string;
|
|
97
|
+
accessToken: string;
|
|
98
|
+
transactionType: string;
|
|
99
|
+
transactionOptions?: PazeTransactionOptions$Outbound | null | undefined;
|
|
100
|
+
transactionValue?: PazeTransactionValue$Outbound | null | undefined;
|
|
101
|
+
processingNetwork?: string | null | undefined;
|
|
102
|
+
enhancedTransactionData?:
|
|
103
|
+
| PazeEnhancedTransactionData$Outbound
|
|
104
|
+
| null
|
|
105
|
+
| undefined;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export const PazeSessionCompleteRequest$outboundSchema: z.ZodType<
|
|
110
|
+
PazeSessionCompleteRequest$Outbound,
|
|
111
|
+
z.ZodTypeDef,
|
|
112
|
+
PazeSessionCompleteRequest
|
|
113
|
+
> = z.object({
|
|
114
|
+
sessionId: z.string(),
|
|
115
|
+
code: z.string(),
|
|
116
|
+
accessToken: z.string(),
|
|
117
|
+
transactionType: PazeSessionCompleteRequestTransactiontype$outboundSchema,
|
|
118
|
+
transactionOptions: z.nullable(PazeTransactionOptions$outboundSchema)
|
|
119
|
+
.optional(),
|
|
120
|
+
transactionValue: z.nullable(PazeTransactionValue$outboundSchema).optional(),
|
|
121
|
+
processingNetwork: z.nullable(ProcessingNetwork$outboundSchema).optional(),
|
|
122
|
+
enhancedTransactionData: z.nullable(
|
|
123
|
+
PazeEnhancedTransactionData$outboundSchema,
|
|
124
|
+
).optional(),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export function pazeSessionCompleteRequestToJSON(
|
|
128
|
+
pazeSessionCompleteRequest: PazeSessionCompleteRequest,
|
|
129
|
+
): string {
|
|
130
|
+
return JSON.stringify(
|
|
131
|
+
PazeSessionCompleteRequest$outboundSchema.parse(pazeSessionCompleteRequest),
|
|
132
|
+
);
|
|
133
|
+
}
|
|
@@ -9,6 +9,8 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
9
9
|
import {
|
|
10
10
|
PazeDeliveryContactDetails,
|
|
11
11
|
PazeDeliveryContactDetails$inboundSchema,
|
|
12
|
+
PazeDeliveryContactDetails$Outbound,
|
|
13
|
+
PazeDeliveryContactDetails$outboundSchema,
|
|
12
14
|
} from "./pazedeliverycontactdetails.js";
|
|
13
15
|
|
|
14
16
|
export type PazeShippingAddress = {
|
|
@@ -19,11 +21,11 @@ export type PazeShippingAddress = {
|
|
|
19
21
|
/**
|
|
20
22
|
* Line 2 of the address.
|
|
21
23
|
*/
|
|
22
|
-
line2
|
|
24
|
+
line2?: string | null | undefined;
|
|
23
25
|
/**
|
|
24
26
|
* Line 3 of the address.
|
|
25
27
|
*/
|
|
26
|
-
line3
|
|
28
|
+
line3?: string | null | undefined;
|
|
27
29
|
/**
|
|
28
30
|
* City.
|
|
29
31
|
*/
|
|
@@ -50,15 +52,49 @@ export const PazeShippingAddress$inboundSchema: z.ZodType<
|
|
|
50
52
|
unknown
|
|
51
53
|
> = z.object({
|
|
52
54
|
line1: z.string(),
|
|
53
|
-
line2: z.nullable(z.string()),
|
|
54
|
-
line3: z.nullable(z.string()),
|
|
55
|
+
line2: z.nullable(z.string()).optional(),
|
|
56
|
+
line3: z.nullable(z.string()).optional(),
|
|
55
57
|
city: z.string(),
|
|
56
58
|
state: z.string(),
|
|
57
59
|
zip: z.string(),
|
|
58
60
|
countryCode: z.string(),
|
|
59
61
|
deliveryContactDetails: z.nullable(PazeDeliveryContactDetails$inboundSchema),
|
|
60
62
|
});
|
|
63
|
+
/** @internal */
|
|
64
|
+
export type PazeShippingAddress$Outbound = {
|
|
65
|
+
line1: string;
|
|
66
|
+
line2?: string | null | undefined;
|
|
67
|
+
line3?: string | null | undefined;
|
|
68
|
+
city: string;
|
|
69
|
+
state: string;
|
|
70
|
+
zip: string;
|
|
71
|
+
countryCode: string;
|
|
72
|
+
deliveryContactDetails: PazeDeliveryContactDetails$Outbound | null;
|
|
73
|
+
};
|
|
61
74
|
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const PazeShippingAddress$outboundSchema: z.ZodType<
|
|
77
|
+
PazeShippingAddress$Outbound,
|
|
78
|
+
z.ZodTypeDef,
|
|
79
|
+
PazeShippingAddress
|
|
80
|
+
> = z.object({
|
|
81
|
+
line1: z.string(),
|
|
82
|
+
line2: z.nullable(z.string()).optional(),
|
|
83
|
+
line3: z.nullable(z.string()).optional(),
|
|
84
|
+
city: z.string(),
|
|
85
|
+
state: z.string(),
|
|
86
|
+
zip: z.string(),
|
|
87
|
+
countryCode: z.string(),
|
|
88
|
+
deliveryContactDetails: z.nullable(PazeDeliveryContactDetails$outboundSchema),
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export function pazeShippingAddressToJSON(
|
|
92
|
+
pazeShippingAddress: PazeShippingAddress,
|
|
93
|
+
): string {
|
|
94
|
+
return JSON.stringify(
|
|
95
|
+
PazeShippingAddress$outboundSchema.parse(pazeShippingAddress),
|
|
96
|
+
);
|
|
97
|
+
}
|
|
62
98
|
export function pazeShippingAddressFromJSON(
|
|
63
99
|
jsonString: string,
|
|
64
100
|
): SafeParseResult<PazeShippingAddress, SDKValidationError> {
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
|
|
9
|
+
export const PazeTransactionOptionsBillingPreference = {
|
|
10
|
+
All: "ALL",
|
|
11
|
+
None: "NONE",
|
|
12
|
+
} as const;
|
|
13
|
+
export type PazeTransactionOptionsBillingPreference = OpenEnum<
|
|
14
|
+
typeof PazeTransactionOptionsBillingPreference
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export const PayloadTypeIndicator = {
|
|
18
|
+
Id: "ID",
|
|
19
|
+
Payment: "PAYMENT",
|
|
20
|
+
} as const;
|
|
21
|
+
export type PayloadTypeIndicator = OpenEnum<typeof PayloadTypeIndicator>;
|
|
22
|
+
|
|
23
|
+
export type PazeTransactionOptions = {
|
|
24
|
+
/**
|
|
25
|
+
* Merchant Category Code (MCC) of the merchant.
|
|
26
|
+
*/
|
|
27
|
+
merchantCategoryCode?: string | null | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Verbosity of the billing address required by the merchant.
|
|
30
|
+
*/
|
|
31
|
+
billingPreference?:
|
|
32
|
+
| PazeTransactionOptionsBillingPreference
|
|
33
|
+
| null
|
|
34
|
+
| undefined;
|
|
35
|
+
/**
|
|
36
|
+
* ID returns `payloadId` only (default). PAYMENT returns `payloadId` and `securePayload`.
|
|
37
|
+
*/
|
|
38
|
+
payloadTypeIndicator?: PayloadTypeIndicator | null | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const PazeTransactionOptionsBillingPreference$outboundSchema: z.ZodType<
|
|
43
|
+
string,
|
|
44
|
+
z.ZodTypeDef,
|
|
45
|
+
PazeTransactionOptionsBillingPreference
|
|
46
|
+
> = openEnums.outboundSchema(PazeTransactionOptionsBillingPreference);
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const PayloadTypeIndicator$outboundSchema: z.ZodType<
|
|
50
|
+
string,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
PayloadTypeIndicator
|
|
53
|
+
> = openEnums.outboundSchema(PayloadTypeIndicator);
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
export type PazeTransactionOptions$Outbound = {
|
|
57
|
+
merchantCategoryCode?: string | null | undefined;
|
|
58
|
+
billingPreference?: string | null | undefined;
|
|
59
|
+
payloadTypeIndicator?: string | null | undefined;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const PazeTransactionOptions$outboundSchema: z.ZodType<
|
|
64
|
+
PazeTransactionOptions$Outbound,
|
|
65
|
+
z.ZodTypeDef,
|
|
66
|
+
PazeTransactionOptions
|
|
67
|
+
> = z.object({
|
|
68
|
+
merchantCategoryCode: z.nullable(z.string()).optional(),
|
|
69
|
+
billingPreference: z.nullable(
|
|
70
|
+
PazeTransactionOptionsBillingPreference$outboundSchema,
|
|
71
|
+
).optional(),
|
|
72
|
+
payloadTypeIndicator: z.nullable(PayloadTypeIndicator$outboundSchema)
|
|
73
|
+
.optional(),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export function pazeTransactionOptionsToJSON(
|
|
77
|
+
pazeTransactionOptions: PazeTransactionOptions,
|
|
78
|
+
): string {
|
|
79
|
+
return JSON.stringify(
|
|
80
|
+
PazeTransactionOptions$outboundSchema.parse(pazeTransactionOptions),
|
|
81
|
+
);
|
|
82
|
+
}
|