-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathHyperManagementElements.bs.js
More file actions
78 lines (74 loc) · 4.33 KB
/
Copy pathHyperManagementElements.bs.js
File metadata and controls
78 lines (74 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Generated by ReScript, PLEASE EDIT WITH CARE
import * as React from "react";
import * as Context from "../Context.bs.js";
import * as Js_promise from "rescript/lib/es6/js_promise.js";
import * as JsxRuntime from "react/jsx-runtime";
function HyperManagementElements(props) {
var options = props.options;
var hyper = props.hyper;
var paymentMethodsManagementElementOptions = Context.paymentMethodsManagementElementsOptionObjMapper(options);
var match = React.useState(function () {
return Context.defaultSwitchContext;
});
var setSwitchState = match[1];
var match$1 = React.useState(function () {
return Context.defaultPaymentMethodsManagementElementsContext;
});
var setElementsState = match$1[1];
React.useEffect((function () {
((function (__x) {
return Js_promise.then_((function (switchInstance) {
var orcaElementsConfig = switchInstance.paymentMethodsManagementElements(options);
var newElemValues_update = orcaElementsConfig.update;
var newElemValues_getElement = orcaElementsConfig.getElement;
var newElemValues_fetchUpdates = orcaElementsConfig.fetchUpdates;
var newElemValues_create = orcaElementsConfig.create;
var newElemValues = {
options: paymentMethodsManagementElementOptions,
update: newElemValues_update,
getElement: newElemValues_getElement,
fetchUpdates: newElemValues_fetchUpdates,
create: newElemValues_create
};
var switchValClone_confirmPayment = switchInstance.confirmPayment;
var switchValClone_confirmCardPayment = switchInstance.confirmCardPayment;
var switchValClone_retrievePaymentIntent = switchInstance.retrievePaymentIntent;
var switchValClone_paymentRequest = switchInstance.paymentRequest;
var switchValClone_initPaymentSession = switchInstance.initPaymentSession;
var switchValClone_completeUpdateIntent = switchInstance.completeUpdateIntent;
var switchValClone_initiateUpdateIntent = switchInstance.initiateUpdateIntent;
var switchValClone_confirmTokenization = switchInstance.confirmTokenization;
var switchValClone = {
clientSecret: "",
confirmPayment: switchValClone_confirmPayment,
confirmCardPayment: switchValClone_confirmCardPayment,
retrievePaymentIntent: switchValClone_retrievePaymentIntent,
paymentRequest: switchValClone_paymentRequest,
initPaymentSession: switchValClone_initPaymentSession,
completeUpdateIntent: switchValClone_completeUpdateIntent,
initiateUpdateIntent: switchValClone_initiateUpdateIntent,
confirmTokenization: switchValClone_confirmTokenization
};
setSwitchState(function (param) {
return switchValClone;
});
setElementsState(function (param) {
return newElemValues;
});
return Promise.resolve(switchValClone);
}), __x);
})(hyper));
}), []);
return JsxRuntime.jsx(Context.PaymentMethodsManagementSwitchContextProvider.make, {
value: match[0],
children: JsxRuntime.jsx(Context.PaymentMethodsManagementElementsContextProvider.make, {
value: match$1[0],
children: props.children
})
});
}
var make = HyperManagementElements;
export {
make ,
}
/* react Not a pure module */