@juspay-tech/react-hyper-js 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +1 -1
- package/src/Index.bs.js +77 -3
- package/src/Index.res +57 -3
- package/src/Index.resi +57 -0
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function $(e,n,r){for(var i=new Array(r),t=0,u=n;t<r;)i[t]=e[u],t=t+1|0,u=u+1|0;return i}function x(e,n){for(;;){var r=n,i=e,t=i.length,u=t===0?1:t,c=r.length,a=u-c|0;if(a===0)return i.apply(null,r);if(a>=0)return function(s,l){return function(f){return x(s,l.concat([f]))}}(i,r);n=$(r,u,-a|0),e=i.apply(null,$(r,0,u))}}function d(e,n){var r=e.length;if(r===1)return e(n);switch(r){case 1:return e(n);case 2:return function(i){return e(n,i)};case 3:return function(i,t){return e(n,i,t)};case 4:return function(i,t,u){return e(n,i,t,u)};case 5:return function(i,t,u,c){return e(n,i,t,u,c)};case 6:return function(i,t,u,c,a){return e(n,i,t,u,c,a)};case 7:return function(i,t,u,c,a,s){return e(n,i,t,u,c,a,s)};default:return x(e,[n])}}function V(e){var n=e.length;return n===1?e:function(r){return d(e,r)}}function p(e,n,r){var i=e.length;if(i===2)return e(n,r);switch(i){case 1:return x(e(n),[r]);case 2:return e(n,r);case 3:return function(t){return e(n,r,t)};case 4:return function(t,u){return e(n,r,t,u)};case 5:return function(t,u,c){return e(n,r,t,u,c)};case 6:return function(t,u,c,a){return e(n,r,t,u,c,a)};case 7:return function(t,u,c,a,s){return e(n,r,t,u,c,a,s)};default:return x(e,[n,r])}}import*as o from"react";import*as L from"react";function ae(e,n){}function le(e){}function fe(e){}function se(e){}function me(e){}function de(e){}function ve(e){}function pe(e){}function _e(e){}var Y={on:ae,collapse:le,blur:fe,update:se,destroy:me,unmount:de,mount:ve,focus:pe,clear:_e};function E(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function H(e){if(!(e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0))return e;var n=e.BS_PRIVATE_NESTED_SOME_NONE;if(n!==0)return{BS_PRIVATE_NESTED_SOME_NONE:n-1|0}}function N(e,n){if(n in e)return E(e[n])}function Z(e){if(typeof e=="string")return e}function j(e){if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return E(e)}function ee(e){if(Array.isArray(e))return e}function he(e,n){if(e!==void 0)return n(H(e))}function P(e,n){return he(e,V(n))}function h(e,n){return e!==void 0?H(e):n}function we(e){return Promise.resolve({})}function Se(e,n,r){return Promise.resolve({})}function Re(e){return Promise.resolve({})}function Oe(e){return e}var k={clientSecret:"",confirmPayment:we,confirmCardPayment:Se,retrievePaymentIntent:Re,paymentRequest:Oe},g=L.createContext(k);function xe(e,n,r){return{value:e,children:n}}var Ve=g.Provider,w={makeProps:xe,make:Ve};function z(e,n,r){return h(P(N(e,n),Z),r)}function K(e){var n=h(j(e),{});return{fonts:h(P(N(n,"fonts"),ee),[]),locale:z(n,"locale",""),clientSecret:z(n,"clientSecret",""),appearance:h(P(N(n,"appearance"),j),{}),loader:z(n,"loader","auto")}}function Ne(e){}function Pe(e){}function ke(e){return new Promise(function(n,r){setTimeout(function(i){n({})},1e3)})}function Ae(e,n){return Y}var Be={fonts:[],locale:"",clientSecret:"",appearance:{},loader:""},A={options:Be,update:Ne,getElement:Pe,fetchUpdates:ke,create:Ae},S=L.createContext(A);function Te(e,n,r){return{value:e,children:n}}var Fe=S.Provider,R={makeProps:Te,make:Fe};function Q(e,n){return n.then(V(e))}function De(e){var n=e.children,r=e.stripe,i=e.options,t=K(i),u=o.useState(function(){return k}),c=u[1],a=o.useState(function(){return A}),s=a[1];return o.useEffect(function(){Q(function(l){var f=d(l.elements,i),v=f.update,_=f.getElement,m=f.fetchUpdates,y=f.create,B={options:t,update:v,getElement:_,fetchUpdates:m,create:y},oe=t.clientSecret,T=l.confirmPayment,F=l.confirmCardPayment,b=l.retrievePaymentIntent,I=l.paymentRequest,D=t.clientSecret,U=T,J=F,M=b,W=I,C={clientSecret:D,confirmPayment:U,confirmCardPayment:J,retrievePaymentIntent:M,paymentRequest:W};return d(c,function(q){return C}),d(s,function(q){return B}),Promise.resolve(C)},r)},[]),o.createElement(w.make,w.makeProps(u[0],o.createElement(R.make,R.makeProps(a[0],n,void 0)),void 0))}function Ue(e){var n=e.children,r=e.hyper,i=e.options,t=K(i),u=o.useState(function(){return k}),c=u[1],a=o.useState(function(){return A}),s=a[1];return o.useEffect(function(){Q(function(l){var f=d(l.elements,i),v=f.update,_=f.getElement,m=f.fetchUpdates,y=f.create,B={options:t,update:v,getElement:_,fetchUpdates:m,create:y},oe=t.clientSecret,T=l.confirmPayment,F=l.confirmCardPayment,b=l.retrievePaymentIntent,I=l.paymentRequest,D=t.clientSecret,U=T,J=F,M=b,W=I,C={clientSecret:D,confirmPayment:U,confirmCardPayment:J,retrievePaymentIntent:M,paymentRequest:W};return d(c,function(q){return C}),d(s,function(q){return B}),Promise.resolve(C)},r)},[]),o.createElement(w.make,w.makeProps(u[0],o.createElement(R.make,R.makeProps(a[0],n,void 0)),void 0))}function Me(e){return o.useContext(g)}function We(e){return console.warn("useStripe() is deprecated. Use useHyper() instead"),o.useContext(g)}function qe(e){return o.useContext(S)}function $e(e){return console.warn("useElements() is deprecated. Use useWidgets() instead"),o.useContext(S)}function O(e){var n=e.id,r=e.options,i=e.onChange,t=e.onReady,u=e.componentType,c=e.onFocus,a=e.onBlur,s=e.onClick,l=n!==void 0?n:"payment-Element",f=o.useContext(g),v=o.useContext(S),_=o.useRef(null),m=p(v.create,u,r);return o.useEffect(function(){var y=p(v.create,u,r);d(y.mount,"#orca-elements-payment-element-"+l)},[_,v]),o.useEffect(function(){p(m.on,"ready",t),p(m.on,"focus",c),p(m.on,"blur",a),p(m.on,"clickTriggered",s),p(m.on,"change",i)},[v,f]),o.createElement("div",{ref:_,id:"orca-elements-payment-element-"+l})}function ne(e){var n=e.id,r=e.options,i=e.onChange,t=e.onReady,u=e.onFocus,c=e.onBlur,a=e.onClick;return o.createElement(O,{id:n,options:r,onChange:i,onReady:t,componentType:"payment",onFocus:u,onBlur:c,onClick:a})}function te(e){var n=e.id,r=e.options,i=e.onChange,t=e.onReady,u=e.onFocus,c=e.onBlur,a=e.onClick;return o.createElement(O,{id:n,options:r,onChange:i,onReady:t,componentType:"card",onFocus:u,onBlur:c,onClick:a})}function re(e){var n=e.id,r=e.options,i=e.onChange,t=e.onReady,u=e.onFocus,c=e.onBlur,a=e.onClick;return o.createElement(O,{id:n,options:r,onChange:i,onReady:t,componentType:"cardNumber",onFocus:u,onBlur:c,onClick:a})}function ue(e){var n=e.id,r=e.options,i=e.onChange,t=e.onReady,u=e.onFocus,c=e.onBlur,a=e.onClick;return o.createElement(O,{id:n,options:r,onChange:i,onReady:t,componentType:"cardCvc",onFocus:u,onBlur:c,onClick:a})}function ie(e){var n=e.id,r=e.options,i=e.onChange,t=e.onReady,u=e.onFocus,c=e.onBlur,a=e.onClick;return o.createElement(O,{id:n,options:r,onChange:i,onReady:t,componentType:"cardExpiry",onFocus:u,onBlur:c,onClick:a})}var Ge=De,He=Ue,Xe=ne,je=ne,ze=te,Le=te,Ke=re,Qe=re,Ye=ie,Ze=ie,en=ue,nn=ue;export{en as CardCVCElement,nn as CardCVCWidget,ze as CardElement,Ye as CardExpiryElement,Ze as CardExpiryWidget,Ke as CardNumberElement,Qe as CardNumberWidget,Le as CardWidget,Ge as Elements,He as HyperElements,Xe as PaymentElement,je as UnifiedCheckout,$e as useElements,Me as useHyper,We as useStripe,qe as useWidgets};
|
package/package.json
CHANGED
package/src/Index.bs.js
CHANGED
|
@@ -61,6 +61,62 @@ function Index$Elements2(Props) {
|
|
|
61
61
|
return React.createElement(Context.SwitchContextProvider.make, Context.SwitchContextProvider.makeProps(match[0], React.createElement(Context.ElementsContextProvider.make, Context.ElementsContextProvider.makeProps(match$1[0], children, undefined)), undefined));
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
function Index$HyperElements2(Props) {
|
|
65
|
+
var children = Props.children;
|
|
66
|
+
var hyper = Props.hyper;
|
|
67
|
+
var options = Props.options;
|
|
68
|
+
var elementOptions = Context.elementsOptionObjMapper(options);
|
|
69
|
+
var match = React.useState(function () {
|
|
70
|
+
return Context.defaultSwitchContext;
|
|
71
|
+
});
|
|
72
|
+
var setSwitchState = match[1];
|
|
73
|
+
var match$1 = React.useState(function () {
|
|
74
|
+
return Context.defaultElementsContext;
|
|
75
|
+
});
|
|
76
|
+
var setElementsState = match$1[1];
|
|
77
|
+
React.useEffect((function () {
|
|
78
|
+
Js_promise.then_((function (switchInstance) {
|
|
79
|
+
var orcaElementsConfig = Curry._1(switchInstance.elements, options);
|
|
80
|
+
var newElemValues_update = orcaElementsConfig.update;
|
|
81
|
+
var newElemValues_getElement = orcaElementsConfig.getElement;
|
|
82
|
+
var newElemValues_fetchUpdates = orcaElementsConfig.fetchUpdates;
|
|
83
|
+
var newElemValues_create = orcaElementsConfig.create;
|
|
84
|
+
var newElemValues = {
|
|
85
|
+
options: elementOptions,
|
|
86
|
+
update: newElemValues_update,
|
|
87
|
+
getElement: newElemValues_getElement,
|
|
88
|
+
fetchUpdates: newElemValues_fetchUpdates,
|
|
89
|
+
create: newElemValues_create
|
|
90
|
+
};
|
|
91
|
+
var newSwitchVal_clientSecret = elementOptions.clientSecret;
|
|
92
|
+
var newSwitchVal_confirmPayment = switchInstance.confirmPayment;
|
|
93
|
+
var newSwitchVal_confirmCardPayment = switchInstance.confirmCardPayment;
|
|
94
|
+
var newSwitchVal_retrievePaymentIntent = switchInstance.retrievePaymentIntent;
|
|
95
|
+
var newSwitchVal_paymentRequest = switchInstance.paymentRequest;
|
|
96
|
+
var switchValClone_clientSecret = elementOptions.clientSecret;
|
|
97
|
+
var switchValClone_confirmPayment = newSwitchVal_confirmPayment;
|
|
98
|
+
var switchValClone_confirmCardPayment = newSwitchVal_confirmCardPayment;
|
|
99
|
+
var switchValClone_retrievePaymentIntent = newSwitchVal_retrievePaymentIntent;
|
|
100
|
+
var switchValClone_paymentRequest = newSwitchVal_paymentRequest;
|
|
101
|
+
var switchValClone = {
|
|
102
|
+
clientSecret: switchValClone_clientSecret,
|
|
103
|
+
confirmPayment: switchValClone_confirmPayment,
|
|
104
|
+
confirmCardPayment: switchValClone_confirmCardPayment,
|
|
105
|
+
retrievePaymentIntent: switchValClone_retrievePaymentIntent,
|
|
106
|
+
paymentRequest: switchValClone_paymentRequest
|
|
107
|
+
};
|
|
108
|
+
Curry._1(setSwitchState, (function (param) {
|
|
109
|
+
return switchValClone;
|
|
110
|
+
}));
|
|
111
|
+
Curry._1(setElementsState, (function (param) {
|
|
112
|
+
return newElemValues;
|
|
113
|
+
}));
|
|
114
|
+
return Promise.resolve(switchValClone);
|
|
115
|
+
}), hyper);
|
|
116
|
+
}), []);
|
|
117
|
+
return React.createElement(Context.SwitchContextProvider.make, Context.SwitchContextProvider.makeProps(match[0], React.createElement(Context.ElementsContextProvider.make, Context.ElementsContextProvider.makeProps(match$1[0], children, undefined)), undefined));
|
|
118
|
+
}
|
|
119
|
+
|
|
64
120
|
function useHyper(param) {
|
|
65
121
|
return React.useContext(Context.switchContext);
|
|
66
122
|
}
|
|
@@ -169,7 +225,7 @@ function Index$CardNumber2(Props) {
|
|
|
169
225
|
options: options,
|
|
170
226
|
onChange: onChange,
|
|
171
227
|
onReady: onReady,
|
|
172
|
-
componentType: "
|
|
228
|
+
componentType: "cardNumber",
|
|
173
229
|
onFocus: onFocus,
|
|
174
230
|
onBlur: onBlur,
|
|
175
231
|
onClick: onClick
|
|
@@ -189,7 +245,7 @@ function Index$CardCVC2(Props) {
|
|
|
189
245
|
options: options,
|
|
190
246
|
onChange: onChange,
|
|
191
247
|
onReady: onReady,
|
|
192
|
-
componentType: "
|
|
248
|
+
componentType: "cardCvc",
|
|
193
249
|
onFocus: onFocus,
|
|
194
250
|
onBlur: onBlur,
|
|
195
251
|
onClick: onClick
|
|
@@ -209,7 +265,7 @@ function Index$CardExpiry2(Props) {
|
|
|
209
265
|
options: options,
|
|
210
266
|
onChange: onChange,
|
|
211
267
|
onReady: onReady,
|
|
212
|
-
componentType: "
|
|
268
|
+
componentType: "cardExpiry",
|
|
213
269
|
onFocus: onFocus,
|
|
214
270
|
onBlur: onBlur,
|
|
215
271
|
onClick: onClick
|
|
@@ -218,23 +274,41 @@ function Index$CardExpiry2(Props) {
|
|
|
218
274
|
|
|
219
275
|
var Elements = Index$Elements2;
|
|
220
276
|
|
|
277
|
+
var HyperElements = Index$HyperElements2;
|
|
278
|
+
|
|
221
279
|
var PaymentElement = Index$PaymentElement2;
|
|
222
280
|
|
|
281
|
+
var UnifiedCheckout = Index$PaymentElement2;
|
|
282
|
+
|
|
223
283
|
var CardElement = Index$CardElement2;
|
|
224
284
|
|
|
285
|
+
var CardWidget = Index$CardElement2;
|
|
286
|
+
|
|
225
287
|
var CardNumberElement = Index$CardNumber2;
|
|
226
288
|
|
|
289
|
+
var CardNumberWidget = Index$CardNumber2;
|
|
290
|
+
|
|
227
291
|
var CardExpiryElement = Index$CardExpiry2;
|
|
228
292
|
|
|
293
|
+
var CardExpiryWidget = Index$CardExpiry2;
|
|
294
|
+
|
|
229
295
|
var CardCVCElement = Index$CardCVC2;
|
|
230
296
|
|
|
297
|
+
var CardCVCWidget = Index$CardCVC2;
|
|
298
|
+
|
|
231
299
|
export {
|
|
232
300
|
Elements ,
|
|
301
|
+
HyperElements ,
|
|
233
302
|
PaymentElement ,
|
|
303
|
+
UnifiedCheckout ,
|
|
234
304
|
CardElement ,
|
|
305
|
+
CardWidget ,
|
|
235
306
|
CardNumberElement ,
|
|
307
|
+
CardNumberWidget ,
|
|
236
308
|
CardExpiryElement ,
|
|
309
|
+
CardExpiryWidget ,
|
|
237
310
|
CardCVCElement ,
|
|
311
|
+
CardCVCWidget ,
|
|
238
312
|
useStripe ,
|
|
239
313
|
useHyper ,
|
|
240
314
|
useElements ,
|
package/src/Index.res
CHANGED
|
@@ -49,8 +49,51 @@ module Elements2 = {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
module HyperElements2 = {
|
|
53
|
+
@react.component
|
|
54
|
+
let make = (~children, ~hyper: Js.Promise.t<OrcaJs.switchInstance>, ~options: Js.Json.t) => {
|
|
55
|
+
let elementOptions = options->Context.elementsOptionObjMapper
|
|
56
|
+
let (switchState, setSwitchState) = React.useState(() => Context.defaultSwitchContext)
|
|
57
|
+
let (elementsState, setElementsState) = React.useState(() => Context.defaultElementsContext)
|
|
58
|
+
|
|
59
|
+
React.useEffect0(() => {
|
|
60
|
+
hyper->Js.Promise.then_((switchInstance: OrcaJs.switchInstance) => {
|
|
61
|
+
let orcaElementsConfig = switchInstance.elements(options)
|
|
62
|
+
let newElemValues: Context.elementsType = {
|
|
63
|
+
options: elementOptions,
|
|
64
|
+
update: orcaElementsConfig.update,
|
|
65
|
+
getElement: orcaElementsConfig.getElement,
|
|
66
|
+
fetchUpdates: orcaElementsConfig.fetchUpdates,
|
|
67
|
+
create: orcaElementsConfig.create,
|
|
68
|
+
}
|
|
69
|
+
let newSwitchVal: Context.switchContextType = {
|
|
70
|
+
confirmPayment: switchInstance.confirmPayment,
|
|
71
|
+
confirmCardPayment: switchInstance.confirmCardPayment,
|
|
72
|
+
retrievePaymentIntent: switchInstance.retrievePaymentIntent,
|
|
73
|
+
clientSecret: elementOptions.clientSecret,
|
|
74
|
+
paymentRequest: switchInstance.paymentRequest,
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let switchValClone = {...newSwitchVal, clientSecret: elementOptions.clientSecret}
|
|
78
|
+
setSwitchState(_ => switchValClone)
|
|
79
|
+
setElementsState(_ => newElemValues)
|
|
80
|
+
Js.Promise.resolve(switchValClone)
|
|
81
|
+
}, _)->ignore
|
|
82
|
+
None
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
<Context.SwitchContextProvider value={switchState}>
|
|
86
|
+
<Context.ElementsContextProvider value={elementsState}>
|
|
87
|
+
{children}
|
|
88
|
+
</Context.ElementsContextProvider>
|
|
89
|
+
</Context.SwitchContextProvider>
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
52
93
|
let \"Elements" = Elements2.make
|
|
53
94
|
|
|
95
|
+
let \"HyperElements" = HyperElements2.make
|
|
96
|
+
|
|
54
97
|
let useHyper = () => {
|
|
55
98
|
React.useContext(Context.switchContext)
|
|
56
99
|
}
|
|
@@ -114,6 +157,8 @@ module PaymentElement2 = {
|
|
|
114
157
|
}
|
|
115
158
|
let \"PaymentElement" = PaymentElement2.make
|
|
116
159
|
|
|
160
|
+
let \"UnifiedCheckout" = PaymentElement2.make
|
|
161
|
+
|
|
117
162
|
module CardElement2 = {
|
|
118
163
|
@react.component
|
|
119
164
|
let make = (~id, ~options: Js.Json.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
|
|
@@ -124,32 +169,41 @@ module CardElement2 = {
|
|
|
124
169
|
}
|
|
125
170
|
let \"CardElement" = CardElement2.make
|
|
126
171
|
|
|
172
|
+
let \"CardWidget" = CardElement2.make
|
|
173
|
+
|
|
127
174
|
module CardNumber2 = {
|
|
128
175
|
@react.component
|
|
129
176
|
let make = (~id, ~options: Js.Json.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
|
|
130
177
|
<PaymentElementsWrapper
|
|
131
|
-
id options onChange onReady onFocus onBlur onClick componentType="
|
|
178
|
+
id options onChange onReady onFocus onBlur onClick componentType="cardNumber"
|
|
132
179
|
/>
|
|
133
180
|
}
|
|
134
181
|
}
|
|
135
182
|
let \"CardNumberElement" = CardNumber2.make
|
|
136
183
|
|
|
184
|
+
let \"CardNumberWidget" = CardNumber2.make
|
|
185
|
+
|
|
137
186
|
module CardCVC2 = {
|
|
138
187
|
@react.component
|
|
139
188
|
let make = (~id, ~options: Js.Json.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
|
|
140
189
|
<PaymentElementsWrapper
|
|
141
|
-
id options onChange onReady onFocus onBlur onClick componentType="
|
|
190
|
+
id options onChange onReady onFocus onBlur onClick componentType="cardCvc"
|
|
142
191
|
/>
|
|
143
192
|
}
|
|
144
193
|
}
|
|
145
194
|
let \"CardCVCElement" = CardCVC2.make
|
|
146
195
|
|
|
196
|
+
let \"CardCVCWidget" = CardCVC2.make
|
|
197
|
+
|
|
147
198
|
module CardExpiry2 = {
|
|
148
199
|
@react.component
|
|
149
200
|
let make = (~id, ~options: Js.Json.t, ~onChange, ~onReady, ~onFocus, ~onBlur, ~onClick) => {
|
|
150
201
|
<PaymentElementsWrapper
|
|
151
|
-
id options onChange onReady onFocus onBlur onClick componentType="
|
|
202
|
+
id options onChange onReady onFocus onBlur onClick componentType="cardExpiry"
|
|
152
203
|
/>
|
|
153
204
|
}
|
|
154
205
|
}
|
|
155
206
|
let \"CardExpiryElement" = CardExpiry2.make
|
|
207
|
+
|
|
208
|
+
let \"CardExpiryWidget" = CardExpiry2.make
|
|
209
|
+
|
package/src/Index.resi
CHANGED
|
@@ -14,6 +14,12 @@ let \"Elements": {
|
|
|
14
14
|
"stripe": Js.Promise.t<OrcaJs.switchInstance>,
|
|
15
15
|
} => React.element
|
|
16
16
|
|
|
17
|
+
let \"HyperElements": {
|
|
18
|
+
"children": React.element,
|
|
19
|
+
"options": Js.Json.t,
|
|
20
|
+
"hyper": Js.Promise.t<OrcaJs.switchInstance>,
|
|
21
|
+
} => React.element
|
|
22
|
+
|
|
17
23
|
let \"PaymentElement": {
|
|
18
24
|
"id": string,
|
|
19
25
|
"onBlur": option<option<Js.Json.t> => unit>,
|
|
@@ -24,6 +30,17 @@ let \"PaymentElement": {
|
|
|
24
30
|
"options": Js.Json.t,
|
|
25
31
|
} => React.element
|
|
26
32
|
|
|
33
|
+
|
|
34
|
+
let \"UnifiedCheckout": {
|
|
35
|
+
"id": string,
|
|
36
|
+
"onBlur": option<option<Js.Json.t> => unit>,
|
|
37
|
+
"onChange": option<option<Js.Json.t> => unit>,
|
|
38
|
+
"onClick": option<option<Js.Json.t> => unit>,
|
|
39
|
+
"onFocus": option<option<Js.Json.t> => unit>,
|
|
40
|
+
"onReady": option<option<Js.Json.t> => unit>,
|
|
41
|
+
"options": Js.Json.t,
|
|
42
|
+
} => React.element
|
|
43
|
+
|
|
27
44
|
let \"CardElement": {
|
|
28
45
|
"id": string,
|
|
29
46
|
"onBlur": option<option<Js.Json.t> => unit>,
|
|
@@ -34,6 +51,16 @@ let \"CardElement": {
|
|
|
34
51
|
"options": Js.Json.t,
|
|
35
52
|
} => React.element
|
|
36
53
|
|
|
54
|
+
let \"CardWidget": {
|
|
55
|
+
"id": string,
|
|
56
|
+
"onBlur": option<option<Js.Json.t> => unit>,
|
|
57
|
+
"onChange": option<option<Js.Json.t> => unit>,
|
|
58
|
+
"onClick": option<option<Js.Json.t> => unit>,
|
|
59
|
+
"onFocus": option<option<Js.Json.t> => unit>,
|
|
60
|
+
"onReady": option<option<Js.Json.t> => unit>,
|
|
61
|
+
"options": Js.Json.t,
|
|
62
|
+
} => React.element
|
|
63
|
+
|
|
37
64
|
let \"CardNumberElement": {
|
|
38
65
|
"id": string,
|
|
39
66
|
"onBlur": option<option<Js.Json.t> => unit>,
|
|
@@ -44,6 +71,16 @@ let \"CardNumberElement": {
|
|
|
44
71
|
"options": Js.Json.t,
|
|
45
72
|
} => React.element
|
|
46
73
|
|
|
74
|
+
let \"CardNumberWidget": {
|
|
75
|
+
"id": string,
|
|
76
|
+
"onBlur": option<option<Js.Json.t> => unit>,
|
|
77
|
+
"onChange": option<option<Js.Json.t> => unit>,
|
|
78
|
+
"onClick": option<option<Js.Json.t> => unit>,
|
|
79
|
+
"onFocus": option<option<Js.Json.t> => unit>,
|
|
80
|
+
"onReady": option<option<Js.Json.t> => unit>,
|
|
81
|
+
"options": Js.Json.t,
|
|
82
|
+
} => React.element
|
|
83
|
+
|
|
47
84
|
let \"CardExpiryElement": {
|
|
48
85
|
"id": string,
|
|
49
86
|
"onBlur": option<option<Js.Json.t> => unit>,
|
|
@@ -54,6 +91,16 @@ let \"CardExpiryElement": {
|
|
|
54
91
|
"options": Js.Json.t,
|
|
55
92
|
} => React.element
|
|
56
93
|
|
|
94
|
+
let \"CardExpiryWidget": {
|
|
95
|
+
"id": string,
|
|
96
|
+
"onBlur": option<option<Js.Json.t> => unit>,
|
|
97
|
+
"onChange": option<option<Js.Json.t> => unit>,
|
|
98
|
+
"onClick": option<option<Js.Json.t> => unit>,
|
|
99
|
+
"onFocus": option<option<Js.Json.t> => unit>,
|
|
100
|
+
"onReady": option<option<Js.Json.t> => unit>,
|
|
101
|
+
"options": Js.Json.t,
|
|
102
|
+
} => React.element
|
|
103
|
+
|
|
57
104
|
let \"CardCVCElement": {
|
|
58
105
|
"id": string,
|
|
59
106
|
"onBlur": option<option<Js.Json.t> => unit>,
|
|
@@ -64,6 +111,16 @@ let \"CardCVCElement": {
|
|
|
64
111
|
"options": Js.Json.t,
|
|
65
112
|
} => React.element
|
|
66
113
|
|
|
114
|
+
let \"CardCVCWidget": {
|
|
115
|
+
"id": string,
|
|
116
|
+
"onBlur": option<option<Js.Json.t> => unit>,
|
|
117
|
+
"onChange": option<option<Js.Json.t> => unit>,
|
|
118
|
+
"onClick": option<option<Js.Json.t> => unit>,
|
|
119
|
+
"onFocus": option<option<Js.Json.t> => unit>,
|
|
120
|
+
"onReady": option<option<Js.Json.t> => unit>,
|
|
121
|
+
"options": Js.Json.t,
|
|
122
|
+
} => React.element
|
|
123
|
+
|
|
67
124
|
let useStripe: unit => Context.switchContextType
|
|
68
125
|
|
|
69
126
|
let useHyper: unit => Context.switchContextType
|