ce-storefront 0.18.1 → 0.18.2
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/docs/sdks/orders/README.md +0 -16
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/components/index.d.ts +8 -1
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +8 -1
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/juspaycard.d.ts +86 -0
- package/esm/models/components/juspaycard.d.ts.map +1 -0
- package/esm/models/components/juspaycard.js +114 -0
- package/esm/models/components/juspaycard.js.map +1 -0
- package/esm/models/components/juspayexpresscheckout.d.ts +33 -0
- package/esm/models/components/juspayexpresscheckout.d.ts.map +1 -0
- package/esm/models/components/juspayexpresscheckout.js +44 -0
- package/esm/models/components/juspayexpresscheckout.js.map +1 -0
- package/esm/models/components/juspayhypercheckout.d.ts +63 -0
- package/esm/models/components/juspayhypercheckout.d.ts.map +1 -0
- package/esm/models/components/juspayhypercheckout.js +74 -0
- package/esm/models/components/juspayhypercheckout.js.map +1 -0
- package/esm/models/components/juspaynetbanking.d.ts +44 -0
- package/esm/models/components/juspaynetbanking.d.ts.map +1 -0
- package/esm/models/components/juspaynetbanking.js +65 -0
- package/esm/models/components/juspaynetbanking.js.map +1 -0
- package/esm/models/components/juspaypaymentgatewayparams.d.ts +8 -8
- package/esm/models/components/juspaypaymentgatewayparams.d.ts.map +1 -1
- package/esm/models/components/juspaypaymentgatewayparams.js +12 -13
- package/esm/models/components/juspaypaymentgatewayparams.js.map +1 -1
- package/esm/models/components/juspaysavedcardtoken.d.ts +80 -0
- package/esm/models/components/juspaysavedcardtoken.d.ts.map +1 -0
- package/esm/models/components/juspaysavedcardtoken.js +102 -0
- package/esm/models/components/juspaysavedcardtoken.js.map +1 -0
- package/esm/models/components/juspayupicollect.d.ts +46 -0
- package/esm/models/components/juspayupicollect.d.ts.map +1 -0
- package/esm/models/components/juspayupicollect.js +69 -0
- package/esm/models/components/juspayupicollect.js.map +1 -0
- package/esm/models/components/juspayupiintent.d.ts +48 -0
- package/esm/models/components/juspayupiintent.d.ts.map +1 -0
- package/esm/models/components/juspayupiintent.js +73 -0
- package/esm/models/components/juspayupiintent.js.map +1 -0
- package/esm/models/components/paymentmethodpayload.d.ts +30 -0
- package/esm/models/components/paymentmethodpayload.d.ts.map +1 -0
- package/esm/models/components/paymentmethodpayload.js +35 -0
- package/esm/models/components/paymentmethodpayload.js.map +1 -0
- package/esm/models/operations/createorder.d.ts +2 -4
- package/esm/models/operations/createorder.d.ts.map +1 -1
- package/esm/models/operations/createorder.js +4 -8
- package/esm/models/operations/createorder.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +8 -1
- package/src/models/components/juspaycard.ts +185 -0
- package/src/models/components/juspayexpresscheckout.ts +113 -0
- package/src/models/components/juspayhypercheckout.ts +126 -0
- package/src/models/components/juspaynetbanking.ts +115 -0
- package/src/models/components/juspaypaymentgatewayparams.ts +18 -14
- package/src/models/components/juspaysavedcardtoken.ts +174 -0
- package/src/models/components/juspayupicollect.ts +121 -0
- package/src/models/components/juspayupiintent.ts +125 -0
- package/src/models/components/paymentmethodpayload.ts +81 -0
- package/src/models/operations/createorder.ts +6 -12
- package/esm/models/components/paymentgateway.d.ts +0 -34
- package/esm/models/components/paymentgateway.d.ts.map +0 -1
- package/esm/models/components/paymentgateway.js +0 -27
- package/esm/models/components/paymentgateway.js.map +0 -1
- package/src/models/components/paymentgateway.ts +0 -39
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const Action = {
|
|
13
|
+
PaymentPage: "paymentPage",
|
|
14
|
+
} as const;
|
|
15
|
+
export type Action = ClosedEnum<typeof Action>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/JusPayHyperCheckout} - API reference for the JusPayHyperCheckout schema
|
|
19
|
+
*/
|
|
20
|
+
export type JusPayHyperCheckout = {
|
|
21
|
+
paymentMethodSlug: string;
|
|
22
|
+
integrationType?: "hyper-checkout" | undefined;
|
|
23
|
+
gatewayReferenceId: string;
|
|
24
|
+
returnUrl: string;
|
|
25
|
+
action: Action;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const Action$inboundSchema: z.ZodNativeEnum<typeof Action> = z
|
|
30
|
+
.nativeEnum(Action);
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const Action$outboundSchema: z.ZodNativeEnum<typeof Action> =
|
|
34
|
+
Action$inboundSchema;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
39
|
+
*/
|
|
40
|
+
export namespace Action$ {
|
|
41
|
+
/** @deprecated use `Action$inboundSchema` instead. */
|
|
42
|
+
export const inboundSchema = Action$inboundSchema;
|
|
43
|
+
/** @deprecated use `Action$outboundSchema` instead. */
|
|
44
|
+
export const outboundSchema = Action$outboundSchema;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const JusPayHyperCheckout$inboundSchema: z.ZodType<
|
|
49
|
+
JusPayHyperCheckout,
|
|
50
|
+
z.ZodTypeDef,
|
|
51
|
+
unknown
|
|
52
|
+
> = z.object({
|
|
53
|
+
payment_method_slug: z.string(),
|
|
54
|
+
integration_type: z.literal("hyper-checkout").default("hyper-checkout")
|
|
55
|
+
.optional(),
|
|
56
|
+
gateway_reference_id: z.string(),
|
|
57
|
+
return_url: z.string(),
|
|
58
|
+
action: Action$inboundSchema,
|
|
59
|
+
}).transform((v) => {
|
|
60
|
+
return remap$(v, {
|
|
61
|
+
"payment_method_slug": "paymentMethodSlug",
|
|
62
|
+
"integration_type": "integrationType",
|
|
63
|
+
"gateway_reference_id": "gatewayReferenceId",
|
|
64
|
+
"return_url": "returnUrl",
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export type JusPayHyperCheckout$Outbound = {
|
|
70
|
+
payment_method_slug: string;
|
|
71
|
+
integration_type: "hyper-checkout";
|
|
72
|
+
gateway_reference_id: string;
|
|
73
|
+
return_url: string;
|
|
74
|
+
action: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const JusPayHyperCheckout$outboundSchema: z.ZodType<
|
|
79
|
+
JusPayHyperCheckout$Outbound,
|
|
80
|
+
z.ZodTypeDef,
|
|
81
|
+
JusPayHyperCheckout
|
|
82
|
+
> = z.object({
|
|
83
|
+
paymentMethodSlug: z.string(),
|
|
84
|
+
integrationType: z.literal("hyper-checkout"),
|
|
85
|
+
gatewayReferenceId: z.string(),
|
|
86
|
+
returnUrl: z.string(),
|
|
87
|
+
action: Action$outboundSchema,
|
|
88
|
+
}).transform((v) => {
|
|
89
|
+
return remap$(v, {
|
|
90
|
+
paymentMethodSlug: "payment_method_slug",
|
|
91
|
+
integrationType: "integration_type",
|
|
92
|
+
gatewayReferenceId: "gateway_reference_id",
|
|
93
|
+
returnUrl: "return_url",
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @internal
|
|
99
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
100
|
+
*/
|
|
101
|
+
export namespace JusPayHyperCheckout$ {
|
|
102
|
+
/** @deprecated use `JusPayHyperCheckout$inboundSchema` instead. */
|
|
103
|
+
export const inboundSchema = JusPayHyperCheckout$inboundSchema;
|
|
104
|
+
/** @deprecated use `JusPayHyperCheckout$outboundSchema` instead. */
|
|
105
|
+
export const outboundSchema = JusPayHyperCheckout$outboundSchema;
|
|
106
|
+
/** @deprecated use `JusPayHyperCheckout$Outbound` instead. */
|
|
107
|
+
export type Outbound = JusPayHyperCheckout$Outbound;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function jusPayHyperCheckoutToJSON(
|
|
111
|
+
jusPayHyperCheckout: JusPayHyperCheckout,
|
|
112
|
+
): string {
|
|
113
|
+
return JSON.stringify(
|
|
114
|
+
JusPayHyperCheckout$outboundSchema.parse(jusPayHyperCheckout),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function jusPayHyperCheckoutFromJSON(
|
|
119
|
+
jsonString: string,
|
|
120
|
+
): SafeParseResult<JusPayHyperCheckout, SDKValidationError> {
|
|
121
|
+
return safeParse(
|
|
122
|
+
jsonString,
|
|
123
|
+
(x) => JusPayHyperCheckout$inboundSchema.parse(JSON.parse(x)),
|
|
124
|
+
`Failed to parse 'JusPayHyperCheckout' from JSON`,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
/**
|
|
12
|
+
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/JuspayNetBanking} - API reference for the JuspayNetBanking schema
|
|
13
|
+
*/
|
|
14
|
+
export type JuspayNetBanking = {
|
|
15
|
+
paymentMethodSlug: string;
|
|
16
|
+
integrationType?: "express-checkout" | undefined;
|
|
17
|
+
gatewayReferenceId: string;
|
|
18
|
+
returnUrl?: string | undefined;
|
|
19
|
+
redirectAfterPayment: boolean;
|
|
20
|
+
paymentMethodType?: "NB" | undefined;
|
|
21
|
+
paymentMethod: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const JuspayNetBanking$inboundSchema: z.ZodType<
|
|
26
|
+
JuspayNetBanking,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
payment_method_slug: z.string(),
|
|
31
|
+
integration_type: z.literal("express-checkout").default("express-checkout")
|
|
32
|
+
.optional(),
|
|
33
|
+
gateway_reference_id: z.string(),
|
|
34
|
+
return_url: z.string().optional(),
|
|
35
|
+
redirect_after_payment: z.boolean(),
|
|
36
|
+
payment_method_type: z.literal("NB").default("NB").optional(),
|
|
37
|
+
payment_method: z.string(),
|
|
38
|
+
}).transform((v) => {
|
|
39
|
+
return remap$(v, {
|
|
40
|
+
"payment_method_slug": "paymentMethodSlug",
|
|
41
|
+
"integration_type": "integrationType",
|
|
42
|
+
"gateway_reference_id": "gatewayReferenceId",
|
|
43
|
+
"return_url": "returnUrl",
|
|
44
|
+
"redirect_after_payment": "redirectAfterPayment",
|
|
45
|
+
"payment_method_type": "paymentMethodType",
|
|
46
|
+
"payment_method": "paymentMethod",
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export type JuspayNetBanking$Outbound = {
|
|
52
|
+
payment_method_slug: string;
|
|
53
|
+
integration_type: "express-checkout";
|
|
54
|
+
gateway_reference_id: string;
|
|
55
|
+
return_url?: string | undefined;
|
|
56
|
+
redirect_after_payment: boolean;
|
|
57
|
+
payment_method_type: "NB";
|
|
58
|
+
payment_method: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const JuspayNetBanking$outboundSchema: z.ZodType<
|
|
63
|
+
JuspayNetBanking$Outbound,
|
|
64
|
+
z.ZodTypeDef,
|
|
65
|
+
JuspayNetBanking
|
|
66
|
+
> = z.object({
|
|
67
|
+
paymentMethodSlug: z.string(),
|
|
68
|
+
integrationType: z.literal("express-checkout"),
|
|
69
|
+
gatewayReferenceId: z.string(),
|
|
70
|
+
returnUrl: z.string().optional(),
|
|
71
|
+
redirectAfterPayment: z.boolean(),
|
|
72
|
+
paymentMethodType: z.literal("NB"),
|
|
73
|
+
paymentMethod: z.string(),
|
|
74
|
+
}).transform((v) => {
|
|
75
|
+
return remap$(v, {
|
|
76
|
+
paymentMethodSlug: "payment_method_slug",
|
|
77
|
+
integrationType: "integration_type",
|
|
78
|
+
gatewayReferenceId: "gateway_reference_id",
|
|
79
|
+
returnUrl: "return_url",
|
|
80
|
+
redirectAfterPayment: "redirect_after_payment",
|
|
81
|
+
paymentMethodType: "payment_method_type",
|
|
82
|
+
paymentMethod: "payment_method",
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
89
|
+
*/
|
|
90
|
+
export namespace JuspayNetBanking$ {
|
|
91
|
+
/** @deprecated use `JuspayNetBanking$inboundSchema` instead. */
|
|
92
|
+
export const inboundSchema = JuspayNetBanking$inboundSchema;
|
|
93
|
+
/** @deprecated use `JuspayNetBanking$outboundSchema` instead. */
|
|
94
|
+
export const outboundSchema = JuspayNetBanking$outboundSchema;
|
|
95
|
+
/** @deprecated use `JuspayNetBanking$Outbound` instead. */
|
|
96
|
+
export type Outbound = JuspayNetBanking$Outbound;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function juspayNetBankingToJSON(
|
|
100
|
+
juspayNetBanking: JuspayNetBanking,
|
|
101
|
+
): string {
|
|
102
|
+
return JSON.stringify(
|
|
103
|
+
JuspayNetBanking$outboundSchema.parse(juspayNetBanking),
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function juspayNetBankingFromJSON(
|
|
108
|
+
jsonString: string,
|
|
109
|
+
): SafeParseResult<JuspayNetBanking, SDKValidationError> {
|
|
110
|
+
return safeParse(
|
|
111
|
+
jsonString,
|
|
112
|
+
(x) => JuspayNetBanking$inboundSchema.parse(JSON.parse(x)),
|
|
113
|
+
`Failed to parse 'JuspayNetBanking' from JSON`,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -12,14 +12,16 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
12
12
|
/**
|
|
13
13
|
* `paymentPage` is the default option that you should select when using hyper-checkout
|
|
14
14
|
*/
|
|
15
|
-
export const
|
|
15
|
+
export const JuspayPaymentGatewayParamsAction = {
|
|
16
16
|
PaymentPage: "paymentPage",
|
|
17
17
|
PaymentManagement: "paymentManagement",
|
|
18
18
|
} as const;
|
|
19
19
|
/**
|
|
20
20
|
* `paymentPage` is the default option that you should select when using hyper-checkout
|
|
21
21
|
*/
|
|
22
|
-
export type
|
|
22
|
+
export type JuspayPaymentGatewayParamsAction = ClosedEnum<
|
|
23
|
+
typeof JuspayPaymentGatewayParamsAction
|
|
24
|
+
>;
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* Use `hyper-checkout` for Juspay hosted checkout
|
|
@@ -41,7 +43,7 @@ export type JuspayPaymentGatewayParams = {
|
|
|
41
43
|
/**
|
|
42
44
|
* `paymentPage` is the default option that you should select when using hyper-checkout
|
|
43
45
|
*/
|
|
44
|
-
action:
|
|
46
|
+
action: JuspayPaymentGatewayParamsAction;
|
|
45
47
|
/**
|
|
46
48
|
* Use `hyper-checkout` for Juspay hosted checkout
|
|
47
49
|
*/
|
|
@@ -57,22 +59,24 @@ export type JuspayPaymentGatewayParams = {
|
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
/** @internal */
|
|
60
|
-
export const
|
|
61
|
-
|
|
62
|
+
export const JuspayPaymentGatewayParamsAction$inboundSchema: z.ZodNativeEnum<
|
|
63
|
+
typeof JuspayPaymentGatewayParamsAction
|
|
64
|
+
> = z.nativeEnum(JuspayPaymentGatewayParamsAction);
|
|
62
65
|
|
|
63
66
|
/** @internal */
|
|
64
|
-
export const
|
|
65
|
-
|
|
67
|
+
export const JuspayPaymentGatewayParamsAction$outboundSchema: z.ZodNativeEnum<
|
|
68
|
+
typeof JuspayPaymentGatewayParamsAction
|
|
69
|
+
> = JuspayPaymentGatewayParamsAction$inboundSchema;
|
|
66
70
|
|
|
67
71
|
/**
|
|
68
72
|
* @internal
|
|
69
73
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
70
74
|
*/
|
|
71
|
-
export namespace
|
|
72
|
-
/** @deprecated use `
|
|
73
|
-
export const inboundSchema =
|
|
74
|
-
/** @deprecated use `
|
|
75
|
-
export const outboundSchema =
|
|
75
|
+
export namespace JuspayPaymentGatewayParamsAction$ {
|
|
76
|
+
/** @deprecated use `JuspayPaymentGatewayParamsAction$inboundSchema` instead. */
|
|
77
|
+
export const inboundSchema = JuspayPaymentGatewayParamsAction$inboundSchema;
|
|
78
|
+
/** @deprecated use `JuspayPaymentGatewayParamsAction$outboundSchema` instead. */
|
|
79
|
+
export const outboundSchema = JuspayPaymentGatewayParamsAction$outboundSchema;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
/** @internal */
|
|
@@ -103,7 +107,7 @@ export const JuspayPaymentGatewayParams$inboundSchema: z.ZodType<
|
|
|
103
107
|
unknown
|
|
104
108
|
> = z.object({
|
|
105
109
|
payment_gateway: z.literal("JUSPAY").default("JUSPAY"),
|
|
106
|
-
action:
|
|
110
|
+
action: JuspayPaymentGatewayParamsAction$inboundSchema,
|
|
107
111
|
integration_type: IntegrationType$inboundSchema,
|
|
108
112
|
return_url: z.string(),
|
|
109
113
|
gateway_reference_id: z.string(),
|
|
@@ -132,7 +136,7 @@ export const JuspayPaymentGatewayParams$outboundSchema: z.ZodType<
|
|
|
132
136
|
JuspayPaymentGatewayParams
|
|
133
137
|
> = z.object({
|
|
134
138
|
paymentGateway: z.literal("JUSPAY").default("JUSPAY" as const),
|
|
135
|
-
action:
|
|
139
|
+
action: JuspayPaymentGatewayParamsAction$outboundSchema,
|
|
136
140
|
integrationType: IntegrationType$outboundSchema,
|
|
137
141
|
returnUrl: z.string(),
|
|
138
142
|
gatewayReferenceId: z.string(),
|
|
@@ -0,0 +1,174 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const JusPaySavedCardTokenPaymentMethod = {
|
|
13
|
+
Visa: "VISA",
|
|
14
|
+
Master: "MASTER",
|
|
15
|
+
} as const;
|
|
16
|
+
export type JusPaySavedCardTokenPaymentMethod = ClosedEnum<
|
|
17
|
+
typeof JusPaySavedCardTokenPaymentMethod
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/JusPaySavedCardToken} - API reference for the JusPaySavedCardToken schema
|
|
22
|
+
*/
|
|
23
|
+
export type JusPaySavedCardToken = {
|
|
24
|
+
paymentMethodSlug: string;
|
|
25
|
+
integrationType?: "express-checkout" | undefined;
|
|
26
|
+
gatewayReferenceId: string;
|
|
27
|
+
returnUrl?: string | undefined;
|
|
28
|
+
redirectAfterPayment: boolean;
|
|
29
|
+
authType?: "OTP" | undefined;
|
|
30
|
+
tokenize: boolean;
|
|
31
|
+
saveToLocker: boolean;
|
|
32
|
+
paymentMethodType?: "CARD" | undefined;
|
|
33
|
+
paymentMethod: JusPaySavedCardTokenPaymentMethod;
|
|
34
|
+
cardToken: string;
|
|
35
|
+
cardSecurityCode: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const JusPaySavedCardTokenPaymentMethod$inboundSchema: z.ZodNativeEnum<
|
|
40
|
+
typeof JusPaySavedCardTokenPaymentMethod
|
|
41
|
+
> = z.nativeEnum(JusPaySavedCardTokenPaymentMethod);
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const JusPaySavedCardTokenPaymentMethod$outboundSchema: z.ZodNativeEnum<
|
|
45
|
+
typeof JusPaySavedCardTokenPaymentMethod
|
|
46
|
+
> = JusPaySavedCardTokenPaymentMethod$inboundSchema;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
51
|
+
*/
|
|
52
|
+
export namespace JusPaySavedCardTokenPaymentMethod$ {
|
|
53
|
+
/** @deprecated use `JusPaySavedCardTokenPaymentMethod$inboundSchema` instead. */
|
|
54
|
+
export const inboundSchema = JusPaySavedCardTokenPaymentMethod$inboundSchema;
|
|
55
|
+
/** @deprecated use `JusPaySavedCardTokenPaymentMethod$outboundSchema` instead. */
|
|
56
|
+
export const outboundSchema =
|
|
57
|
+
JusPaySavedCardTokenPaymentMethod$outboundSchema;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const JusPaySavedCardToken$inboundSchema: z.ZodType<
|
|
62
|
+
JusPaySavedCardToken,
|
|
63
|
+
z.ZodTypeDef,
|
|
64
|
+
unknown
|
|
65
|
+
> = z.object({
|
|
66
|
+
payment_method_slug: z.string(),
|
|
67
|
+
integration_type: z.literal("express-checkout").default("express-checkout")
|
|
68
|
+
.optional(),
|
|
69
|
+
gateway_reference_id: z.string(),
|
|
70
|
+
return_url: z.string().optional(),
|
|
71
|
+
redirect_after_payment: z.boolean(),
|
|
72
|
+
auth_type: z.literal("OTP").default("OTP").optional(),
|
|
73
|
+
tokenize: z.boolean(),
|
|
74
|
+
save_to_locker: z.boolean(),
|
|
75
|
+
payment_method_type: z.literal("CARD").default("CARD").optional(),
|
|
76
|
+
payment_method: JusPaySavedCardTokenPaymentMethod$inboundSchema,
|
|
77
|
+
card_token: z.string(),
|
|
78
|
+
card_security_code: z.string(),
|
|
79
|
+
}).transform((v) => {
|
|
80
|
+
return remap$(v, {
|
|
81
|
+
"payment_method_slug": "paymentMethodSlug",
|
|
82
|
+
"integration_type": "integrationType",
|
|
83
|
+
"gateway_reference_id": "gatewayReferenceId",
|
|
84
|
+
"return_url": "returnUrl",
|
|
85
|
+
"redirect_after_payment": "redirectAfterPayment",
|
|
86
|
+
"auth_type": "authType",
|
|
87
|
+
"save_to_locker": "saveToLocker",
|
|
88
|
+
"payment_method_type": "paymentMethodType",
|
|
89
|
+
"payment_method": "paymentMethod",
|
|
90
|
+
"card_token": "cardToken",
|
|
91
|
+
"card_security_code": "cardSecurityCode",
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export type JusPaySavedCardToken$Outbound = {
|
|
97
|
+
payment_method_slug: string;
|
|
98
|
+
integration_type: "express-checkout";
|
|
99
|
+
gateway_reference_id: string;
|
|
100
|
+
return_url?: string | undefined;
|
|
101
|
+
redirect_after_payment: boolean;
|
|
102
|
+
auth_type: "OTP";
|
|
103
|
+
tokenize: boolean;
|
|
104
|
+
save_to_locker: boolean;
|
|
105
|
+
payment_method_type: "CARD";
|
|
106
|
+
payment_method: string;
|
|
107
|
+
card_token: string;
|
|
108
|
+
card_security_code: string;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const JusPaySavedCardToken$outboundSchema: z.ZodType<
|
|
113
|
+
JusPaySavedCardToken$Outbound,
|
|
114
|
+
z.ZodTypeDef,
|
|
115
|
+
JusPaySavedCardToken
|
|
116
|
+
> = z.object({
|
|
117
|
+
paymentMethodSlug: z.string(),
|
|
118
|
+
integrationType: z.literal("express-checkout"),
|
|
119
|
+
gatewayReferenceId: z.string(),
|
|
120
|
+
returnUrl: z.string().optional(),
|
|
121
|
+
redirectAfterPayment: z.boolean(),
|
|
122
|
+
authType: z.literal("OTP"),
|
|
123
|
+
tokenize: z.boolean(),
|
|
124
|
+
saveToLocker: z.boolean(),
|
|
125
|
+
paymentMethodType: z.literal("CARD"),
|
|
126
|
+
paymentMethod: JusPaySavedCardTokenPaymentMethod$outboundSchema,
|
|
127
|
+
cardToken: z.string(),
|
|
128
|
+
cardSecurityCode: z.string(),
|
|
129
|
+
}).transform((v) => {
|
|
130
|
+
return remap$(v, {
|
|
131
|
+
paymentMethodSlug: "payment_method_slug",
|
|
132
|
+
integrationType: "integration_type",
|
|
133
|
+
gatewayReferenceId: "gateway_reference_id",
|
|
134
|
+
returnUrl: "return_url",
|
|
135
|
+
redirectAfterPayment: "redirect_after_payment",
|
|
136
|
+
authType: "auth_type",
|
|
137
|
+
saveToLocker: "save_to_locker",
|
|
138
|
+
paymentMethodType: "payment_method_type",
|
|
139
|
+
paymentMethod: "payment_method",
|
|
140
|
+
cardToken: "card_token",
|
|
141
|
+
cardSecurityCode: "card_security_code",
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @internal
|
|
147
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
148
|
+
*/
|
|
149
|
+
export namespace JusPaySavedCardToken$ {
|
|
150
|
+
/** @deprecated use `JusPaySavedCardToken$inboundSchema` instead. */
|
|
151
|
+
export const inboundSchema = JusPaySavedCardToken$inboundSchema;
|
|
152
|
+
/** @deprecated use `JusPaySavedCardToken$outboundSchema` instead. */
|
|
153
|
+
export const outboundSchema = JusPaySavedCardToken$outboundSchema;
|
|
154
|
+
/** @deprecated use `JusPaySavedCardToken$Outbound` instead. */
|
|
155
|
+
export type Outbound = JusPaySavedCardToken$Outbound;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function jusPaySavedCardTokenToJSON(
|
|
159
|
+
jusPaySavedCardToken: JusPaySavedCardToken,
|
|
160
|
+
): string {
|
|
161
|
+
return JSON.stringify(
|
|
162
|
+
JusPaySavedCardToken$outboundSchema.parse(jusPaySavedCardToken),
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function jusPaySavedCardTokenFromJSON(
|
|
167
|
+
jsonString: string,
|
|
168
|
+
): SafeParseResult<JusPaySavedCardToken, SDKValidationError> {
|
|
169
|
+
return safeParse(
|
|
170
|
+
jsonString,
|
|
171
|
+
(x) => JusPaySavedCardToken$inboundSchema.parse(JSON.parse(x)),
|
|
172
|
+
`Failed to parse 'JusPaySavedCardToken' from JSON`,
|
|
173
|
+
);
|
|
174
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
/**
|
|
12
|
+
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/JuspayUpiCollect} - API reference for the JuspayUpiCollect schema
|
|
13
|
+
*/
|
|
14
|
+
export type JuspayUpiCollect = {
|
|
15
|
+
paymentMethodSlug: string;
|
|
16
|
+
integrationType?: "express-checkout" | undefined;
|
|
17
|
+
gatewayReferenceId: string;
|
|
18
|
+
returnUrl?: string | undefined;
|
|
19
|
+
redirectAfterPayment: boolean;
|
|
20
|
+
paymentMethodType?: "UPI" | undefined;
|
|
21
|
+
paymentMethod?: "UPI_COLLECT" | undefined;
|
|
22
|
+
upiVpa: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const JuspayUpiCollect$inboundSchema: z.ZodType<
|
|
27
|
+
JuspayUpiCollect,
|
|
28
|
+
z.ZodTypeDef,
|
|
29
|
+
unknown
|
|
30
|
+
> = z.object({
|
|
31
|
+
payment_method_slug: z.string(),
|
|
32
|
+
integration_type: z.literal("express-checkout").default("express-checkout")
|
|
33
|
+
.optional(),
|
|
34
|
+
gateway_reference_id: z.string(),
|
|
35
|
+
return_url: z.string().optional(),
|
|
36
|
+
redirect_after_payment: z.boolean(),
|
|
37
|
+
payment_method_type: z.literal("UPI").default("UPI").optional(),
|
|
38
|
+
payment_method: z.literal("UPI_COLLECT").default("UPI_COLLECT").optional(),
|
|
39
|
+
upi_vpa: z.string(),
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"payment_method_slug": "paymentMethodSlug",
|
|
43
|
+
"integration_type": "integrationType",
|
|
44
|
+
"gateway_reference_id": "gatewayReferenceId",
|
|
45
|
+
"return_url": "returnUrl",
|
|
46
|
+
"redirect_after_payment": "redirectAfterPayment",
|
|
47
|
+
"payment_method_type": "paymentMethodType",
|
|
48
|
+
"payment_method": "paymentMethod",
|
|
49
|
+
"upi_vpa": "upiVpa",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type JuspayUpiCollect$Outbound = {
|
|
55
|
+
payment_method_slug: string;
|
|
56
|
+
integration_type: "express-checkout";
|
|
57
|
+
gateway_reference_id: string;
|
|
58
|
+
return_url?: string | undefined;
|
|
59
|
+
redirect_after_payment: boolean;
|
|
60
|
+
payment_method_type: "UPI";
|
|
61
|
+
payment_method: "UPI_COLLECT";
|
|
62
|
+
upi_vpa: string;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const JuspayUpiCollect$outboundSchema: z.ZodType<
|
|
67
|
+
JuspayUpiCollect$Outbound,
|
|
68
|
+
z.ZodTypeDef,
|
|
69
|
+
JuspayUpiCollect
|
|
70
|
+
> = z.object({
|
|
71
|
+
paymentMethodSlug: z.string(),
|
|
72
|
+
integrationType: z.literal("express-checkout"),
|
|
73
|
+
gatewayReferenceId: z.string(),
|
|
74
|
+
returnUrl: z.string().optional(),
|
|
75
|
+
redirectAfterPayment: z.boolean(),
|
|
76
|
+
paymentMethodType: z.literal("UPI"),
|
|
77
|
+
paymentMethod: z.literal("UPI_COLLECT"),
|
|
78
|
+
upiVpa: z.string(),
|
|
79
|
+
}).transform((v) => {
|
|
80
|
+
return remap$(v, {
|
|
81
|
+
paymentMethodSlug: "payment_method_slug",
|
|
82
|
+
integrationType: "integration_type",
|
|
83
|
+
gatewayReferenceId: "gateway_reference_id",
|
|
84
|
+
returnUrl: "return_url",
|
|
85
|
+
redirectAfterPayment: "redirect_after_payment",
|
|
86
|
+
paymentMethodType: "payment_method_type",
|
|
87
|
+
paymentMethod: "payment_method",
|
|
88
|
+
upiVpa: "upi_vpa",
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
95
|
+
*/
|
|
96
|
+
export namespace JuspayUpiCollect$ {
|
|
97
|
+
/** @deprecated use `JuspayUpiCollect$inboundSchema` instead. */
|
|
98
|
+
export const inboundSchema = JuspayUpiCollect$inboundSchema;
|
|
99
|
+
/** @deprecated use `JuspayUpiCollect$outboundSchema` instead. */
|
|
100
|
+
export const outboundSchema = JuspayUpiCollect$outboundSchema;
|
|
101
|
+
/** @deprecated use `JuspayUpiCollect$Outbound` instead. */
|
|
102
|
+
export type Outbound = JuspayUpiCollect$Outbound;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function juspayUpiCollectToJSON(
|
|
106
|
+
juspayUpiCollect: JuspayUpiCollect,
|
|
107
|
+
): string {
|
|
108
|
+
return JSON.stringify(
|
|
109
|
+
JuspayUpiCollect$outboundSchema.parse(juspayUpiCollect),
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function juspayUpiCollectFromJSON(
|
|
114
|
+
jsonString: string,
|
|
115
|
+
): SafeParseResult<JuspayUpiCollect, SDKValidationError> {
|
|
116
|
+
return safeParse(
|
|
117
|
+
jsonString,
|
|
118
|
+
(x) => JuspayUpiCollect$inboundSchema.parse(JSON.parse(x)),
|
|
119
|
+
`Failed to parse 'JuspayUpiCollect' from JSON`,
|
|
120
|
+
);
|
|
121
|
+
}
|