@juspay-tech/react-hyper-js 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay-tech/react-hyper-js",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "exports": {
package/src/Index.resi CHANGED
@@ -29,6 +29,7 @@ let \"PaymentElement": PaymentElement.props<
29
29
  option<option<RescriptCore.JSON.t> => unit>,
30
30
  option<option<RescriptCore.JSON.t> => unit>,
31
31
  option<option<RescriptCore.JSON.t> => unit>,
32
+ option<option<RescriptCore.JSON.t> => unit>,
32
33
  > => React.element
33
34
  let \"UnifiedCheckout": PaymentElement.props<
34
35
  string,
@@ -38,6 +39,7 @@ let \"UnifiedCheckout": PaymentElement.props<
38
39
  option<option<RescriptCore.JSON.t> => unit>,
39
40
  option<option<RescriptCore.JSON.t> => unit>,
40
41
  option<option<RescriptCore.JSON.t> => unit>,
42
+ option<option<RescriptCore.JSON.t> => unit>,
41
43
  > => React.element
42
44
  let \"CardElement": CardElement.props<
43
45
  string,
@@ -47,6 +49,7 @@ let \"CardElement": CardElement.props<
47
49
  option<option<RescriptCore.JSON.t> => unit>,
48
50
  option<option<RescriptCore.JSON.t> => unit>,
49
51
  option<option<RescriptCore.JSON.t> => unit>,
52
+ option<option<RescriptCore.JSON.t> => unit>,
50
53
  > => React.element
51
54
  let \"CardWidget": CardElement.props<
52
55
  string,
@@ -56,6 +59,7 @@ let \"CardWidget": CardElement.props<
56
59
  option<option<RescriptCore.JSON.t> => unit>,
57
60
  option<option<RescriptCore.JSON.t> => unit>,
58
61
  option<option<RescriptCore.JSON.t> => unit>,
62
+ option<option<RescriptCore.JSON.t> => unit>,
59
63
  > => React.element
60
64
  let \"CardNumberElement": CardNumber.props<
61
65
  string,
@@ -65,6 +69,7 @@ let \"CardNumberElement": CardNumber.props<
65
69
  option<option<RescriptCore.JSON.t> => unit>,
66
70
  option<option<RescriptCore.JSON.t> => unit>,
67
71
  option<option<RescriptCore.JSON.t> => unit>,
72
+ option<option<RescriptCore.JSON.t> => unit>,
68
73
  > => React.element
69
74
  let \"CardNumberWidget": CardNumber.props<
70
75
  string,
@@ -74,6 +79,7 @@ let \"CardNumberWidget": CardNumber.props<
74
79
  option<option<RescriptCore.JSON.t> => unit>,
75
80
  option<option<RescriptCore.JSON.t> => unit>,
76
81
  option<option<RescriptCore.JSON.t> => unit>,
82
+ option<option<RescriptCore.JSON.t> => unit>,
77
83
  > => React.element
78
84
  let \"CardCVCElement": CardCVC.props<
79
85
  string,
@@ -83,6 +89,7 @@ let \"CardCVCElement": CardCVC.props<
83
89
  option<option<RescriptCore.JSON.t> => unit>,
84
90
  option<option<RescriptCore.JSON.t> => unit>,
85
91
  option<option<RescriptCore.JSON.t> => unit>,
92
+ option<option<RescriptCore.JSON.t> => unit>,
86
93
  > => React.element
87
94
  let \"CardCVCWidget": CardCVC.props<
88
95
  string,
@@ -92,6 +99,7 @@ let \"CardCVCWidget": CardCVC.props<
92
99
  option<option<RescriptCore.JSON.t> => unit>,
93
100
  option<option<RescriptCore.JSON.t> => unit>,
94
101
  option<option<RescriptCore.JSON.t> => unit>,
102
+ option<option<RescriptCore.JSON.t> => unit>,
95
103
  > => React.element
96
104
  let \"CardExpiryElement": CardExpiry.props<
97
105
  string,
@@ -101,6 +109,7 @@ let \"CardExpiryElement": CardExpiry.props<
101
109
  option<option<RescriptCore.JSON.t> => unit>,
102
110
  option<option<RescriptCore.JSON.t> => unit>,
103
111
  option<option<RescriptCore.JSON.t> => unit>,
112
+ option<option<RescriptCore.JSON.t> => unit>,
104
113
  > => React.element
105
114
  let \"CardExpiryWidget": CardExpiry.props<
106
115
  string,
@@ -110,6 +119,7 @@ let \"CardExpiryWidget": CardExpiry.props<
110
119
  option<option<RescriptCore.JSON.t> => unit>,
111
120
  option<option<RescriptCore.JSON.t> => unit>,
112
121
  option<option<RescriptCore.JSON.t> => unit>,
122
+ option<option<RescriptCore.JSON.t> => unit>,
113
123
  > => React.element
114
124
  let \"GooglePayElement": GooglePayElement.props<
115
125
  string,
@@ -119,6 +129,7 @@ let \"GooglePayElement": GooglePayElement.props<
119
129
  option<option<RescriptCore.JSON.t> => unit>,
120
130
  option<option<RescriptCore.JSON.t> => unit>,
121
131
  option<option<RescriptCore.JSON.t> => unit>,
132
+ option<option<RescriptCore.JSON.t> => unit>,
122
133
  > => React.element
123
134
  let \"ApplePayElement": ApplePayElement.props<
124
135
  string,
@@ -128,6 +139,7 @@ let \"ApplePayElement": ApplePayElement.props<
128
139
  option<option<RescriptCore.JSON.t> => unit>,
129
140
  option<option<RescriptCore.JSON.t> => unit>,
130
141
  option<option<RescriptCore.JSON.t> => unit>,
142
+ option<option<RescriptCore.JSON.t> => unit>,
131
143
  > => React.element
132
144
  let \"PayPalElement": PayPalElement.props<
133
145
  string,
@@ -137,6 +149,7 @@ let \"PayPalElement": PayPalElement.props<
137
149
  option<option<RescriptCore.JSON.t> => unit>,
138
150
  option<option<RescriptCore.JSON.t> => unit>,
139
151
  option<option<RescriptCore.JSON.t> => unit>,
152
+ option<option<RescriptCore.JSON.t> => unit>,
140
153
  > => React.element
141
154
  let \"ExpressCheckoutElement": ExpressCheckoutElement.props<
142
155
  string,
@@ -146,6 +159,7 @@ let \"ExpressCheckoutElement": ExpressCheckoutElement.props<
146
159
  option<option<RescriptCore.JSON.t> => unit>,
147
160
  option<option<RescriptCore.JSON.t> => unit>,
148
161
  option<option<RescriptCore.JSON.t> => unit>,
162
+ option<option<RescriptCore.JSON.t> => unit>,
149
163
  > => React.element
150
164
  let \"HyperManagementElements": HyperManagementElements.props<
151
165
  React.element,
@@ -12,7 +12,8 @@ function ApplePayElement(props) {
12
12
  componentType: "applePay",
13
13
  onFocus: props.onFocus,
14
14
  onBlur: props.onBlur,
15
- onClick: props.onClick
15
+ onClick: props.onClick,
16
+ onComplete: props.onComplete
16
17
  });
17
18
  }
18
19
 
@@ -1,6 +1,15 @@
1
1
  @react.component
2
- let make = (~id, ~options: JSON.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
2
+ let make = (
3
+ ~id,
4
+ ~options: JSON.t,
5
+ ~onChange,
6
+ ~onReady,
7
+ ~onFocus,
8
+ ~onBlur,
9
+ ~onClick,
10
+ ~onComplete,
11
+ ) => {
3
12
  <PaymentElementsWrapper
4
- id options onChange onReady onFocus onBlur onClick componentType="applePay"
13
+ id options onChange onReady onFocus onBlur onClick componentType="applePay" onComplete
5
14
  />
6
15
  }
@@ -12,7 +12,8 @@ function CardCVC(props) {
12
12
  componentType: "cardCvc",
13
13
  onFocus: props.onFocus,
14
14
  onBlur: props.onBlur,
15
- onClick: props.onClick
15
+ onClick: props.onClick,
16
+ onComplete: props.onComplete
16
17
  });
17
18
  }
18
19
 
@@ -1,6 +1,15 @@
1
1
  @react.component
2
- let make = (~id, ~options: JSON.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
2
+ let make = (
3
+ ~id,
4
+ ~options: JSON.t,
5
+ ~onChange,
6
+ ~onReady,
7
+ ~onFocus,
8
+ ~onBlur,
9
+ ~onClick,
10
+ ~onComplete,
11
+ ) => {
3
12
  <PaymentElementsWrapper
4
- id options onChange onReady onFocus onBlur onClick componentType="cardCvc"
13
+ id options onChange onReady onFocus onBlur onClick componentType="cardCvc" onComplete
5
14
  />
6
15
  }
@@ -12,7 +12,8 @@ function CardElement(props) {
12
12
  componentType: "card",
13
13
  onFocus: props.onFocus,
14
14
  onBlur: props.onBlur,
15
- onClick: props.onClick
15
+ onClick: props.onClick,
16
+ onComplete: props.onComplete
16
17
  });
17
18
  }
18
19
 
@@ -1,4 +1,15 @@
1
1
  @react.component
2
- let make = (~id, ~options: JSON.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
3
- <PaymentElementsWrapper id options onChange onReady onFocus onBlur onClick componentType="card" />
2
+ let make = (
3
+ ~id,
4
+ ~options: JSON.t,
5
+ ~onChange,
6
+ ~onReady,
7
+ ~onFocus,
8
+ ~onBlur,
9
+ ~onClick,
10
+ ~onComplete,
11
+ ) => {
12
+ <PaymentElementsWrapper
13
+ id options onChange onReady onFocus onBlur onClick componentType="card" onComplete
14
+ />
4
15
  }
@@ -12,7 +12,8 @@ function CardExpiry(props) {
12
12
  componentType: "cardExpiry",
13
13
  onFocus: props.onFocus,
14
14
  onBlur: props.onBlur,
15
- onClick: props.onClick
15
+ onClick: props.onClick,
16
+ onComplete: props.onComplete
16
17
  });
17
18
  }
18
19
 
@@ -1,6 +1,15 @@
1
1
  @react.component
2
- let make = (~id, ~options: JSON.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
2
+ let make = (
3
+ ~id,
4
+ ~options: JSON.t,
5
+ ~onChange,
6
+ ~onReady,
7
+ ~onFocus,
8
+ ~onBlur,
9
+ ~onClick,
10
+ ~onComplete,
11
+ ) => {
3
12
  <PaymentElementsWrapper
4
- id options onChange onReady onFocus onBlur onClick componentType="cardExpiry"
13
+ id options onChange onReady onFocus onBlur onClick componentType="cardExpiry" onComplete
5
14
  />
6
15
  }
@@ -12,7 +12,8 @@ function CardNumber(props) {
12
12
  componentType: "cardNumber",
13
13
  onFocus: props.onFocus,
14
14
  onBlur: props.onBlur,
15
- onClick: props.onClick
15
+ onClick: props.onClick,
16
+ onComplete: props.onComplete
16
17
  });
17
18
  }
18
19
 
@@ -1,6 +1,15 @@
1
1
  @react.component
2
- let make = (~id, ~options: JSON.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
2
+ let make = (
3
+ ~id,
4
+ ~options: JSON.t,
5
+ ~onChange,
6
+ ~onReady,
7
+ ~onFocus,
8
+ ~onBlur,
9
+ ~onClick,
10
+ ~onComplete,
11
+ ) => {
3
12
  <PaymentElementsWrapper
4
- id options onChange onReady onFocus onBlur onClick componentType="cardNumber"
13
+ id options onChange onReady onFocus onBlur onClick componentType="cardNumber" onComplete
5
14
  />
6
15
  }
@@ -12,7 +12,8 @@ function ExpressCheckoutElement(props) {
12
12
  componentType: "expressCheckout",
13
13
  onFocus: props.onFocus,
14
14
  onBlur: props.onBlur,
15
- onClick: props.onClick
15
+ onClick: props.onClick,
16
+ onComplete: props.onComplete
16
17
  });
17
18
  }
18
19
 
@@ -1,6 +1,15 @@
1
1
  @react.component
2
- let make = (~id, ~options: JSON.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
2
+ let make = (
3
+ ~id,
4
+ ~options: JSON.t,
5
+ ~onChange,
6
+ ~onReady,
7
+ ~onFocus,
8
+ ~onBlur,
9
+ ~onClick,
10
+ ~onComplete,
11
+ ) => {
3
12
  <PaymentElementsWrapper
4
- id options onChange onReady onFocus onBlur onClick componentType="expressCheckout"
13
+ id options onChange onReady onFocus onBlur onClick componentType="expressCheckout" onComplete
5
14
  />
6
15
  }
@@ -12,7 +12,8 @@ function GooglePayElement(props) {
12
12
  componentType: "googlePay",
13
13
  onFocus: props.onFocus,
14
14
  onBlur: props.onBlur,
15
- onClick: props.onClick
15
+ onClick: props.onClick,
16
+ onComplete: props.onComplete
16
17
  });
17
18
  }
18
19
 
@@ -1,6 +1,15 @@
1
1
  @react.component
2
- let make = (~id, ~options: JSON.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
2
+ let make = (
3
+ ~id,
4
+ ~options: JSON.t,
5
+ ~onChange,
6
+ ~onReady,
7
+ ~onFocus,
8
+ ~onBlur,
9
+ ~onClick,
10
+ ~onComplete,
11
+ ) => {
3
12
  <PaymentElementsWrapper
4
- id options onChange onReady onFocus onBlur onClick componentType="googlePay"
13
+ id options onChange onReady onFocus onBlur onClick onComplete componentType="googlePay"
5
14
  />
6
15
  }
@@ -12,7 +12,8 @@ function PayPalElement(props) {
12
12
  componentType: "payPal",
13
13
  onFocus: props.onFocus,
14
14
  onBlur: props.onBlur,
15
- onClick: props.onClick
15
+ onClick: props.onClick,
16
+ onComplete: props.onComplete
16
17
  });
17
18
  }
18
19
 
@@ -1,6 +1,15 @@
1
1
  @react.component
2
- let make = (~id, ~options: JSON.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
2
+ let make = (
3
+ ~id,
4
+ ~options: JSON.t,
5
+ ~onChange,
6
+ ~onReady,
7
+ ~onFocus,
8
+ ~onBlur,
9
+ ~onClick,
10
+ ~onComplete,
11
+ ) => {
3
12
  <PaymentElementsWrapper
4
- id options onChange onReady onFocus onBlur onClick componentType="payPal"
13
+ id options onChange onReady onFocus onBlur onClick componentType="payPal" onComplete
5
14
  />
6
15
  }
@@ -12,7 +12,8 @@ function PaymentElement(props) {
12
12
  componentType: "payment",
13
13
  onFocus: props.onFocus,
14
14
  onBlur: props.onBlur,
15
- onClick: props.onClick
15
+ onClick: props.onClick,
16
+ onComplete: props.onComplete
16
17
  });
17
18
  }
18
19
 
@@ -1,6 +1,15 @@
1
1
  @react.component
2
- let make = (~id, ~options: JSON.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
2
+ let make = (
3
+ ~id,
4
+ ~options: JSON.t,
5
+ ~onChange,
6
+ ~onReady,
7
+ ~onFocus,
8
+ ~onBlur,
9
+ ~onClick,
10
+ ~onComplete,
11
+ ) => {
3
12
  <PaymentElementsWrapper
4
- id options onChange onReady onFocus onBlur onClick componentType="payment"
13
+ id options onChange onReady onFocus onBlur onClick componentType="payment" onComplete
5
14
  />
6
15
  }
@@ -6,6 +6,7 @@ import * as Caml_option from "rescript/lib/es6/caml_option.js";
6
6
  import * as JsxRuntime from "react/jsx-runtime";
7
7
 
8
8
  function PaymentElementsWrapper(props) {
9
+ var onComplete = props.onComplete;
9
10
  var onClick = props.onClick;
10
11
  var onBlur = props.onBlur;
11
12
  var onFocus = props.onFocus;
@@ -32,6 +33,7 @@ function PaymentElementsWrapper(props) {
32
33
  paymentElement.on("blur", onBlur);
33
34
  paymentElement.on("clickTriggered", onClick);
34
35
  paymentElement.on("change", onChange);
36
+ paymentElement.on("complete", onComplete);
35
37
  }), [
36
38
  elementsState,
37
39
  hyperSwitch
@@ -8,6 +8,7 @@ let make = (
8
8
  ~onFocus,
9
9
  ~onBlur,
10
10
  ~onClick,
11
+ ~onComplete,
11
12
  ) => {
12
13
  let hyperSwitch = React.useContext(Context.switchContext)
13
14
  let elementsState = React.useContext(Context.elementsContext)
@@ -27,6 +28,7 @@ let make = (
27
28
  paymentElement.on("blur", onBlur)
28
29
  paymentElement.on("clickTriggered", onClick)
29
30
  paymentElement.on("change", onChange)
31
+ paymentElement.on("complete", onComplete)
30
32
  None
31
33
  }, (elementsState, hyperSwitch))
32
34