ce-storefront 0.18.1 → 0.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/docs/sdks/orders/README.md +0 -16
  2. package/esm/lib/config.d.ts +3 -3
  3. package/esm/lib/config.js +3 -3
  4. package/esm/models/components/index.d.ts +10 -2
  5. package/esm/models/components/index.d.ts.map +1 -1
  6. package/esm/models/components/index.js +10 -2
  7. package/esm/models/components/index.js.map +1 -1
  8. package/esm/models/components/juspayexpresscheckout.d.ts +33 -0
  9. package/esm/models/components/juspayexpresscheckout.d.ts.map +1 -0
  10. package/esm/models/components/juspayexpresscheckout.js +44 -0
  11. package/esm/models/components/juspayexpresscheckout.js.map +1 -0
  12. package/esm/models/components/juspayexpresscheckoutresponse.d.ts +187 -0
  13. package/esm/models/components/juspayexpresscheckoutresponse.d.ts.map +1 -0
  14. package/esm/models/components/juspayexpresscheckoutresponse.js +237 -0
  15. package/esm/models/components/juspayexpresscheckoutresponse.js.map +1 -0
  16. package/esm/models/components/juspayhypercheckout.d.ts +63 -0
  17. package/esm/models/components/juspayhypercheckout.d.ts.map +1 -0
  18. package/esm/models/components/juspayhypercheckout.js +74 -0
  19. package/esm/models/components/juspayhypercheckout.js.map +1 -0
  20. package/esm/models/components/{juspaypaymentinfo.d.ts → juspayhypercheckoutresponse.d.ts} +17 -15
  21. package/esm/models/components/juspayhypercheckoutresponse.d.ts.map +1 -0
  22. package/esm/models/components/{juspaypaymentinfo.js → juspayhypercheckoutresponse.js} +18 -14
  23. package/esm/models/components/juspayhypercheckoutresponse.js.map +1 -0
  24. package/esm/models/components/juspaynetbanking.d.ts +46 -0
  25. package/esm/models/components/juspaynetbanking.d.ts.map +1 -0
  26. package/esm/models/components/juspaynetbanking.js +69 -0
  27. package/esm/models/components/juspaynetbanking.js.map +1 -0
  28. package/esm/models/components/juspaynewcard.d.ts +88 -0
  29. package/esm/models/components/juspaynewcard.d.ts.map +1 -0
  30. package/esm/models/components/juspaynewcard.js +118 -0
  31. package/esm/models/components/juspaynewcard.js.map +1 -0
  32. package/esm/models/components/juspaypaymentgatewayparams.d.ts +8 -8
  33. package/esm/models/components/juspaypaymentgatewayparams.d.ts.map +1 -1
  34. package/esm/models/components/juspaypaymentgatewayparams.js +12 -13
  35. package/esm/models/components/juspaypaymentgatewayparams.js.map +1 -1
  36. package/esm/models/components/juspaysavedcardtoken.d.ts +82 -0
  37. package/esm/models/components/juspaysavedcardtoken.d.ts.map +1 -0
  38. package/esm/models/components/juspaysavedcardtoken.js +106 -0
  39. package/esm/models/components/juspaysavedcardtoken.js.map +1 -0
  40. package/esm/models/components/juspayupicollect.d.ts +48 -0
  41. package/esm/models/components/juspayupicollect.d.ts.map +1 -0
  42. package/esm/models/components/juspayupicollect.js +73 -0
  43. package/esm/models/components/juspayupicollect.js.map +1 -0
  44. package/esm/models/components/juspayupiintent.d.ts +50 -0
  45. package/esm/models/components/juspayupiintent.d.ts.map +1 -0
  46. package/esm/models/components/juspayupiintent.js +77 -0
  47. package/esm/models/components/juspayupiintent.js.map +1 -0
  48. package/esm/models/components/paymentmethodpayload.d.ts +30 -0
  49. package/esm/models/components/paymentmethodpayload.d.ts.map +1 -0
  50. package/esm/models/components/paymentmethodpayload.js +35 -0
  51. package/esm/models/components/paymentmethodpayload.js.map +1 -0
  52. package/esm/models/operations/createorder.d.ts +6 -8
  53. package/esm/models/operations/createorder.d.ts.map +1 -1
  54. package/esm/models/operations/createorder.js +12 -12
  55. package/esm/models/operations/createorder.js.map +1 -1
  56. package/esm/models/operations/retryorderpayment.d.ts +4 -4
  57. package/esm/models/operations/retryorderpayment.d.ts.map +1 -1
  58. package/esm/models/operations/retryorderpayment.js +8 -4
  59. package/esm/models/operations/retryorderpayment.js.map +1 -1
  60. package/examples/package-lock.json +1 -1
  61. package/jsr.json +1 -1
  62. package/package.json +1 -1
  63. package/src/lib/config.ts +3 -3
  64. package/src/models/components/index.ts +10 -2
  65. package/src/models/components/juspayexpresscheckout.ts +113 -0
  66. package/src/models/components/juspayexpresscheckoutresponse.ts +443 -0
  67. package/src/models/components/juspayhypercheckout.ts +126 -0
  68. package/src/models/components/{juspaypaymentinfo.ts → juspayhypercheckoutresponse.ts} +32 -22
  69. package/src/models/components/juspaynetbanking.ts +121 -0
  70. package/src/models/components/juspaynewcard.ts +191 -0
  71. package/src/models/components/juspaypaymentgatewayparams.ts +18 -14
  72. package/src/models/components/juspaysavedcardtoken.ts +180 -0
  73. package/src/models/components/juspayupicollect.ts +127 -0
  74. package/src/models/components/juspayupiintent.ts +131 -0
  75. package/src/models/components/paymentmethodpayload.ts +81 -0
  76. package/src/models/operations/createorder.ts +27 -23
  77. package/src/models/operations/retryorderpayment.ts +21 -11
  78. package/esm/models/components/juspaypaymentinfo.d.ts.map +0 -1
  79. package/esm/models/components/juspaypaymentinfo.js.map +0 -1
  80. package/esm/models/components/paymentgateway.d.ts +0 -34
  81. package/esm/models/components/paymentgateway.d.ts.map +0 -1
  82. package/esm/models/components/paymentgateway.js +0 -27
  83. package/esm/models/components/paymentgateway.js.map +0 -1
  84. package/src/models/components/paymentgateway.ts +0 -39
@@ -0,0 +1,180 @@
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
+ paymentProviderSlug: string;
25
+ integrationType?: "express-checkout" | undefined;
26
+ gatewayReferenceId: string;
27
+ returnUrl?: string | undefined;
28
+ redirectAfterPayment?: boolean | undefined;
29
+ getClientAuthToken?: boolean | undefined;
30
+ authType?: "OTP" | undefined;
31
+ tokenize: boolean;
32
+ saveToLocker: boolean;
33
+ paymentMethodType?: "CARD" | undefined;
34
+ paymentMethod: JusPaySavedCardTokenPaymentMethod;
35
+ cardToken: string;
36
+ cardSecurityCode: string;
37
+ };
38
+
39
+ /** @internal */
40
+ export const JusPaySavedCardTokenPaymentMethod$inboundSchema: z.ZodNativeEnum<
41
+ typeof JusPaySavedCardTokenPaymentMethod
42
+ > = z.nativeEnum(JusPaySavedCardTokenPaymentMethod);
43
+
44
+ /** @internal */
45
+ export const JusPaySavedCardTokenPaymentMethod$outboundSchema: z.ZodNativeEnum<
46
+ typeof JusPaySavedCardTokenPaymentMethod
47
+ > = JusPaySavedCardTokenPaymentMethod$inboundSchema;
48
+
49
+ /**
50
+ * @internal
51
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
52
+ */
53
+ export namespace JusPaySavedCardTokenPaymentMethod$ {
54
+ /** @deprecated use `JusPaySavedCardTokenPaymentMethod$inboundSchema` instead. */
55
+ export const inboundSchema = JusPaySavedCardTokenPaymentMethod$inboundSchema;
56
+ /** @deprecated use `JusPaySavedCardTokenPaymentMethod$outboundSchema` instead. */
57
+ export const outboundSchema =
58
+ JusPaySavedCardTokenPaymentMethod$outboundSchema;
59
+ }
60
+
61
+ /** @internal */
62
+ export const JusPaySavedCardToken$inboundSchema: z.ZodType<
63
+ JusPaySavedCardToken,
64
+ z.ZodTypeDef,
65
+ unknown
66
+ > = z.object({
67
+ payment_provider_slug: z.string(),
68
+ integration_type: z.literal("express-checkout").default("express-checkout")
69
+ .optional(),
70
+ gateway_reference_id: z.string(),
71
+ return_url: z.string().optional(),
72
+ redirect_after_payment: z.boolean().optional(),
73
+ get_client_auth_token: z.boolean().optional(),
74
+ auth_type: z.literal("OTP").default("OTP").optional(),
75
+ tokenize: z.boolean(),
76
+ save_to_locker: z.boolean(),
77
+ payment_method_type: z.literal("CARD").default("CARD").optional(),
78
+ payment_method: JusPaySavedCardTokenPaymentMethod$inboundSchema,
79
+ card_token: z.string(),
80
+ card_security_code: z.string(),
81
+ }).transform((v) => {
82
+ return remap$(v, {
83
+ "payment_provider_slug": "paymentProviderSlug",
84
+ "integration_type": "integrationType",
85
+ "gateway_reference_id": "gatewayReferenceId",
86
+ "return_url": "returnUrl",
87
+ "redirect_after_payment": "redirectAfterPayment",
88
+ "get_client_auth_token": "getClientAuthToken",
89
+ "auth_type": "authType",
90
+ "save_to_locker": "saveToLocker",
91
+ "payment_method_type": "paymentMethodType",
92
+ "payment_method": "paymentMethod",
93
+ "card_token": "cardToken",
94
+ "card_security_code": "cardSecurityCode",
95
+ });
96
+ });
97
+
98
+ /** @internal */
99
+ export type JusPaySavedCardToken$Outbound = {
100
+ payment_provider_slug: string;
101
+ integration_type: "express-checkout";
102
+ gateway_reference_id: string;
103
+ return_url?: string | undefined;
104
+ redirect_after_payment?: boolean | undefined;
105
+ get_client_auth_token?: boolean | undefined;
106
+ auth_type: "OTP";
107
+ tokenize: boolean;
108
+ save_to_locker: boolean;
109
+ payment_method_type: "CARD";
110
+ payment_method: string;
111
+ card_token: string;
112
+ card_security_code: string;
113
+ };
114
+
115
+ /** @internal */
116
+ export const JusPaySavedCardToken$outboundSchema: z.ZodType<
117
+ JusPaySavedCardToken$Outbound,
118
+ z.ZodTypeDef,
119
+ JusPaySavedCardToken
120
+ > = z.object({
121
+ paymentProviderSlug: z.string(),
122
+ integrationType: z.literal("express-checkout"),
123
+ gatewayReferenceId: z.string(),
124
+ returnUrl: z.string().optional(),
125
+ redirectAfterPayment: z.boolean().optional(),
126
+ getClientAuthToken: z.boolean().optional(),
127
+ authType: z.literal("OTP"),
128
+ tokenize: z.boolean(),
129
+ saveToLocker: z.boolean(),
130
+ paymentMethodType: z.literal("CARD"),
131
+ paymentMethod: JusPaySavedCardTokenPaymentMethod$outboundSchema,
132
+ cardToken: z.string(),
133
+ cardSecurityCode: z.string(),
134
+ }).transform((v) => {
135
+ return remap$(v, {
136
+ paymentProviderSlug: "payment_provider_slug",
137
+ integrationType: "integration_type",
138
+ gatewayReferenceId: "gateway_reference_id",
139
+ returnUrl: "return_url",
140
+ redirectAfterPayment: "redirect_after_payment",
141
+ getClientAuthToken: "get_client_auth_token",
142
+ authType: "auth_type",
143
+ saveToLocker: "save_to_locker",
144
+ paymentMethodType: "payment_method_type",
145
+ paymentMethod: "payment_method",
146
+ cardToken: "card_token",
147
+ cardSecurityCode: "card_security_code",
148
+ });
149
+ });
150
+
151
+ /**
152
+ * @internal
153
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
154
+ */
155
+ export namespace JusPaySavedCardToken$ {
156
+ /** @deprecated use `JusPaySavedCardToken$inboundSchema` instead. */
157
+ export const inboundSchema = JusPaySavedCardToken$inboundSchema;
158
+ /** @deprecated use `JusPaySavedCardToken$outboundSchema` instead. */
159
+ export const outboundSchema = JusPaySavedCardToken$outboundSchema;
160
+ /** @deprecated use `JusPaySavedCardToken$Outbound` instead. */
161
+ export type Outbound = JusPaySavedCardToken$Outbound;
162
+ }
163
+
164
+ export function jusPaySavedCardTokenToJSON(
165
+ jusPaySavedCardToken: JusPaySavedCardToken,
166
+ ): string {
167
+ return JSON.stringify(
168
+ JusPaySavedCardToken$outboundSchema.parse(jusPaySavedCardToken),
169
+ );
170
+ }
171
+
172
+ export function jusPaySavedCardTokenFromJSON(
173
+ jsonString: string,
174
+ ): SafeParseResult<JusPaySavedCardToken, SDKValidationError> {
175
+ return safeParse(
176
+ jsonString,
177
+ (x) => JusPaySavedCardToken$inboundSchema.parse(JSON.parse(x)),
178
+ `Failed to parse 'JusPaySavedCardToken' from JSON`,
179
+ );
180
+ }
@@ -0,0 +1,127 @@
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
+ paymentProviderSlug: string;
16
+ integrationType?: "express-checkout" | undefined;
17
+ gatewayReferenceId: string;
18
+ returnUrl?: string | undefined;
19
+ redirectAfterPayment?: boolean | undefined;
20
+ getClientAuthToken?: boolean | undefined;
21
+ paymentMethodType?: "UPI" | undefined;
22
+ paymentMethod?: "UPI_COLLECT" | undefined;
23
+ upiVpa: string;
24
+ };
25
+
26
+ /** @internal */
27
+ export const JuspayUpiCollect$inboundSchema: z.ZodType<
28
+ JuspayUpiCollect,
29
+ z.ZodTypeDef,
30
+ unknown
31
+ > = z.object({
32
+ payment_provider_slug: z.string(),
33
+ integration_type: z.literal("express-checkout").default("express-checkout")
34
+ .optional(),
35
+ gateway_reference_id: z.string(),
36
+ return_url: z.string().optional(),
37
+ redirect_after_payment: z.boolean().optional(),
38
+ get_client_auth_token: z.boolean().optional(),
39
+ payment_method_type: z.literal("UPI").default("UPI").optional(),
40
+ payment_method: z.literal("UPI_COLLECT").default("UPI_COLLECT").optional(),
41
+ upi_vpa: z.string(),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ "payment_provider_slug": "paymentProviderSlug",
45
+ "integration_type": "integrationType",
46
+ "gateway_reference_id": "gatewayReferenceId",
47
+ "return_url": "returnUrl",
48
+ "redirect_after_payment": "redirectAfterPayment",
49
+ "get_client_auth_token": "getClientAuthToken",
50
+ "payment_method_type": "paymentMethodType",
51
+ "payment_method": "paymentMethod",
52
+ "upi_vpa": "upiVpa",
53
+ });
54
+ });
55
+
56
+ /** @internal */
57
+ export type JuspayUpiCollect$Outbound = {
58
+ payment_provider_slug: string;
59
+ integration_type: "express-checkout";
60
+ gateway_reference_id: string;
61
+ return_url?: string | undefined;
62
+ redirect_after_payment?: boolean | undefined;
63
+ get_client_auth_token?: boolean | undefined;
64
+ payment_method_type: "UPI";
65
+ payment_method: "UPI_COLLECT";
66
+ upi_vpa: string;
67
+ };
68
+
69
+ /** @internal */
70
+ export const JuspayUpiCollect$outboundSchema: z.ZodType<
71
+ JuspayUpiCollect$Outbound,
72
+ z.ZodTypeDef,
73
+ JuspayUpiCollect
74
+ > = z.object({
75
+ paymentProviderSlug: z.string(),
76
+ integrationType: z.literal("express-checkout"),
77
+ gatewayReferenceId: z.string(),
78
+ returnUrl: z.string().optional(),
79
+ redirectAfterPayment: z.boolean().optional(),
80
+ getClientAuthToken: z.boolean().optional(),
81
+ paymentMethodType: z.literal("UPI"),
82
+ paymentMethod: z.literal("UPI_COLLECT"),
83
+ upiVpa: z.string(),
84
+ }).transform((v) => {
85
+ return remap$(v, {
86
+ paymentProviderSlug: "payment_provider_slug",
87
+ integrationType: "integration_type",
88
+ gatewayReferenceId: "gateway_reference_id",
89
+ returnUrl: "return_url",
90
+ redirectAfterPayment: "redirect_after_payment",
91
+ getClientAuthToken: "get_client_auth_token",
92
+ paymentMethodType: "payment_method_type",
93
+ paymentMethod: "payment_method",
94
+ upiVpa: "upi_vpa",
95
+ });
96
+ });
97
+
98
+ /**
99
+ * @internal
100
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
101
+ */
102
+ export namespace JuspayUpiCollect$ {
103
+ /** @deprecated use `JuspayUpiCollect$inboundSchema` instead. */
104
+ export const inboundSchema = JuspayUpiCollect$inboundSchema;
105
+ /** @deprecated use `JuspayUpiCollect$outboundSchema` instead. */
106
+ export const outboundSchema = JuspayUpiCollect$outboundSchema;
107
+ /** @deprecated use `JuspayUpiCollect$Outbound` instead. */
108
+ export type Outbound = JuspayUpiCollect$Outbound;
109
+ }
110
+
111
+ export function juspayUpiCollectToJSON(
112
+ juspayUpiCollect: JuspayUpiCollect,
113
+ ): string {
114
+ return JSON.stringify(
115
+ JuspayUpiCollect$outboundSchema.parse(juspayUpiCollect),
116
+ );
117
+ }
118
+
119
+ export function juspayUpiCollectFromJSON(
120
+ jsonString: string,
121
+ ): SafeParseResult<JuspayUpiCollect, SDKValidationError> {
122
+ return safeParse(
123
+ jsonString,
124
+ (x) => JuspayUpiCollect$inboundSchema.parse(JSON.parse(x)),
125
+ `Failed to parse 'JuspayUpiCollect' from JSON`,
126
+ );
127
+ }
@@ -0,0 +1,131 @@
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/JuspayUpiIntent} - API reference for the JuspayUpiIntent schema
13
+ */
14
+ export type JuspayUpiIntent = {
15
+ paymentProviderSlug: string;
16
+ integrationType?: "express-checkout" | undefined;
17
+ gatewayReferenceId: string;
18
+ returnUrl?: string | undefined;
19
+ redirectAfterPayment?: boolean | undefined;
20
+ getClientAuthToken?: boolean | undefined;
21
+ paymentMethodType?: "UPI" | undefined;
22
+ paymentMethod?: "UPI_PAY" | undefined;
23
+ sdkParams: boolean;
24
+ upiApp: string;
25
+ };
26
+
27
+ /** @internal */
28
+ export const JuspayUpiIntent$inboundSchema: z.ZodType<
29
+ JuspayUpiIntent,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.object({
33
+ payment_provider_slug: z.string(),
34
+ integration_type: z.literal("express-checkout").default("express-checkout")
35
+ .optional(),
36
+ gateway_reference_id: z.string(),
37
+ return_url: z.string().optional(),
38
+ redirect_after_payment: z.boolean().optional(),
39
+ get_client_auth_token: z.boolean().optional(),
40
+ payment_method_type: z.literal("UPI").default("UPI").optional(),
41
+ payment_method: z.literal("UPI_PAY").default("UPI_PAY").optional(),
42
+ sdk_params: z.boolean(),
43
+ upi_app: z.string(),
44
+ }).transform((v) => {
45
+ return remap$(v, {
46
+ "payment_provider_slug": "paymentProviderSlug",
47
+ "integration_type": "integrationType",
48
+ "gateway_reference_id": "gatewayReferenceId",
49
+ "return_url": "returnUrl",
50
+ "redirect_after_payment": "redirectAfterPayment",
51
+ "get_client_auth_token": "getClientAuthToken",
52
+ "payment_method_type": "paymentMethodType",
53
+ "payment_method": "paymentMethod",
54
+ "sdk_params": "sdkParams",
55
+ "upi_app": "upiApp",
56
+ });
57
+ });
58
+
59
+ /** @internal */
60
+ export type JuspayUpiIntent$Outbound = {
61
+ payment_provider_slug: string;
62
+ integration_type: "express-checkout";
63
+ gateway_reference_id: string;
64
+ return_url?: string | undefined;
65
+ redirect_after_payment?: boolean | undefined;
66
+ get_client_auth_token?: boolean | undefined;
67
+ payment_method_type: "UPI";
68
+ payment_method: "UPI_PAY";
69
+ sdk_params: boolean;
70
+ upi_app: string;
71
+ };
72
+
73
+ /** @internal */
74
+ export const JuspayUpiIntent$outboundSchema: z.ZodType<
75
+ JuspayUpiIntent$Outbound,
76
+ z.ZodTypeDef,
77
+ JuspayUpiIntent
78
+ > = z.object({
79
+ paymentProviderSlug: z.string(),
80
+ integrationType: z.literal("express-checkout"),
81
+ gatewayReferenceId: z.string(),
82
+ returnUrl: z.string().optional(),
83
+ redirectAfterPayment: z.boolean().optional(),
84
+ getClientAuthToken: z.boolean().optional(),
85
+ paymentMethodType: z.literal("UPI"),
86
+ paymentMethod: z.literal("UPI_PAY"),
87
+ sdkParams: z.boolean(),
88
+ upiApp: z.string(),
89
+ }).transform((v) => {
90
+ return remap$(v, {
91
+ paymentProviderSlug: "payment_provider_slug",
92
+ integrationType: "integration_type",
93
+ gatewayReferenceId: "gateway_reference_id",
94
+ returnUrl: "return_url",
95
+ redirectAfterPayment: "redirect_after_payment",
96
+ getClientAuthToken: "get_client_auth_token",
97
+ paymentMethodType: "payment_method_type",
98
+ paymentMethod: "payment_method",
99
+ sdkParams: "sdk_params",
100
+ upiApp: "upi_app",
101
+ });
102
+ });
103
+
104
+ /**
105
+ * @internal
106
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
107
+ */
108
+ export namespace JuspayUpiIntent$ {
109
+ /** @deprecated use `JuspayUpiIntent$inboundSchema` instead. */
110
+ export const inboundSchema = JuspayUpiIntent$inboundSchema;
111
+ /** @deprecated use `JuspayUpiIntent$outboundSchema` instead. */
112
+ export const outboundSchema = JuspayUpiIntent$outboundSchema;
113
+ /** @deprecated use `JuspayUpiIntent$Outbound` instead. */
114
+ export type Outbound = JuspayUpiIntent$Outbound;
115
+ }
116
+
117
+ export function juspayUpiIntentToJSON(
118
+ juspayUpiIntent: JuspayUpiIntent,
119
+ ): string {
120
+ return JSON.stringify(JuspayUpiIntent$outboundSchema.parse(juspayUpiIntent));
121
+ }
122
+
123
+ export function juspayUpiIntentFromJSON(
124
+ jsonString: string,
125
+ ): SafeParseResult<JuspayUpiIntent, SDKValidationError> {
126
+ return safeParse(
127
+ jsonString,
128
+ (x) => JuspayUpiIntent$inboundSchema.parse(JSON.parse(x)),
129
+ `Failed to parse 'JuspayUpiIntent' from JSON`,
130
+ );
131
+ }
@@ -0,0 +1,81 @@
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
+ JusPayExpressCheckout,
11
+ JusPayExpressCheckout$inboundSchema,
12
+ JusPayExpressCheckout$Outbound,
13
+ JusPayExpressCheckout$outboundSchema,
14
+ } from "./juspayexpresscheckout.js";
15
+ import {
16
+ JusPayHyperCheckout,
17
+ JusPayHyperCheckout$inboundSchema,
18
+ JusPayHyperCheckout$Outbound,
19
+ JusPayHyperCheckout$outboundSchema,
20
+ } from "./juspayhypercheckout.js";
21
+
22
+ /**
23
+ * @see {@link https://llm-docs.commercengine.io/storefront/schemas/PaymentMethodPayload} - API reference for the PaymentMethodPayload schema
24
+ */
25
+ export type PaymentMethodPayload = JusPayHyperCheckout | JusPayExpressCheckout;
26
+
27
+ /** @internal */
28
+ export const PaymentMethodPayload$inboundSchema: z.ZodType<
29
+ PaymentMethodPayload,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.union([
33
+ JusPayHyperCheckout$inboundSchema,
34
+ JusPayExpressCheckout$inboundSchema,
35
+ ]);
36
+
37
+ /** @internal */
38
+ export type PaymentMethodPayload$Outbound =
39
+ | JusPayHyperCheckout$Outbound
40
+ | JusPayExpressCheckout$Outbound;
41
+
42
+ /** @internal */
43
+ export const PaymentMethodPayload$outboundSchema: z.ZodType<
44
+ PaymentMethodPayload$Outbound,
45
+ z.ZodTypeDef,
46
+ PaymentMethodPayload
47
+ > = z.union([
48
+ JusPayHyperCheckout$outboundSchema,
49
+ JusPayExpressCheckout$outboundSchema,
50
+ ]);
51
+
52
+ /**
53
+ * @internal
54
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
55
+ */
56
+ export namespace PaymentMethodPayload$ {
57
+ /** @deprecated use `PaymentMethodPayload$inboundSchema` instead. */
58
+ export const inboundSchema = PaymentMethodPayload$inboundSchema;
59
+ /** @deprecated use `PaymentMethodPayload$outboundSchema` instead. */
60
+ export const outboundSchema = PaymentMethodPayload$outboundSchema;
61
+ /** @deprecated use `PaymentMethodPayload$Outbound` instead. */
62
+ export type Outbound = PaymentMethodPayload$Outbound;
63
+ }
64
+
65
+ export function paymentMethodPayloadToJSON(
66
+ paymentMethodPayload: PaymentMethodPayload,
67
+ ): string {
68
+ return JSON.stringify(
69
+ PaymentMethodPayload$outboundSchema.parse(paymentMethodPayload),
70
+ );
71
+ }
72
+
73
+ export function paymentMethodPayloadFromJSON(
74
+ jsonString: string,
75
+ ): SafeParseResult<PaymentMethodPayload, SDKValidationError> {
76
+ return safeParse(
77
+ jsonString,
78
+ (x) => PaymentMethodPayload$inboundSchema.parse(JSON.parse(x)),
79
+ `Failed to parse 'PaymentMethodPayload' from JSON`,
80
+ );
81
+ }
@@ -14,18 +14,21 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
14
  */
15
15
  export type CreateOrderRequestBody = {
16
16
  cartId: string;
17
- paymentGateway: components.PaymentGateway;
18
- paymentGatewayParams: components.PaymentGatewayParams;
17
+ paymentMethod?: components.PaymentMethodPayload | undefined;
19
18
  };
20
19
 
21
20
  export type PaymentInfo =
22
- | components.PayuPaymentInfo
23
- | components.JuspayPaymentInfo;
21
+ | components.JusPayHyperCheckoutResponse
22
+ | components.JusPayExpressCheckoutResponse
23
+ | components.PayuPaymentInfo;
24
24
 
25
25
  export type CreateOrderContent = {
26
26
  order: components.Order;
27
27
  paymentRequired: boolean;
28
- paymentInfo: components.PayuPaymentInfo | components.JuspayPaymentInfo;
28
+ paymentInfo:
29
+ | components.JusPayHyperCheckoutResponse
30
+ | components.JusPayExpressCheckoutResponse
31
+ | components.PayuPaymentInfo;
29
32
  };
30
33
 
31
34
  /**
@@ -44,21 +47,18 @@ export const CreateOrderRequestBody$inboundSchema: z.ZodType<
44
47
  unknown
45
48
  > = z.object({
46
49
  cart_id: z.string(),
47
- payment_gateway: components.PaymentGateway$inboundSchema,
48
- payment_gateway_params: components.PaymentGatewayParams$inboundSchema,
50
+ payment_method: components.PaymentMethodPayload$inboundSchema.optional(),
49
51
  }).transform((v) => {
50
52
  return remap$(v, {
51
53
  "cart_id": "cartId",
52
- "payment_gateway": "paymentGateway",
53
- "payment_gateway_params": "paymentGatewayParams",
54
+ "payment_method": "paymentMethod",
54
55
  });
55
56
  });
56
57
 
57
58
  /** @internal */
58
59
  export type CreateOrderRequestBody$Outbound = {
59
60
  cart_id: string;
60
- payment_gateway: string;
61
- payment_gateway_params: components.PaymentGatewayParams$Outbound;
61
+ payment_method?: components.PaymentMethodPayload$Outbound | undefined;
62
62
  };
63
63
 
64
64
  /** @internal */
@@ -68,13 +68,11 @@ export const CreateOrderRequestBody$outboundSchema: z.ZodType<
68
68
  CreateOrderRequestBody
69
69
  > = z.object({
70
70
  cartId: z.string(),
71
- paymentGateway: components.PaymentGateway$outboundSchema,
72
- paymentGatewayParams: components.PaymentGatewayParams$outboundSchema,
71
+ paymentMethod: components.PaymentMethodPayload$outboundSchema.optional(),
73
72
  }).transform((v) => {
74
73
  return remap$(v, {
75
74
  cartId: "cart_id",
76
- paymentGateway: "payment_gateway",
77
- paymentGatewayParams: "payment_gateway_params",
75
+ paymentMethod: "payment_method",
78
76
  });
79
77
  });
80
78
 
@@ -115,14 +113,16 @@ export const PaymentInfo$inboundSchema: z.ZodType<
115
113
  z.ZodTypeDef,
116
114
  unknown
117
115
  > = z.union([
116
+ components.JusPayHyperCheckoutResponse$inboundSchema,
117
+ components.JusPayExpressCheckoutResponse$inboundSchema,
118
118
  components.PayuPaymentInfo$inboundSchema,
119
- components.JuspayPaymentInfo$inboundSchema,
120
119
  ]);
121
120
 
122
121
  /** @internal */
123
122
  export type PaymentInfo$Outbound =
124
- | components.PayuPaymentInfo$Outbound
125
- | components.JuspayPaymentInfo$Outbound;
123
+ | components.JusPayHyperCheckoutResponse$Outbound
124
+ | components.JusPayExpressCheckoutResponse$Outbound
125
+ | components.PayuPaymentInfo$Outbound;
126
126
 
127
127
  /** @internal */
128
128
  export const PaymentInfo$outboundSchema: z.ZodType<
@@ -130,8 +130,9 @@ export const PaymentInfo$outboundSchema: z.ZodType<
130
130
  z.ZodTypeDef,
131
131
  PaymentInfo
132
132
  > = z.union([
133
+ components.JusPayHyperCheckoutResponse$outboundSchema,
134
+ components.JusPayExpressCheckoutResponse$outboundSchema,
133
135
  components.PayuPaymentInfo$outboundSchema,
134
- components.JuspayPaymentInfo$outboundSchema,
135
136
  ]);
136
137
 
137
138
  /**
@@ -170,8 +171,9 @@ export const CreateOrderContent$inboundSchema: z.ZodType<
170
171
  order: components.Order$inboundSchema,
171
172
  payment_required: z.boolean(),
172
173
  payment_info: z.union([
174
+ components.JusPayHyperCheckoutResponse$inboundSchema,
175
+ components.JusPayExpressCheckoutResponse$inboundSchema,
173
176
  components.PayuPaymentInfo$inboundSchema,
174
- components.JuspayPaymentInfo$inboundSchema,
175
177
  ]),
176
178
  }).transform((v) => {
177
179
  return remap$(v, {
@@ -185,8 +187,9 @@ export type CreateOrderContent$Outbound = {
185
187
  order: components.Order$Outbound;
186
188
  payment_required: boolean;
187
189
  payment_info:
188
- | components.PayuPaymentInfo$Outbound
189
- | components.JuspayPaymentInfo$Outbound;
190
+ | components.JusPayHyperCheckoutResponse$Outbound
191
+ | components.JusPayExpressCheckoutResponse$Outbound
192
+ | components.PayuPaymentInfo$Outbound;
190
193
  };
191
194
 
192
195
  /** @internal */
@@ -198,8 +201,9 @@ export const CreateOrderContent$outboundSchema: z.ZodType<
198
201
  order: components.Order$outboundSchema,
199
202
  paymentRequired: z.boolean(),
200
203
  paymentInfo: z.union([
204
+ components.JusPayHyperCheckoutResponse$outboundSchema,
205
+ components.JusPayExpressCheckoutResponse$outboundSchema,
201
206
  components.PayuPaymentInfo$outboundSchema,
202
- components.JuspayPaymentInfo$outboundSchema,
203
207
  ]),
204
208
  }).transform((v) => {
205
209
  return remap$(v, {