ce-storefront 0.3.2 → 0.3.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.
- package/docs/sdks/orders/README.md +15 -3
- package/esm/funcs/ordersRetryPayment.d.ts +1 -1
- package/esm/funcs/ordersRetryPayment.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/juspaypaymentgatewayparams.d.ts +2 -2
- package/esm/models/components/juspaypaymentgatewayparams.d.ts.map +1 -1
- package/esm/models/components/juspaypaymentgatewayparams.js +2 -2
- package/esm/models/components/juspaypaymentgatewayparams.js.map +1 -1
- package/esm/models/components/juspaypaymentinfo.d.ts +33 -0
- package/esm/models/components/juspaypaymentinfo.d.ts.map +1 -1
- package/esm/models/components/juspaypaymentinfo.js +8 -0
- package/esm/models/components/juspaypaymentinfo.js.map +1 -1
- package/esm/models/components/payupaymentinfo.d.ts +46 -3
- package/esm/models/components/payupaymentinfo.d.ts.map +1 -1
- package/esm/models/components/payupaymentinfo.js +7 -1
- package/esm/models/components/payupaymentinfo.js.map +1 -1
- package/esm/models/operations/postorder.d.ts +2 -8
- package/esm/models/operations/postorder.d.ts.map +1 -1
- package/esm/models/operations/postretrypaymentorderid.d.ts +53 -140
- package/esm/models/operations/postretrypaymentorderid.d.ts.map +1 -1
- package/esm/models/operations/postretrypaymentorderid.js +83 -134
- package/esm/models/operations/postretrypaymentorderid.js.map +1 -1
- package/esm/sdk/orders.d.ts +1 -1
- package/esm/sdk/orders.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/ordersRetryPayment.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/juspaypaymentgatewayparams.ts +4 -4
- package/src/models/components/juspaypaymentinfo.ts +33 -0
- package/src/models/components/payupaymentinfo.ts +46 -3
- package/src/models/operations/postretrypaymentorderid.ts +179 -226
- package/src/sdk/orders.ts +1 -1
|
@@ -5,19 +5,18 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
9
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
-
import
|
|
9
|
+
import * as components from "../components/index.js";
|
|
11
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
11
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} as const;
|
|
17
|
-
export type PaymentMode = ClosedEnum<typeof PaymentMode>;
|
|
12
|
+
export type PostRetryPaymentOrderIdPaymentGatewayParams =
|
|
13
|
+
| (components.PayuPaymentGatewayParams & { paymentGateway: "PAYU" })
|
|
14
|
+
| (components.JuspayPaymentGatewayParams & { paymentGateway: "JUSPAY" });
|
|
18
15
|
|
|
19
16
|
export type PostRetryPaymentOrderIdRequestBody = {
|
|
20
|
-
|
|
17
|
+
paymentGatewayParams:
|
|
18
|
+
| (components.PayuPaymentGatewayParams & { paymentGateway: "PAYU" })
|
|
19
|
+
| (components.JuspayPaymentGatewayParams & { paymentGateway: "JUSPAY" });
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
export type PostRetryPaymentOrderIdRequest = {
|
|
@@ -28,52 +27,16 @@ export type PostRetryPaymentOrderIdRequest = {
|
|
|
28
27
|
requestBody: PostRetryPaymentOrderIdRequestBody;
|
|
29
28
|
};
|
|
30
29
|
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export type BillingCurrency = ClosedEnum<typeof BillingCurrency>;
|
|
35
|
-
|
|
36
|
-
export const BillingCycle = {
|
|
37
|
-
Monthly: "MONTHLY",
|
|
38
|
-
} as const;
|
|
39
|
-
export type BillingCycle = ClosedEnum<typeof BillingCycle>;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* always 1
|
|
43
|
-
*/
|
|
44
|
-
export type SiDetails = {
|
|
45
|
-
billingAmount?: number | undefined;
|
|
46
|
-
billingCurrency?: BillingCurrency | undefined;
|
|
47
|
-
billingCycle?: BillingCycle | undefined;
|
|
48
|
-
billingInterval?: number | undefined;
|
|
49
|
-
paymentStartDate?: RFCDate | undefined;
|
|
50
|
-
paymentEndDate?: RFCDate | undefined;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export type PostRetryPaymentOrderIdPaymentInfo = {
|
|
54
|
-
key?: string | undefined;
|
|
55
|
-
txnid?: string | undefined;
|
|
56
|
-
amount?: string | undefined;
|
|
57
|
-
productinfo?: string | undefined;
|
|
58
|
-
firstname?: string | undefined;
|
|
59
|
-
email?: string | undefined;
|
|
60
|
-
phone?: string | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* always 1
|
|
63
|
-
*/
|
|
64
|
-
si?: number | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* always 1
|
|
67
|
-
*/
|
|
68
|
-
siDetails?: SiDetails | undefined;
|
|
69
|
-
furl?: string | undefined;
|
|
70
|
-
surl?: string | undefined;
|
|
71
|
-
hash?: string | undefined;
|
|
72
|
-
};
|
|
30
|
+
export type PostRetryPaymentOrderIdPaymentInfo =
|
|
31
|
+
| (components.JuspayPaymentInfo & { paymentGateway: "JUSPAY" })
|
|
32
|
+
| (components.PayuPaymentInfo & { paymentGateway: "PAYU" });
|
|
73
33
|
|
|
74
34
|
export type PostRetryPaymentOrderIdContent = {
|
|
75
35
|
paymentRequired?: boolean | undefined;
|
|
76
|
-
paymentInfo?:
|
|
36
|
+
paymentInfo?:
|
|
37
|
+
| (components.JuspayPaymentInfo & { paymentGateway: "JUSPAY" })
|
|
38
|
+
| (components.PayuPaymentInfo & { paymentGateway: "PAYU" })
|
|
39
|
+
| undefined;
|
|
77
40
|
};
|
|
78
41
|
|
|
79
42
|
/**
|
|
@@ -86,22 +49,90 @@ export type PostRetryPaymentOrderIdResponseBody = {
|
|
|
86
49
|
};
|
|
87
50
|
|
|
88
51
|
/** @internal */
|
|
89
|
-
export const
|
|
90
|
-
.
|
|
52
|
+
export const PostRetryPaymentOrderIdPaymentGatewayParams$inboundSchema:
|
|
53
|
+
z.ZodType<
|
|
54
|
+
PostRetryPaymentOrderIdPaymentGatewayParams,
|
|
55
|
+
z.ZodTypeDef,
|
|
56
|
+
unknown
|
|
57
|
+
> = z.union([
|
|
58
|
+
components.PayuPaymentGatewayParams$inboundSchema.and(
|
|
59
|
+
z.object({ payment_gateway: z.literal("PAYU") }).transform((v) => ({
|
|
60
|
+
paymentGateway: v.payment_gateway,
|
|
61
|
+
})),
|
|
62
|
+
),
|
|
63
|
+
components.JuspayPaymentGatewayParams$inboundSchema.and(
|
|
64
|
+
z.object({ payment_gateway: z.literal("JUSPAY") }).transform((v) => ({
|
|
65
|
+
paymentGateway: v.payment_gateway,
|
|
66
|
+
})),
|
|
67
|
+
),
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export type PostRetryPaymentOrderIdPaymentGatewayParams$Outbound =
|
|
72
|
+
| (components.PayuPaymentGatewayParams$Outbound & { payment_gateway: "PAYU" })
|
|
73
|
+
| (components.JuspayPaymentGatewayParams$Outbound & {
|
|
74
|
+
payment_gateway: "JUSPAY";
|
|
75
|
+
});
|
|
91
76
|
|
|
92
77
|
/** @internal */
|
|
93
|
-
export const
|
|
94
|
-
|
|
78
|
+
export const PostRetryPaymentOrderIdPaymentGatewayParams$outboundSchema:
|
|
79
|
+
z.ZodType<
|
|
80
|
+
PostRetryPaymentOrderIdPaymentGatewayParams$Outbound,
|
|
81
|
+
z.ZodTypeDef,
|
|
82
|
+
PostRetryPaymentOrderIdPaymentGatewayParams
|
|
83
|
+
> = z.union([
|
|
84
|
+
components.PayuPaymentGatewayParams$outboundSchema.and(
|
|
85
|
+
z.object({ paymentGateway: z.literal("PAYU") }).transform((v) => ({
|
|
86
|
+
payment_gateway: v.paymentGateway,
|
|
87
|
+
})),
|
|
88
|
+
),
|
|
89
|
+
components.JuspayPaymentGatewayParams$outboundSchema.and(
|
|
90
|
+
z.object({ paymentGateway: z.literal("JUSPAY") }).transform((v) => ({
|
|
91
|
+
payment_gateway: v.paymentGateway,
|
|
92
|
+
})),
|
|
93
|
+
),
|
|
94
|
+
]);
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* @internal
|
|
98
98
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
99
99
|
*/
|
|
100
|
-
export namespace
|
|
101
|
-
/** @deprecated use `
|
|
102
|
-
export const inboundSchema =
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
export namespace PostRetryPaymentOrderIdPaymentGatewayParams$ {
|
|
101
|
+
/** @deprecated use `PostRetryPaymentOrderIdPaymentGatewayParams$inboundSchema` instead. */
|
|
102
|
+
export const inboundSchema =
|
|
103
|
+
PostRetryPaymentOrderIdPaymentGatewayParams$inboundSchema;
|
|
104
|
+
/** @deprecated use `PostRetryPaymentOrderIdPaymentGatewayParams$outboundSchema` instead. */
|
|
105
|
+
export const outboundSchema =
|
|
106
|
+
PostRetryPaymentOrderIdPaymentGatewayParams$outboundSchema;
|
|
107
|
+
/** @deprecated use `PostRetryPaymentOrderIdPaymentGatewayParams$Outbound` instead. */
|
|
108
|
+
export type Outbound = PostRetryPaymentOrderIdPaymentGatewayParams$Outbound;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function postRetryPaymentOrderIdPaymentGatewayParamsToJSON(
|
|
112
|
+
postRetryPaymentOrderIdPaymentGatewayParams:
|
|
113
|
+
PostRetryPaymentOrderIdPaymentGatewayParams,
|
|
114
|
+
): string {
|
|
115
|
+
return JSON.stringify(
|
|
116
|
+
PostRetryPaymentOrderIdPaymentGatewayParams$outboundSchema.parse(
|
|
117
|
+
postRetryPaymentOrderIdPaymentGatewayParams,
|
|
118
|
+
),
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function postRetryPaymentOrderIdPaymentGatewayParamsFromJSON(
|
|
123
|
+
jsonString: string,
|
|
124
|
+
): SafeParseResult<
|
|
125
|
+
PostRetryPaymentOrderIdPaymentGatewayParams,
|
|
126
|
+
SDKValidationError
|
|
127
|
+
> {
|
|
128
|
+
return safeParse(
|
|
129
|
+
jsonString,
|
|
130
|
+
(x) =>
|
|
131
|
+
PostRetryPaymentOrderIdPaymentGatewayParams$inboundSchema.parse(
|
|
132
|
+
JSON.parse(x),
|
|
133
|
+
),
|
|
134
|
+
`Failed to parse 'PostRetryPaymentOrderIdPaymentGatewayParams' from JSON`,
|
|
135
|
+
);
|
|
105
136
|
}
|
|
106
137
|
|
|
107
138
|
/** @internal */
|
|
@@ -110,16 +141,33 @@ export const PostRetryPaymentOrderIdRequestBody$inboundSchema: z.ZodType<
|
|
|
110
141
|
z.ZodTypeDef,
|
|
111
142
|
unknown
|
|
112
143
|
> = z.object({
|
|
113
|
-
|
|
144
|
+
payment_gateway_params: z.union([
|
|
145
|
+
components.PayuPaymentGatewayParams$inboundSchema.and(
|
|
146
|
+
z.object({ payment_gateway: z.literal("PAYU") }).transform((v) => ({
|
|
147
|
+
paymentGateway: v.payment_gateway,
|
|
148
|
+
})),
|
|
149
|
+
),
|
|
150
|
+
components.JuspayPaymentGatewayParams$inboundSchema.and(
|
|
151
|
+
z.object({ payment_gateway: z.literal("JUSPAY") }).transform((v) => ({
|
|
152
|
+
paymentGateway: v.payment_gateway,
|
|
153
|
+
})),
|
|
154
|
+
),
|
|
155
|
+
]),
|
|
114
156
|
}).transform((v) => {
|
|
115
157
|
return remap$(v, {
|
|
116
|
-
"
|
|
158
|
+
"payment_gateway_params": "paymentGatewayParams",
|
|
117
159
|
});
|
|
118
160
|
});
|
|
119
161
|
|
|
120
162
|
/** @internal */
|
|
121
163
|
export type PostRetryPaymentOrderIdRequestBody$Outbound = {
|
|
122
|
-
|
|
164
|
+
payment_gateway_params:
|
|
165
|
+
| (components.PayuPaymentGatewayParams$Outbound & {
|
|
166
|
+
payment_gateway: "PAYU";
|
|
167
|
+
})
|
|
168
|
+
| (components.JuspayPaymentGatewayParams$Outbound & {
|
|
169
|
+
payment_gateway: "JUSPAY";
|
|
170
|
+
});
|
|
123
171
|
};
|
|
124
172
|
|
|
125
173
|
/** @internal */
|
|
@@ -128,10 +176,21 @@ export const PostRetryPaymentOrderIdRequestBody$outboundSchema: z.ZodType<
|
|
|
128
176
|
z.ZodTypeDef,
|
|
129
177
|
PostRetryPaymentOrderIdRequestBody
|
|
130
178
|
> = z.object({
|
|
131
|
-
|
|
179
|
+
paymentGatewayParams: z.union([
|
|
180
|
+
components.PayuPaymentGatewayParams$outboundSchema.and(
|
|
181
|
+
z.object({ paymentGateway: z.literal("PAYU") }).transform((v) => ({
|
|
182
|
+
payment_gateway: v.paymentGateway,
|
|
183
|
+
})),
|
|
184
|
+
),
|
|
185
|
+
components.JuspayPaymentGatewayParams$outboundSchema.and(
|
|
186
|
+
z.object({ paymentGateway: z.literal("JUSPAY") }).transform((v) => ({
|
|
187
|
+
payment_gateway: v.paymentGateway,
|
|
188
|
+
})),
|
|
189
|
+
),
|
|
190
|
+
]),
|
|
132
191
|
}).transform((v) => {
|
|
133
192
|
return remap$(v, {
|
|
134
|
-
|
|
193
|
+
paymentGatewayParams: "payment_gateway_params",
|
|
135
194
|
});
|
|
136
195
|
});
|
|
137
196
|
|
|
@@ -239,175 +298,46 @@ export function postRetryPaymentOrderIdRequestFromJSON(
|
|
|
239
298
|
);
|
|
240
299
|
}
|
|
241
300
|
|
|
242
|
-
/** @internal */
|
|
243
|
-
export const BillingCurrency$inboundSchema: z.ZodNativeEnum<
|
|
244
|
-
typeof BillingCurrency
|
|
245
|
-
> = z.nativeEnum(BillingCurrency);
|
|
246
|
-
|
|
247
|
-
/** @internal */
|
|
248
|
-
export const BillingCurrency$outboundSchema: z.ZodNativeEnum<
|
|
249
|
-
typeof BillingCurrency
|
|
250
|
-
> = BillingCurrency$inboundSchema;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* @internal
|
|
254
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
255
|
-
*/
|
|
256
|
-
export namespace BillingCurrency$ {
|
|
257
|
-
/** @deprecated use `BillingCurrency$inboundSchema` instead. */
|
|
258
|
-
export const inboundSchema = BillingCurrency$inboundSchema;
|
|
259
|
-
/** @deprecated use `BillingCurrency$outboundSchema` instead. */
|
|
260
|
-
export const outboundSchema = BillingCurrency$outboundSchema;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/** @internal */
|
|
264
|
-
export const BillingCycle$inboundSchema: z.ZodNativeEnum<typeof BillingCycle> =
|
|
265
|
-
z.nativeEnum(BillingCycle);
|
|
266
|
-
|
|
267
|
-
/** @internal */
|
|
268
|
-
export const BillingCycle$outboundSchema: z.ZodNativeEnum<typeof BillingCycle> =
|
|
269
|
-
BillingCycle$inboundSchema;
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* @internal
|
|
273
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
274
|
-
*/
|
|
275
|
-
export namespace BillingCycle$ {
|
|
276
|
-
/** @deprecated use `BillingCycle$inboundSchema` instead. */
|
|
277
|
-
export const inboundSchema = BillingCycle$inboundSchema;
|
|
278
|
-
/** @deprecated use `BillingCycle$outboundSchema` instead. */
|
|
279
|
-
export const outboundSchema = BillingCycle$outboundSchema;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/** @internal */
|
|
283
|
-
export const SiDetails$inboundSchema: z.ZodType<
|
|
284
|
-
SiDetails,
|
|
285
|
-
z.ZodTypeDef,
|
|
286
|
-
unknown
|
|
287
|
-
> = z.object({
|
|
288
|
-
billingAmount: z.number().optional(),
|
|
289
|
-
billingCurrency: BillingCurrency$inboundSchema.optional(),
|
|
290
|
-
billingCycle: BillingCycle$inboundSchema.optional(),
|
|
291
|
-
billingInterval: z.number().int().optional(),
|
|
292
|
-
paymentStartDate: z.string().transform(v => new RFCDate(v)).optional(),
|
|
293
|
-
paymentEndDate: z.string().transform(v => new RFCDate(v)).optional(),
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
/** @internal */
|
|
297
|
-
export type SiDetails$Outbound = {
|
|
298
|
-
billingAmount?: number | undefined;
|
|
299
|
-
billingCurrency?: string | undefined;
|
|
300
|
-
billingCycle?: string | undefined;
|
|
301
|
-
billingInterval?: number | undefined;
|
|
302
|
-
paymentStartDate?: string | undefined;
|
|
303
|
-
paymentEndDate?: string | undefined;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
/** @internal */
|
|
307
|
-
export const SiDetails$outboundSchema: z.ZodType<
|
|
308
|
-
SiDetails$Outbound,
|
|
309
|
-
z.ZodTypeDef,
|
|
310
|
-
SiDetails
|
|
311
|
-
> = z.object({
|
|
312
|
-
billingAmount: z.number().optional(),
|
|
313
|
-
billingCurrency: BillingCurrency$outboundSchema.optional(),
|
|
314
|
-
billingCycle: BillingCycle$outboundSchema.optional(),
|
|
315
|
-
billingInterval: z.number().int().optional(),
|
|
316
|
-
paymentStartDate: z.instanceof(RFCDate).transform(v => v.toString())
|
|
317
|
-
.optional(),
|
|
318
|
-
paymentEndDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* @internal
|
|
323
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
324
|
-
*/
|
|
325
|
-
export namespace SiDetails$ {
|
|
326
|
-
/** @deprecated use `SiDetails$inboundSchema` instead. */
|
|
327
|
-
export const inboundSchema = SiDetails$inboundSchema;
|
|
328
|
-
/** @deprecated use `SiDetails$outboundSchema` instead. */
|
|
329
|
-
export const outboundSchema = SiDetails$outboundSchema;
|
|
330
|
-
/** @deprecated use `SiDetails$Outbound` instead. */
|
|
331
|
-
export type Outbound = SiDetails$Outbound;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export function siDetailsToJSON(siDetails: SiDetails): string {
|
|
335
|
-
return JSON.stringify(SiDetails$outboundSchema.parse(siDetails));
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export function siDetailsFromJSON(
|
|
339
|
-
jsonString: string,
|
|
340
|
-
): SafeParseResult<SiDetails, SDKValidationError> {
|
|
341
|
-
return safeParse(
|
|
342
|
-
jsonString,
|
|
343
|
-
(x) => SiDetails$inboundSchema.parse(JSON.parse(x)),
|
|
344
|
-
`Failed to parse 'SiDetails' from JSON`,
|
|
345
|
-
);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
301
|
/** @internal */
|
|
349
302
|
export const PostRetryPaymentOrderIdPaymentInfo$inboundSchema: z.ZodType<
|
|
350
303
|
PostRetryPaymentOrderIdPaymentInfo,
|
|
351
304
|
z.ZodTypeDef,
|
|
352
305
|
unknown
|
|
353
|
-
> = z.
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
hash: z.string().optional(),
|
|
366
|
-
}).transform((v) => {
|
|
367
|
-
return remap$(v, {
|
|
368
|
-
"si_details": "siDetails",
|
|
369
|
-
});
|
|
370
|
-
});
|
|
306
|
+
> = z.union([
|
|
307
|
+
components.JuspayPaymentInfo$inboundSchema.and(
|
|
308
|
+
z.object({ payment_gateway: z.literal("JUSPAY") }).transform((v) => ({
|
|
309
|
+
paymentGateway: v.payment_gateway,
|
|
310
|
+
})),
|
|
311
|
+
),
|
|
312
|
+
components.PayuPaymentInfo$inboundSchema.and(
|
|
313
|
+
z.object({ payment_gateway: z.literal("PAYU") }).transform((v) => ({
|
|
314
|
+
paymentGateway: v.payment_gateway,
|
|
315
|
+
})),
|
|
316
|
+
),
|
|
317
|
+
]);
|
|
371
318
|
|
|
372
319
|
/** @internal */
|
|
373
|
-
export type PostRetryPaymentOrderIdPaymentInfo$Outbound =
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
amount?: string | undefined;
|
|
377
|
-
productinfo?: string | undefined;
|
|
378
|
-
firstname?: string | undefined;
|
|
379
|
-
email?: string | undefined;
|
|
380
|
-
phone?: string | undefined;
|
|
381
|
-
si?: number | undefined;
|
|
382
|
-
si_details?: SiDetails$Outbound | undefined;
|
|
383
|
-
furl?: string | undefined;
|
|
384
|
-
surl?: string | undefined;
|
|
385
|
-
hash?: string | undefined;
|
|
386
|
-
};
|
|
320
|
+
export type PostRetryPaymentOrderIdPaymentInfo$Outbound =
|
|
321
|
+
| (components.JuspayPaymentInfo$Outbound & { payment_gateway: "JUSPAY" })
|
|
322
|
+
| (components.PayuPaymentInfo$Outbound & { payment_gateway: "PAYU" });
|
|
387
323
|
|
|
388
324
|
/** @internal */
|
|
389
325
|
export const PostRetryPaymentOrderIdPaymentInfo$outboundSchema: z.ZodType<
|
|
390
326
|
PostRetryPaymentOrderIdPaymentInfo$Outbound,
|
|
391
327
|
z.ZodTypeDef,
|
|
392
328
|
PostRetryPaymentOrderIdPaymentInfo
|
|
393
|
-
> = z.
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
hash: z.string().optional(),
|
|
406
|
-
}).transform((v) => {
|
|
407
|
-
return remap$(v, {
|
|
408
|
-
siDetails: "si_details",
|
|
409
|
-
});
|
|
410
|
-
});
|
|
329
|
+
> = z.union([
|
|
330
|
+
components.JuspayPaymentInfo$outboundSchema.and(
|
|
331
|
+
z.object({ paymentGateway: z.literal("JUSPAY") }).transform((v) => ({
|
|
332
|
+
payment_gateway: v.paymentGateway,
|
|
333
|
+
})),
|
|
334
|
+
),
|
|
335
|
+
components.PayuPaymentInfo$outboundSchema.and(
|
|
336
|
+
z.object({ paymentGateway: z.literal("PAYU") }).transform((v) => ({
|
|
337
|
+
payment_gateway: v.paymentGateway,
|
|
338
|
+
})),
|
|
339
|
+
),
|
|
340
|
+
]);
|
|
411
341
|
|
|
412
342
|
/**
|
|
413
343
|
* @internal
|
|
@@ -451,8 +381,18 @@ export const PostRetryPaymentOrderIdContent$inboundSchema: z.ZodType<
|
|
|
451
381
|
unknown
|
|
452
382
|
> = z.object({
|
|
453
383
|
payment_required: z.boolean().optional(),
|
|
454
|
-
payment_info: z.
|
|
455
|
-
.
|
|
384
|
+
payment_info: z.union([
|
|
385
|
+
components.JuspayPaymentInfo$inboundSchema.and(
|
|
386
|
+
z.object({ payment_gateway: z.literal("JUSPAY") }).transform((v) => ({
|
|
387
|
+
paymentGateway: v.payment_gateway,
|
|
388
|
+
})),
|
|
389
|
+
),
|
|
390
|
+
components.PayuPaymentInfo$inboundSchema.and(
|
|
391
|
+
z.object({ payment_gateway: z.literal("PAYU") }).transform((v) => ({
|
|
392
|
+
paymentGateway: v.payment_gateway,
|
|
393
|
+
})),
|
|
394
|
+
),
|
|
395
|
+
]).optional(),
|
|
456
396
|
}).transform((v) => {
|
|
457
397
|
return remap$(v, {
|
|
458
398
|
"payment_required": "paymentRequired",
|
|
@@ -463,7 +403,10 @@ export const PostRetryPaymentOrderIdContent$inboundSchema: z.ZodType<
|
|
|
463
403
|
/** @internal */
|
|
464
404
|
export type PostRetryPaymentOrderIdContent$Outbound = {
|
|
465
405
|
payment_required?: boolean | undefined;
|
|
466
|
-
payment_info?:
|
|
406
|
+
payment_info?:
|
|
407
|
+
| (components.JuspayPaymentInfo$Outbound & { payment_gateway: "JUSPAY" })
|
|
408
|
+
| (components.PayuPaymentInfo$Outbound & { payment_gateway: "PAYU" })
|
|
409
|
+
| undefined;
|
|
467
410
|
};
|
|
468
411
|
|
|
469
412
|
/** @internal */
|
|
@@ -473,8 +416,18 @@ export const PostRetryPaymentOrderIdContent$outboundSchema: z.ZodType<
|
|
|
473
416
|
PostRetryPaymentOrderIdContent
|
|
474
417
|
> = z.object({
|
|
475
418
|
paymentRequired: z.boolean().optional(),
|
|
476
|
-
paymentInfo: z.
|
|
477
|
-
.
|
|
419
|
+
paymentInfo: z.union([
|
|
420
|
+
components.JuspayPaymentInfo$outboundSchema.and(
|
|
421
|
+
z.object({ paymentGateway: z.literal("JUSPAY") }).transform((v) => ({
|
|
422
|
+
payment_gateway: v.paymentGateway,
|
|
423
|
+
})),
|
|
424
|
+
),
|
|
425
|
+
components.PayuPaymentInfo$outboundSchema.and(
|
|
426
|
+
z.object({ paymentGateway: z.literal("PAYU") }).transform((v) => ({
|
|
427
|
+
payment_gateway: v.paymentGateway,
|
|
428
|
+
})),
|
|
429
|
+
),
|
|
430
|
+
]).optional(),
|
|
478
431
|
}).transform((v) => {
|
|
479
432
|
return remap$(v, {
|
|
480
433
|
paymentRequired: "payment_required",
|
package/src/sdk/orders.ts
CHANGED
|
@@ -102,7 +102,7 @@ export class Orders extends ClientSDK {
|
|
|
102
102
|
* Retry payment
|
|
103
103
|
*
|
|
104
104
|
* @remarks
|
|
105
|
-
*
|
|
105
|
+
* To generate new payment request if first payment request is failed or expired. Retry payment request can be made after 15 mins of last request or immediately after last payment request is marked as failed.
|
|
106
106
|
*/
|
|
107
107
|
async retryPayment(
|
|
108
108
|
request: operations.PostRetryPaymentOrderIdRequest,
|