@traund/orquezta-widget-calculator 1.0.3 → 1.0.5
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/dist/index.js +23 -17
- package/dist/index.js.map +1 -1
- package/dist/module.js +23 -17
- package/dist/module.js.map +1 -1
- package/package.json +1 -1
- package/src/calculatorV2.js +8 -4
- package/src/core/endpoints.js +1 -1
- package/src/core/signature.js +1 -2
- package/src/index.js +2 -0
- package/src/simulator.js +3 -3
- package/src/utils/calculateHelper.js +3 -2
- package/src/utils/operationsHelper.js +5 -4
- package/src/utils/rateHelper.js +1 -1
package/dist/index.js
CHANGED
|
@@ -2337,7 +2337,7 @@ var $3641e36ddb9c1c48$export$2e2bcd8739ae039 = $3641e36ddb9c1c48$var$Timer;
|
|
|
2337
2337
|
class $df8d2892fe6558f0$var$EndPoints {
|
|
2338
2338
|
constructor(testMode = 'production', externalConfig = null){
|
|
2339
2339
|
this._testMode = testMode;
|
|
2340
|
-
this.baseUrl = externalConfig
|
|
2340
|
+
this.baseUrl = externalConfig?.backendUrl;
|
|
2341
2341
|
this.path_managment_operations = `${this.baseUrl}/handle-operations`;
|
|
2342
2342
|
}
|
|
2343
2343
|
get CALLBACK() {
|
|
@@ -2477,9 +2477,8 @@ function $7960feb2a8e3e0c6$export$2afc3ae66aac801c(secretKey, params) {
|
|
|
2477
2477
|
timestamp: timestamp
|
|
2478
2478
|
};
|
|
2479
2479
|
}
|
|
2480
|
-
function $7960feb2a8e3e0c6$export$3db7bf9691bf4b62(method, url, body = null, apikey = null) {
|
|
2480
|
+
function $7960feb2a8e3e0c6$export$3db7bf9691bf4b62(method, url, body = null, apikey = null, secretKey = null) {
|
|
2481
2481
|
const referenceApiKey = apikey;
|
|
2482
|
-
const secretKey = process.env.NEXT_PUBLIC_STAGING_APIKEY;
|
|
2483
2482
|
const signatureParams = {
|
|
2484
2483
|
method: method,
|
|
2485
2484
|
url: url,
|
|
@@ -2546,6 +2545,7 @@ class $c530beedeaeedc25$var$Calculator extends (0, $gXNCa$react.Component) {
|
|
|
2546
2545
|
isCountryFromPayPal: false,
|
|
2547
2546
|
onlySimulation: this.props.onlySimulation,
|
|
2548
2547
|
reference: this.props.reference,
|
|
2548
|
+
secretKey: this.props.secretKey,
|
|
2549
2549
|
taxSender: 0.00,
|
|
2550
2550
|
taxReceiver: 0.00
|
|
2551
2551
|
};
|
|
@@ -2783,7 +2783,8 @@ class $c530beedeaeedc25$var$Calculator extends (0, $gXNCa$react.Component) {
|
|
|
2783
2783
|
sell: 0
|
|
2784
2784
|
};
|
|
2785
2785
|
}
|
|
2786
|
-
if (usdRate
|
|
2786
|
+
if (usdRate && typeof usdRate.result === "number") rates[c].buy = rates[c].sell = parseFloat(c == "SV" ? usdRate.result : usdRate.result.toFixed(2));
|
|
2787
|
+
else rates[c].buy = rates[c].sell = 1;
|
|
2787
2788
|
if (body[country].countryTo[c]) {
|
|
2788
2789
|
body[country].countryTo[c].usdBuy = rates[c].buy;
|
|
2789
2790
|
body[country].countryTo[c].usdSell = rates[c].sell;
|
|
@@ -3027,6 +3028,7 @@ class $c530beedeaeedc25$var$Calculator extends (0, $gXNCa$react.Component) {
|
|
|
3027
3028
|
couponValue: this.state.couponValue,
|
|
3028
3029
|
couponRedeemed: false,
|
|
3029
3030
|
reference: this.state.reference,
|
|
3031
|
+
secretKey: this.state.secretKey,
|
|
3030
3032
|
plus: 0
|
|
3031
3033
|
});
|
|
3032
3034
|
if (this.state.recalc) clearTimeout(this.state.recalc);
|
|
@@ -3048,7 +3050,7 @@ class $c530beedeaeedc25$var$Calculator extends (0, $gXNCa$react.Component) {
|
|
|
3048
3050
|
const url = this.ENDPOINTS.OPERATIONS.calculate(this.state.storeId || sessionStorage.getItem('storeId'), "from");
|
|
3049
3051
|
const res = await (0, ($parcel$interopDefault($gXNCa$axios))).post(url, model, {
|
|
3050
3052
|
headers: {
|
|
3051
|
-
"x-api-access-sig": (0, $7960feb2a8e3e0c6$export$3db7bf9691bf4b62)('POST', url, model, this.state.reference)
|
|
3053
|
+
"x-api-access-sig": (0, $7960feb2a8e3e0c6$export$3db7bf9691bf4b62)('POST', url, model, this.state.reference, this.state.secretKey)
|
|
3052
3054
|
}
|
|
3053
3055
|
});
|
|
3054
3056
|
if (res) await this.setState({
|
|
@@ -3089,7 +3091,7 @@ class $c530beedeaeedc25$var$Calculator extends (0, $gXNCa$react.Component) {
|
|
|
3089
3091
|
const url = this.ENDPOINTS.OPERATIONS.calculate(this.state.storeId, source);
|
|
3090
3092
|
const res = await (0, ($parcel$interopDefault($gXNCa$axios))).post(url, model, {
|
|
3091
3093
|
headers: {
|
|
3092
|
-
"x-api-access-sig": (0, $7960feb2a8e3e0c6$export$3db7bf9691bf4b62)('POST', url, model, this.state.reference)
|
|
3094
|
+
"x-api-access-sig": (0, $7960feb2a8e3e0c6$export$3db7bf9691bf4b62)('POST', url, model, this.state.reference, this.state.secretKey)
|
|
3093
3095
|
}
|
|
3094
3096
|
});
|
|
3095
3097
|
if (res) await this.setState({
|
|
@@ -3325,7 +3327,7 @@ class $c530beedeaeedc25$var$Calculator extends (0, $gXNCa$react.Component) {
|
|
|
3325
3327
|
try {
|
|
3326
3328
|
const response = await (0, ($parcel$interopDefault($gXNCa$axios))).get(url, {
|
|
3327
3329
|
headers: {
|
|
3328
|
-
"x-api-access-sig": (0, $7960feb2a8e3e0c6$export$3db7bf9691bf4b62)('GET', url, null, this.state.reference)
|
|
3330
|
+
"x-api-access-sig": (0, $7960feb2a8e3e0c6$export$3db7bf9691bf4b62)('GET', url, null, this.state.reference, this.state.secretKey)
|
|
3329
3331
|
}
|
|
3330
3332
|
});
|
|
3331
3333
|
return response;
|
|
@@ -4817,7 +4819,7 @@ var $038472bfc14c3e81$export$2e2bcd8739ae039 = $038472bfc14c3e81$var$TransferUse
|
|
|
4817
4819
|
|
|
4818
4820
|
class $6e789b3bd17f4496$var$RateHelper {
|
|
4819
4821
|
constructor(testMode = 'production', externalConfig = null){
|
|
4820
|
-
this.endpoints = new (0, $df8d2892fe6558f0$export$2e2bcd8739ae039)(testMode, externalConfig
|
|
4822
|
+
this.endpoints = new (0, $df8d2892fe6558f0$export$2e2bcd8739ae039)(testMode, externalConfig);
|
|
4821
4823
|
}
|
|
4822
4824
|
async getExchangeRate(currencyFrom, currencyTo) {
|
|
4823
4825
|
try {
|
|
@@ -4850,11 +4852,12 @@ var $6e789b3bd17f4496$export$2e2bcd8739ae039 = $6e789b3bd17f4496$var$RateHelper;
|
|
|
4850
4852
|
|
|
4851
4853
|
|
|
4852
4854
|
class $fe71048abacacae0$var$CalculateHelper {
|
|
4853
|
-
constructor(testMode = 'production'){
|
|
4855
|
+
constructor(testMode = 'production', config = null){
|
|
4854
4856
|
this._testMode = testMode;
|
|
4857
|
+
this.config = config;
|
|
4855
4858
|
}
|
|
4856
4859
|
async getCaculateRates(countriesData) {
|
|
4857
|
-
const rateHelper = new (0, $6e789b3bd17f4496$export$2e2bcd8739ae039)(this._testMode);
|
|
4860
|
+
const rateHelper = new (0, $6e789b3bd17f4496$export$2e2bcd8739ae039)(this._testMode, this.config);
|
|
4858
4861
|
const middleCurrency = "USD";
|
|
4859
4862
|
for(var key in countriesData)if (countriesData.hasOwnProperty(key)) {
|
|
4860
4863
|
let itemCountry = countriesData[key];
|
|
@@ -5418,9 +5421,10 @@ function $5d6e781e59e50d37$export$354ffc3468f9d23e(calculateType, day) {
|
|
|
5418
5421
|
|
|
5419
5422
|
|
|
5420
5423
|
class $c0c7909cfff012a2$var$OperationsHelper {
|
|
5421
|
-
constructor(testMode = 'production',
|
|
5422
|
-
this.endpoints = new (0, $df8d2892fe6558f0$export$2e2bcd8739ae039)(testMode, config
|
|
5423
|
-
this.reference =
|
|
5424
|
+
constructor(testMode = 'production', apiKey = null, config = null, secretKey = null){
|
|
5425
|
+
this.endpoints = new (0, $df8d2892fe6558f0$export$2e2bcd8739ae039)(testMode, config);
|
|
5426
|
+
this.reference = apiKey;
|
|
5427
|
+
this.secretKey = secretKey;
|
|
5424
5428
|
this.FEES = {
|
|
5425
5429
|
"ach": {
|
|
5426
5430
|
type: "A",
|
|
@@ -5448,7 +5452,7 @@ class $c0c7909cfff012a2$var$OperationsHelper {
|
|
|
5448
5452
|
const url = this.endpoints.OPERATIONS.calculate(storeId, source);
|
|
5449
5453
|
return await (0, ($parcel$interopDefault($gXNCa$axios))).post(url, body, {
|
|
5450
5454
|
headers: {
|
|
5451
|
-
"x-api-access-sig": (0, $7960feb2a8e3e0c6$export$3db7bf9691bf4b62)('POST', url, body, this.reference)
|
|
5455
|
+
"x-api-access-sig": (0, $7960feb2a8e3e0c6$export$3db7bf9691bf4b62)('POST', url, body, this.reference, this.secretKey)
|
|
5452
5456
|
}
|
|
5453
5457
|
});
|
|
5454
5458
|
}
|
|
@@ -7030,9 +7034,9 @@ function $d3c2b8c012a239f6$var$Simulator(props) {
|
|
|
7030
7034
|
*/ const { locale: locale, pathname: pathname, locales: locales } = props;
|
|
7031
7035
|
const content = locale === "es" ? (0, $6741b883ab744742$export$2e2bcd8739ae039) : (0, $d439b0ecd58343d0$export$2e2bcd8739ae039);
|
|
7032
7036
|
const classes = $d3c2b8c012a239f6$var$useStyles();
|
|
7033
|
-
const __ENDPOINTS = new (0, $df8d2892fe6558f0$export$2e2bcd8739ae039)(props.testMode, props.config
|
|
7034
|
-
const __calculateHelper = new (0, $fe71048abacacae0$export$2e2bcd8739ae039)(props.testMode);
|
|
7035
|
-
const __operationsHelper = new (0, $c0c7909cfff012a2$export$2e2bcd8739ae039)(props.testMode, props.reference);
|
|
7037
|
+
const __ENDPOINTS = new (0, $df8d2892fe6558f0$export$2e2bcd8739ae039)(props.testMode, props.config);
|
|
7038
|
+
const __calculateHelper = new (0, $fe71048abacacae0$export$2e2bcd8739ae039)(props.testMode, props.config);
|
|
7039
|
+
const __operationsHelper = new (0, $c0c7909cfff012a2$export$2e2bcd8739ae039)(props.testMode, props.reference, props.config, props.secretKey);
|
|
7036
7040
|
const __firebase = (0, $9a120cc4db7b0570$export$2e2bcd8739ae039)(props.testMode, props.config);
|
|
7037
7041
|
const [simulatorMode, setSimulatorMode] = (0, $gXNCa$react.useState)((0, $ee1f0011b010ab9b$export$e3d7a3ffb08d3f7a).SEND);
|
|
7038
7042
|
const [suscribedGlobalOptions, setSuscribedGlobalOptions] = (0, $gXNCa$react.useState)(false);
|
|
@@ -7969,6 +7973,7 @@ function $4fa36e821943b400$export$d75554d0168fcedc(props) {
|
|
|
7969
7973
|
onlyView: props.onlyView ?? false,
|
|
7970
7974
|
initialCountryTo: props.initialCountryTo ?? "PE-USD",
|
|
7971
7975
|
reference: props.reference || "",
|
|
7976
|
+
secretKey: props.secretKey || "",
|
|
7972
7977
|
config: props.config
|
|
7973
7978
|
});
|
|
7974
7979
|
}
|
|
@@ -7980,6 +7985,7 @@ function $4fa36e821943b400$export$896df779a8e2818(props) {
|
|
|
7980
7985
|
couponCode: props.couponCode || "",
|
|
7981
7986
|
onlySimulation: props.onlySimulation ?? false,
|
|
7982
7987
|
reference: props.reference || "",
|
|
7988
|
+
secretKey: props.secretKey || "",
|
|
7983
7989
|
config: props.config
|
|
7984
7990
|
});
|
|
7985
7991
|
}
|