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,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
+ paymentProviderSlug: 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_provider_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_provider_slug": "paymentProviderSlug",
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_provider_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
+ paymentProviderSlug: 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
+ paymentProviderSlug: "payment_provider_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
+ }
@@ -103,14 +103,15 @@ export type SDKPayload = {
103
103
  };
104
104
 
105
105
  /**
106
- * @see {@link https://llm-docs.commercengine.io/storefront/schemas/JuspayPaymentInfo} - API reference for the JuspayPaymentInfo schema
106
+ * @see {@link https://llm-docs.commercengine.io/storefront/schemas/JusPayHyperCheckoutResponse} - API reference for the JusPayHyperCheckoutResponse schema
107
107
  */
108
- export type JuspayPaymentInfo = {
108
+ export type JusPayHyperCheckoutResponse = {
109
109
  id?: string | undefined;
110
110
  status?: string | undefined;
111
111
  orderId?: string | undefined;
112
112
  paymentLinks?: PaymentLinks | undefined;
113
113
  sdkPayload?: SDKPayload | undefined;
114
+ orderExpiry?: Date | undefined;
114
115
  };
115
116
 
116
117
  /** @internal */
@@ -373,8 +374,8 @@ export function sdkPayloadFromJSON(
373
374
  }
374
375
 
375
376
  /** @internal */
376
- export const JuspayPaymentInfo$inboundSchema: z.ZodType<
377
- JuspayPaymentInfo,
377
+ export const JusPayHyperCheckoutResponse$inboundSchema: z.ZodType<
378
+ JusPayHyperCheckoutResponse,
378
379
  z.ZodTypeDef,
379
380
  unknown
380
381
  > = z.object({
@@ -383,39 +384,46 @@ export const JuspayPaymentInfo$inboundSchema: z.ZodType<
383
384
  order_id: z.string().optional(),
384
385
  payment_links: z.lazy(() => PaymentLinks$inboundSchema).optional(),
385
386
  sdk_payload: z.lazy(() => SDKPayload$inboundSchema).optional(),
387
+ order_expiry: z.string().datetime({ offset: true }).transform(v =>
388
+ new Date(v)
389
+ ).optional(),
386
390
  }).transform((v) => {
387
391
  return remap$(v, {
388
392
  "order_id": "orderId",
389
393
  "payment_links": "paymentLinks",
390
394
  "sdk_payload": "sdkPayload",
395
+ "order_expiry": "orderExpiry",
391
396
  });
392
397
  });
393
398
 
394
399
  /** @internal */
395
- export type JuspayPaymentInfo$Outbound = {
400
+ export type JusPayHyperCheckoutResponse$Outbound = {
396
401
  id?: string | undefined;
397
402
  status?: string | undefined;
398
403
  order_id?: string | undefined;
399
404
  payment_links?: PaymentLinks$Outbound | undefined;
400
405
  sdk_payload?: SDKPayload$Outbound | undefined;
406
+ order_expiry?: string | undefined;
401
407
  };
402
408
 
403
409
  /** @internal */
404
- export const JuspayPaymentInfo$outboundSchema: z.ZodType<
405
- JuspayPaymentInfo$Outbound,
410
+ export const JusPayHyperCheckoutResponse$outboundSchema: z.ZodType<
411
+ JusPayHyperCheckoutResponse$Outbound,
406
412
  z.ZodTypeDef,
407
- JuspayPaymentInfo
413
+ JusPayHyperCheckoutResponse
408
414
  > = z.object({
409
415
  id: z.string().optional(),
410
416
  status: z.string().optional(),
411
417
  orderId: z.string().optional(),
412
418
  paymentLinks: z.lazy(() => PaymentLinks$outboundSchema).optional(),
413
419
  sdkPayload: z.lazy(() => SDKPayload$outboundSchema).optional(),
420
+ orderExpiry: z.date().transform(v => v.toISOString()).optional(),
414
421
  }).transform((v) => {
415
422
  return remap$(v, {
416
423
  orderId: "order_id",
417
424
  paymentLinks: "payment_links",
418
425
  sdkPayload: "sdk_payload",
426
+ orderExpiry: "order_expiry",
419
427
  });
420
428
  });
421
429
 
@@ -423,29 +431,31 @@ export const JuspayPaymentInfo$outboundSchema: z.ZodType<
423
431
  * @internal
424
432
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
425
433
  */
426
- export namespace JuspayPaymentInfo$ {
427
- /** @deprecated use `JuspayPaymentInfo$inboundSchema` instead. */
428
- export const inboundSchema = JuspayPaymentInfo$inboundSchema;
429
- /** @deprecated use `JuspayPaymentInfo$outboundSchema` instead. */
430
- export const outboundSchema = JuspayPaymentInfo$outboundSchema;
431
- /** @deprecated use `JuspayPaymentInfo$Outbound` instead. */
432
- export type Outbound = JuspayPaymentInfo$Outbound;
434
+ export namespace JusPayHyperCheckoutResponse$ {
435
+ /** @deprecated use `JusPayHyperCheckoutResponse$inboundSchema` instead. */
436
+ export const inboundSchema = JusPayHyperCheckoutResponse$inboundSchema;
437
+ /** @deprecated use `JusPayHyperCheckoutResponse$outboundSchema` instead. */
438
+ export const outboundSchema = JusPayHyperCheckoutResponse$outboundSchema;
439
+ /** @deprecated use `JusPayHyperCheckoutResponse$Outbound` instead. */
440
+ export type Outbound = JusPayHyperCheckoutResponse$Outbound;
433
441
  }
434
442
 
435
- export function juspayPaymentInfoToJSON(
436
- juspayPaymentInfo: JuspayPaymentInfo,
443
+ export function jusPayHyperCheckoutResponseToJSON(
444
+ jusPayHyperCheckoutResponse: JusPayHyperCheckoutResponse,
437
445
  ): string {
438
446
  return JSON.stringify(
439
- JuspayPaymentInfo$outboundSchema.parse(juspayPaymentInfo),
447
+ JusPayHyperCheckoutResponse$outboundSchema.parse(
448
+ jusPayHyperCheckoutResponse,
449
+ ),
440
450
  );
441
451
  }
442
452
 
443
- export function juspayPaymentInfoFromJSON(
453
+ export function jusPayHyperCheckoutResponseFromJSON(
444
454
  jsonString: string,
445
- ): SafeParseResult<JuspayPaymentInfo, SDKValidationError> {
455
+ ): SafeParseResult<JusPayHyperCheckoutResponse, SDKValidationError> {
446
456
  return safeParse(
447
457
  jsonString,
448
- (x) => JuspayPaymentInfo$inboundSchema.parse(JSON.parse(x)),
449
- `Failed to parse 'JuspayPaymentInfo' from JSON`,
458
+ (x) => JusPayHyperCheckoutResponse$inboundSchema.parse(JSON.parse(x)),
459
+ `Failed to parse 'JusPayHyperCheckoutResponse' from JSON`,
450
460
  );
451
461
  }
@@ -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/JuspayNetBanking} - API reference for the JuspayNetBanking schema
13
+ */
14
+ export type JuspayNetBanking = {
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?: "NB" | undefined;
22
+ paymentMethod: string;
23
+ };
24
+
25
+ /** @internal */
26
+ export const JuspayNetBanking$inboundSchema: z.ZodType<
27
+ JuspayNetBanking,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ payment_provider_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().optional(),
37
+ get_client_auth_token: z.boolean().optional(),
38
+ payment_method_type: z.literal("NB").default("NB").optional(),
39
+ payment_method: z.string(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "payment_provider_slug": "paymentProviderSlug",
43
+ "integration_type": "integrationType",
44
+ "gateway_reference_id": "gatewayReferenceId",
45
+ "return_url": "returnUrl",
46
+ "redirect_after_payment": "redirectAfterPayment",
47
+ "get_client_auth_token": "getClientAuthToken",
48
+ "payment_method_type": "paymentMethodType",
49
+ "payment_method": "paymentMethod",
50
+ });
51
+ });
52
+
53
+ /** @internal */
54
+ export type JuspayNetBanking$Outbound = {
55
+ payment_provider_slug: string;
56
+ integration_type: "express-checkout";
57
+ gateway_reference_id: string;
58
+ return_url?: string | undefined;
59
+ redirect_after_payment?: boolean | undefined;
60
+ get_client_auth_token?: boolean | undefined;
61
+ payment_method_type: "NB";
62
+ payment_method: string;
63
+ };
64
+
65
+ /** @internal */
66
+ export const JuspayNetBanking$outboundSchema: z.ZodType<
67
+ JuspayNetBanking$Outbound,
68
+ z.ZodTypeDef,
69
+ JuspayNetBanking
70
+ > = z.object({
71
+ paymentProviderSlug: z.string(),
72
+ integrationType: z.literal("express-checkout"),
73
+ gatewayReferenceId: z.string(),
74
+ returnUrl: z.string().optional(),
75
+ redirectAfterPayment: z.boolean().optional(),
76
+ getClientAuthToken: z.boolean().optional(),
77
+ paymentMethodType: z.literal("NB"),
78
+ paymentMethod: z.string(),
79
+ }).transform((v) => {
80
+ return remap$(v, {
81
+ paymentProviderSlug: "payment_provider_slug",
82
+ integrationType: "integration_type",
83
+ gatewayReferenceId: "gateway_reference_id",
84
+ returnUrl: "return_url",
85
+ redirectAfterPayment: "redirect_after_payment",
86
+ getClientAuthToken: "get_client_auth_token",
87
+ paymentMethodType: "payment_method_type",
88
+ paymentMethod: "payment_method",
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 JuspayNetBanking$ {
97
+ /** @deprecated use `JuspayNetBanking$inboundSchema` instead. */
98
+ export const inboundSchema = JuspayNetBanking$inboundSchema;
99
+ /** @deprecated use `JuspayNetBanking$outboundSchema` instead. */
100
+ export const outboundSchema = JuspayNetBanking$outboundSchema;
101
+ /** @deprecated use `JuspayNetBanking$Outbound` instead. */
102
+ export type Outbound = JuspayNetBanking$Outbound;
103
+ }
104
+
105
+ export function juspayNetBankingToJSON(
106
+ juspayNetBanking: JuspayNetBanking,
107
+ ): string {
108
+ return JSON.stringify(
109
+ JuspayNetBanking$outboundSchema.parse(juspayNetBanking),
110
+ );
111
+ }
112
+
113
+ export function juspayNetBankingFromJSON(
114
+ jsonString: string,
115
+ ): SafeParseResult<JuspayNetBanking, SDKValidationError> {
116
+ return safeParse(
117
+ jsonString,
118
+ (x) => JuspayNetBanking$inboundSchema.parse(JSON.parse(x)),
119
+ `Failed to parse 'JuspayNetBanking' from JSON`,
120
+ );
121
+ }
@@ -0,0 +1,191 @@
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 PaymentMethod = {
13
+ Visa: "VISA",
14
+ Master: "MASTER",
15
+ } as const;
16
+ export type PaymentMethod = ClosedEnum<typeof PaymentMethod>;
17
+
18
+ /**
19
+ * @see {@link https://llm-docs.commercengine.io/storefront/schemas/JusPayNewCard} - API reference for the JusPayNewCard schema
20
+ */
21
+ export type JusPayNewCard = {
22
+ paymentProviderSlug: string;
23
+ integrationType?: "express-checkout" | undefined;
24
+ gatewayReferenceId: string;
25
+ returnUrl?: string | undefined;
26
+ redirectAfterPayment?: boolean | undefined;
27
+ getClientAuthToken?: boolean | undefined;
28
+ authType?: "OTP" | undefined;
29
+ tokenize: boolean;
30
+ saveToLocker: boolean;
31
+ paymentMethodType?: "CARD" | undefined;
32
+ paymentMethod: PaymentMethod;
33
+ cardNumber: string;
34
+ cardExpMonth: string;
35
+ cardExpYear: string;
36
+ nameOnCard: string;
37
+ cardSecurityCode: string;
38
+ };
39
+
40
+ /** @internal */
41
+ export const PaymentMethod$inboundSchema: z.ZodNativeEnum<
42
+ typeof PaymentMethod
43
+ > = z.nativeEnum(PaymentMethod);
44
+
45
+ /** @internal */
46
+ export const PaymentMethod$outboundSchema: z.ZodNativeEnum<
47
+ typeof PaymentMethod
48
+ > = PaymentMethod$inboundSchema;
49
+
50
+ /**
51
+ * @internal
52
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
53
+ */
54
+ export namespace PaymentMethod$ {
55
+ /** @deprecated use `PaymentMethod$inboundSchema` instead. */
56
+ export const inboundSchema = PaymentMethod$inboundSchema;
57
+ /** @deprecated use `PaymentMethod$outboundSchema` instead. */
58
+ export const outboundSchema = PaymentMethod$outboundSchema;
59
+ }
60
+
61
+ /** @internal */
62
+ export const JusPayNewCard$inboundSchema: z.ZodType<
63
+ JusPayNewCard,
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: PaymentMethod$inboundSchema,
79
+ card_number: z.string(),
80
+ card_exp_month: z.string(),
81
+ card_exp_year: z.string(),
82
+ name_on_card: z.string(),
83
+ card_security_code: z.string(),
84
+ }).transform((v) => {
85
+ return remap$(v, {
86
+ "payment_provider_slug": "paymentProviderSlug",
87
+ "integration_type": "integrationType",
88
+ "gateway_reference_id": "gatewayReferenceId",
89
+ "return_url": "returnUrl",
90
+ "redirect_after_payment": "redirectAfterPayment",
91
+ "get_client_auth_token": "getClientAuthToken",
92
+ "auth_type": "authType",
93
+ "save_to_locker": "saveToLocker",
94
+ "payment_method_type": "paymentMethodType",
95
+ "payment_method": "paymentMethod",
96
+ "card_number": "cardNumber",
97
+ "card_exp_month": "cardExpMonth",
98
+ "card_exp_year": "cardExpYear",
99
+ "name_on_card": "nameOnCard",
100
+ "card_security_code": "cardSecurityCode",
101
+ });
102
+ });
103
+
104
+ /** @internal */
105
+ export type JusPayNewCard$Outbound = {
106
+ payment_provider_slug: string;
107
+ integration_type: "express-checkout";
108
+ gateway_reference_id: string;
109
+ return_url?: string | undefined;
110
+ redirect_after_payment?: boolean | undefined;
111
+ get_client_auth_token?: boolean | undefined;
112
+ auth_type: "OTP";
113
+ tokenize: boolean;
114
+ save_to_locker: boolean;
115
+ payment_method_type: "CARD";
116
+ payment_method: string;
117
+ card_number: string;
118
+ card_exp_month: string;
119
+ card_exp_year: string;
120
+ name_on_card: string;
121
+ card_security_code: string;
122
+ };
123
+
124
+ /** @internal */
125
+ export const JusPayNewCard$outboundSchema: z.ZodType<
126
+ JusPayNewCard$Outbound,
127
+ z.ZodTypeDef,
128
+ JusPayNewCard
129
+ > = z.object({
130
+ paymentProviderSlug: z.string(),
131
+ integrationType: z.literal("express-checkout"),
132
+ gatewayReferenceId: z.string(),
133
+ returnUrl: z.string().optional(),
134
+ redirectAfterPayment: z.boolean().optional(),
135
+ getClientAuthToken: z.boolean().optional(),
136
+ authType: z.literal("OTP"),
137
+ tokenize: z.boolean(),
138
+ saveToLocker: z.boolean(),
139
+ paymentMethodType: z.literal("CARD"),
140
+ paymentMethod: PaymentMethod$outboundSchema,
141
+ cardNumber: z.string(),
142
+ cardExpMonth: z.string(),
143
+ cardExpYear: z.string(),
144
+ nameOnCard: z.string(),
145
+ cardSecurityCode: z.string(),
146
+ }).transform((v) => {
147
+ return remap$(v, {
148
+ paymentProviderSlug: "payment_provider_slug",
149
+ integrationType: "integration_type",
150
+ gatewayReferenceId: "gateway_reference_id",
151
+ returnUrl: "return_url",
152
+ redirectAfterPayment: "redirect_after_payment",
153
+ getClientAuthToken: "get_client_auth_token",
154
+ authType: "auth_type",
155
+ saveToLocker: "save_to_locker",
156
+ paymentMethodType: "payment_method_type",
157
+ paymentMethod: "payment_method",
158
+ cardNumber: "card_number",
159
+ cardExpMonth: "card_exp_month",
160
+ cardExpYear: "card_exp_year",
161
+ nameOnCard: "name_on_card",
162
+ cardSecurityCode: "card_security_code",
163
+ });
164
+ });
165
+
166
+ /**
167
+ * @internal
168
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
169
+ */
170
+ export namespace JusPayNewCard$ {
171
+ /** @deprecated use `JusPayNewCard$inboundSchema` instead. */
172
+ export const inboundSchema = JusPayNewCard$inboundSchema;
173
+ /** @deprecated use `JusPayNewCard$outboundSchema` instead. */
174
+ export const outboundSchema = JusPayNewCard$outboundSchema;
175
+ /** @deprecated use `JusPayNewCard$Outbound` instead. */
176
+ export type Outbound = JusPayNewCard$Outbound;
177
+ }
178
+
179
+ export function jusPayNewCardToJSON(jusPayNewCard: JusPayNewCard): string {
180
+ return JSON.stringify(JusPayNewCard$outboundSchema.parse(jusPayNewCard));
181
+ }
182
+
183
+ export function jusPayNewCardFromJSON(
184
+ jsonString: string,
185
+ ): SafeParseResult<JusPayNewCard, SDKValidationError> {
186
+ return safeParse(
187
+ jsonString,
188
+ (x) => JusPayNewCard$inboundSchema.parse(JSON.parse(x)),
189
+ `Failed to parse 'JusPayNewCard' from JSON`,
190
+ );
191
+ }
@@ -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 Action = {
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 Action = ClosedEnum<typeof Action>;
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: 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 Action$inboundSchema: z.ZodNativeEnum<typeof Action> = z
61
- .nativeEnum(Action);
62
+ export const JuspayPaymentGatewayParamsAction$inboundSchema: z.ZodNativeEnum<
63
+ typeof JuspayPaymentGatewayParamsAction
64
+ > = z.nativeEnum(JuspayPaymentGatewayParamsAction);
62
65
 
63
66
  /** @internal */
64
- export const Action$outboundSchema: z.ZodNativeEnum<typeof Action> =
65
- Action$inboundSchema;
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 Action$ {
72
- /** @deprecated use `Action$inboundSchema` instead. */
73
- export const inboundSchema = Action$inboundSchema;
74
- /** @deprecated use `Action$outboundSchema` instead. */
75
- export const outboundSchema = Action$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: Action$inboundSchema,
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: Action$outboundSchema,
139
+ action: JuspayPaymentGatewayParamsAction$outboundSchema,
136
140
  integrationType: IntegrationType$outboundSchema,
137
141
  returnUrl: z.string(),
138
142
  gatewayReferenceId: z.string(),