ng-easycommerce 0.0.593 → 0.0.594
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/README.md +2 -0
- package/bundles/ng-easycommerce.umd.js +6 -8
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/services/checkout/checkout.service.js +8 -10
- package/esm2015/lib/services/ip-address.service.js +2 -2
- package/esm5/lib/services/checkout/checkout.service.js +8 -10
- package/esm5/lib/services/ip-address.service.js +2 -2
- package/fesm2015/ng-easycommerce.js +6 -8
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +6 -8
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3346,7 +3346,7 @@
|
|
|
3346
3346
|
function IpService(http) {
|
|
3347
3347
|
this.http = http;
|
|
3348
3348
|
this.apiGetIp = 'https://api64.ipify.org?format=json'; // También puedes usar 'https://api.myip.com'
|
|
3349
|
-
this.apiGetLocation = '
|
|
3349
|
+
this.apiGetLocation = 'https://ipinfo.io/json';
|
|
3350
3350
|
}
|
|
3351
3351
|
IpService.prototype.getIp = function () {
|
|
3352
3352
|
return this.http.get(this.apiGetIp);
|
|
@@ -3481,18 +3481,16 @@
|
|
|
3481
3481
|
_this.stateSubject.next(final_steps);
|
|
3482
3482
|
// Obtener IP y ubicación
|
|
3483
3483
|
rxjs.forkJoin({
|
|
3484
|
-
ip: _this.ipService.getIp(),
|
|
3485
|
-
location: _this.ipService.getLocation()
|
|
3484
|
+
ip: _this.ipService.getIp().pipe(operators.catchError(function () { return rxjs.of(null); })),
|
|
3485
|
+
location: _this.ipService.getLocation().pipe(operators.catchError(function () { return rxjs.of(null); }))
|
|
3486
3486
|
}).subscribe(function (results) {
|
|
3487
3487
|
var _a, _b, _c;
|
|
3488
3488
|
var params = {
|
|
3489
|
-
ip: (_a = results.ip) === null || _a === void 0 ? void 0 : _a.ip,
|
|
3490
|
-
country: (_b = results.location) === null || _b === void 0 ? void 0 : _b.country,
|
|
3491
|
-
city: (_c = results.location) === null || _c === void 0 ? void 0 : _c.city
|
|
3489
|
+
ip: ((_a = results.ip) === null || _a === void 0 ? void 0 : _a.ip) || 'unknown',
|
|
3490
|
+
country: ((_b = results.location) === null || _b === void 0 ? void 0 : _b.country) || 'unknown',
|
|
3491
|
+
city: ((_c = results.location) === null || _c === void 0 ? void 0 : _c.city) || 'unknown'
|
|
3492
3492
|
};
|
|
3493
|
-
// Convertir los datos a una cadena de consulta
|
|
3494
3493
|
var queryString = new URLSearchParams(params).toString();
|
|
3495
|
-
// Agregar la cadena de consulta a la URL del endpoint
|
|
3496
3494
|
var urlWithParams = _this.getHasPurchaseConditions() + "?" + queryString;
|
|
3497
3495
|
_this.connection.getErrorNotHandler(urlWithParams).toPromise().then(function (res) {
|
|
3498
3496
|
var _a, _b;
|