vk-payments 0.2.31 → 0.2.32
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/bundles/vk-payments.umd.js +354 -194
- package/bundles/vk-payments.umd.js.map +1 -1
- package/bundles/vk-payments.umd.min.js +1 -1
- package/bundles/vk-payments.umd.min.js.map +1 -1
- package/esm2015/lib/galicia/components/galicia.component.js +311 -0
- package/esm2015/lib/galicia/galicia.module.js +37 -0
- package/esm2015/lib/galicia/models/galicia.models.js +46 -0
- package/esm2015/lib/galicia/services/galicia.api.service.js +74 -0
- package/esm2015/lib/vk-payments.module.js +5 -4
- package/esm2015/vk-payments.js +4 -4
- package/esm5/lib/galicia/components/galicia.component.js +359 -0
- package/esm5/lib/galicia/galicia.module.js +41 -0
- package/esm5/lib/galicia/models/galicia.models.js +46 -0
- package/esm5/lib/galicia/services/galicia.api.service.js +87 -0
- package/esm5/lib/vk-payments.module.js +5 -4
- package/esm5/vk-payments.js +4 -4
- package/fesm2015/vk-payments.js +290 -157
- package/fesm2015/vk-payments.js.map +1 -1
- package/fesm5/vk-payments.js +350 -189
- package/fesm5/vk-payments.js.map +1 -1
- package/lib/galicia/components/galicia.component.d.ts +46 -0
- package/lib/galicia/galicia.module.d.ts +2 -0
- package/lib/galicia/models/galicia.models.d.ts +17 -0
- package/lib/galicia/services/galicia.api.service.d.ts +11 -0
- package/package.json +4 -1
- package/vk-payments.d.ts +3 -3
- package/vk-payments.metadata.json +1 -1
- package/esm2015/lib/bank-transfer/bank-transfer.module.js +0 -33
- package/esm2015/lib/bank-transfer/components/bank-transfer.component.js +0 -206
- package/esm2015/lib/bank-transfer/models/bank-transfer.models.js +0 -54
- package/esm2015/lib/bank-transfer/services/bank-transfer.api.service.js +0 -52
- package/esm5/lib/bank-transfer/bank-transfer.module.js +0 -37
- package/esm5/lib/bank-transfer/components/bank-transfer.component.js +0 -234
- package/esm5/lib/bank-transfer/models/bank-transfer.models.js +0 -54
- package/esm5/lib/bank-transfer/services/bank-transfer.api.service.js +0 -57
- package/lib/bank-transfer/bank-transfer.module.d.ts +0 -2
- package/lib/bank-transfer/components/bank-transfer.component.d.ts +0 -30
- package/lib/bank-transfer/models/bank-transfer.models.d.ts +0 -20
- package/lib/bank-transfer/services/bank-transfer.api.service.d.ts +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@angular/common/http'), require('sha256')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('vk-payments', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/router', '@angular/common/http', 'sha256'], factory) :
|
|
4
|
-
(global = global || self, factory(global['vk-payments'] = {}, global.ng.core, global.ng.common, global.ng.forms, global.ng.router, global.ng.common.http, global.sha256));
|
|
5
|
-
}(this, function (exports, core, common, forms, router, http, sha256) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@angular/common/http'), require('sha256'), require('qrcode')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('vk-payments', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/router', '@angular/common/http', 'sha256', 'qrcode'], factory) :
|
|
4
|
+
(global = global || self, factory(global['vk-payments'] = {}, global.ng.core, global.ng.common, global.ng.forms, global.ng.router, global.ng.common.http, global.sha256, global.qrcode));
|
|
5
|
+
}(this, function (exports, core, common, forms, router, http, sha256, qrcode) { 'use strict';
|
|
6
6
|
|
|
7
7
|
sha256 = sha256 && sha256.hasOwnProperty('default') ? sha256['default'] : sha256;
|
|
8
8
|
|
|
@@ -3912,314 +3912,473 @@
|
|
|
3912
3912
|
|
|
3913
3913
|
/**
|
|
3914
3914
|
* @fileoverview added by tsickle
|
|
3915
|
-
* Generated from: lib/
|
|
3915
|
+
* Generated from: lib/galicia/services/galicia.api.service.ts
|
|
3916
3916
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3917
3917
|
*/
|
|
3918
|
-
var
|
|
3919
|
-
function
|
|
3920
|
-
this.
|
|
3918
|
+
var GaliciaApiService = /** @class */ (function () {
|
|
3919
|
+
function GaliciaApiService(httpClient) {
|
|
3920
|
+
this.httpClient = httpClient;
|
|
3921
3921
|
}
|
|
3922
3922
|
/**
|
|
3923
|
-
* @param {?}
|
|
3924
|
-
* @param {?} request
|
|
3925
|
-
* @param {?} vkApiUrl
|
|
3923
|
+
* @param {?} url
|
|
3926
3924
|
* @return {?}
|
|
3927
3925
|
*/
|
|
3928
|
-
|
|
3929
|
-
* @param {?}
|
|
3930
|
-
* @param {?} request
|
|
3931
|
-
* @param {?} vkApiUrl
|
|
3926
|
+
GaliciaApiService.prototype.normalizeUrl = /**
|
|
3927
|
+
* @param {?} url
|
|
3932
3928
|
* @return {?}
|
|
3933
3929
|
*/
|
|
3934
|
-
function (
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3930
|
+
function (url) {
|
|
3931
|
+
if (url.length > 0 && url.charAt(url.length - 1) == '/') {
|
|
3932
|
+
url = url.substr(0, url.length - 1);
|
|
3933
|
+
}
|
|
3934
|
+
return url;
|
|
3935
|
+
};
|
|
3936
|
+
/**
|
|
3937
|
+
* @param {?} url
|
|
3938
|
+
* @param {?} initPayment
|
|
3939
|
+
* @return {?}
|
|
3940
|
+
*/
|
|
3941
|
+
GaliciaApiService.prototype.initPayment = /**
|
|
3942
|
+
* @param {?} url
|
|
3943
|
+
* @param {?} initPayment
|
|
3944
|
+
* @return {?}
|
|
3945
|
+
*/
|
|
3946
|
+
function (url, initPayment) {
|
|
3941
3947
|
/** @type {?} */
|
|
3942
|
-
var
|
|
3943
|
-
|
|
3948
|
+
var body = {
|
|
3949
|
+
storeId: initPayment.storeId,
|
|
3950
|
+
userId: initPayment.userId,
|
|
3951
|
+
sessionId: initPayment.sessionId,
|
|
3952
|
+
storeName: initPayment.storeName,
|
|
3953
|
+
checkoutId: initPayment.checkoutId
|
|
3954
|
+
};
|
|
3955
|
+
return this.httpClient.post(this.normalizeUrl(url) + '/init-payment', body);
|
|
3944
3956
|
};
|
|
3945
|
-
|
|
3957
|
+
/**
|
|
3958
|
+
* @param {?} url
|
|
3959
|
+
* @param {?} billNumber
|
|
3960
|
+
* @return {?}
|
|
3961
|
+
*/
|
|
3962
|
+
GaliciaApiService.prototype.paymentStatus = /**
|
|
3963
|
+
* @param {?} url
|
|
3964
|
+
* @param {?} billNumber
|
|
3965
|
+
* @return {?}
|
|
3966
|
+
*/
|
|
3967
|
+
function (url, billNumber) {
|
|
3968
|
+
return this.httpClient.get(this.normalizeUrl(url) + '/payment-status?billNumber=' + billNumber);
|
|
3969
|
+
};
|
|
3970
|
+
GaliciaApiService.decorators = [
|
|
3946
3971
|
{ type: core.Injectable, args: [{
|
|
3947
3972
|
providedIn: 'root'
|
|
3948
3973
|
},] }
|
|
3949
3974
|
];
|
|
3950
3975
|
/** @nocollapse */
|
|
3951
|
-
|
|
3976
|
+
GaliciaApiService.ctorParameters = function () { return [
|
|
3952
3977
|
{ type: http.HttpClient }
|
|
3953
3978
|
]; };
|
|
3954
|
-
/** @nocollapse */
|
|
3955
|
-
return
|
|
3979
|
+
/** @nocollapse */ GaliciaApiService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function GaliciaApiService_Factory() { return new GaliciaApiService(core.ɵɵinject(http.HttpClient)); }, token: GaliciaApiService, providedIn: "root" });
|
|
3980
|
+
return GaliciaApiService;
|
|
3956
3981
|
}());
|
|
3957
3982
|
if (false) {
|
|
3958
3983
|
/**
|
|
3959
3984
|
* @type {?}
|
|
3960
3985
|
* @private
|
|
3961
3986
|
*/
|
|
3962
|
-
|
|
3987
|
+
GaliciaApiService.prototype.authHeaders;
|
|
3988
|
+
/**
|
|
3989
|
+
* @type {?}
|
|
3990
|
+
* @private
|
|
3991
|
+
*/
|
|
3992
|
+
GaliciaApiService.prototype.httpClient;
|
|
3963
3993
|
}
|
|
3964
3994
|
|
|
3965
3995
|
/**
|
|
3966
3996
|
* @fileoverview added by tsickle
|
|
3967
|
-
* Generated from: lib/
|
|
3997
|
+
* Generated from: lib/galicia/components/galicia.component.ts
|
|
3968
3998
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3969
3999
|
*/
|
|
3970
|
-
var
|
|
3971
|
-
function
|
|
3972
|
-
this.
|
|
3973
|
-
this.discountRate = 0.10; // Tasa de descuento (10% por defecto)
|
|
3974
|
-
// Descuento explícito desde el carrito
|
|
4000
|
+
var GaliciaComponent = /** @class */ (function () {
|
|
4001
|
+
function GaliciaComponent(galiciaApiService) {
|
|
4002
|
+
this.galiciaApiService = galiciaApiService;
|
|
3975
4003
|
this.statusPay = new core.EventEmitter();
|
|
3976
|
-
this.
|
|
4004
|
+
this.qrImage = '';
|
|
4005
|
+
this.billNumber = '';
|
|
3977
4006
|
this.errorMessage = '';
|
|
3978
|
-
this.
|
|
3979
|
-
this.
|
|
3980
|
-
|
|
3981
|
-
this.
|
|
3982
|
-
|
|
3983
|
-
|
|
4007
|
+
this.isGeneratingQr = true;
|
|
4008
|
+
this.paymentCompleted = false;
|
|
4009
|
+
this.paymentId = '';
|
|
4010
|
+
this.showQr = false;
|
|
4011
|
+
this.expired = false;
|
|
4012
|
+
this.isLoading = false;
|
|
4013
|
+
this.hasError = false;
|
|
4014
|
+
this.minutes = 0;
|
|
4015
|
+
this.seconds = 0;
|
|
4016
|
+
this.paymentResult = { success: false, paymentId: '', integrator: 'GALICIA' };
|
|
3984
4017
|
}
|
|
3985
|
-
Object.defineProperty(BankTransferComponent.prototype, "subtotalAmount", {
|
|
3986
|
-
// Calculados a partir de `amount` (que ya tiene el descuento aplicado)
|
|
3987
|
-
get:
|
|
3988
|
-
// Calculados a partir de `amount` (que ya tiene el descuento aplicado)
|
|
3989
|
-
/**
|
|
3990
|
-
* @return {?}
|
|
3991
|
-
*/
|
|
3992
|
-
function () {
|
|
3993
|
-
if (this.discountAmountValue !== undefined && this.discountAmountValue !== null) {
|
|
3994
|
-
return this.amount + this.discountAmountValue;
|
|
3995
|
-
}
|
|
3996
|
-
return this.amount ? Math.round(this.amount / (1 - this.discountRate)) : 0;
|
|
3997
|
-
},
|
|
3998
|
-
enumerable: true,
|
|
3999
|
-
configurable: true
|
|
4000
|
-
});
|
|
4001
|
-
Object.defineProperty(BankTransferComponent.prototype, "discountAmount", {
|
|
4002
|
-
get: /**
|
|
4003
|
-
* @return {?}
|
|
4004
|
-
*/
|
|
4005
|
-
function () {
|
|
4006
|
-
if (this.discountAmountValue !== undefined && this.discountAmountValue !== null) {
|
|
4007
|
-
return this.discountAmountValue;
|
|
4008
|
-
}
|
|
4009
|
-
return this.subtotalAmount - (this.amount || 0);
|
|
4010
|
-
},
|
|
4011
|
-
enumerable: true,
|
|
4012
|
-
configurable: true
|
|
4013
|
-
});
|
|
4014
4018
|
/**
|
|
4015
4019
|
* @return {?}
|
|
4016
4020
|
*/
|
|
4017
|
-
|
|
4021
|
+
GaliciaComponent.prototype.ngOnInit = /**
|
|
4018
4022
|
* @return {?}
|
|
4019
4023
|
*/
|
|
4020
|
-
function () {
|
|
4024
|
+
function () {
|
|
4025
|
+
this.createInitPayment();
|
|
4026
|
+
};
|
|
4021
4027
|
/**
|
|
4022
|
-
* @param {?}
|
|
4028
|
+
* @param {?} datos
|
|
4023
4029
|
* @return {?}
|
|
4024
4030
|
*/
|
|
4025
|
-
|
|
4026
|
-
* @param {?}
|
|
4031
|
+
GaliciaComponent.prototype.generateQr = /**
|
|
4032
|
+
* @param {?} datos
|
|
4027
4033
|
* @return {?}
|
|
4028
4034
|
*/
|
|
4029
|
-
function (
|
|
4030
|
-
|
|
4035
|
+
function (datos) {
|
|
4036
|
+
var _this = this;
|
|
4037
|
+
/** @type {?} */
|
|
4038
|
+
var decoded = atob(datos);
|
|
4039
|
+
qrcode.toDataURL(decoded, {
|
|
4040
|
+
width: 300,
|
|
4041
|
+
margin: 2
|
|
4042
|
+
})
|
|
4043
|
+
.then((/**
|
|
4044
|
+
* @param {?} url
|
|
4031
4045
|
* @return {?}
|
|
4032
4046
|
*/
|
|
4033
|
-
function () {
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
document.body.removeChild(el);
|
|
4047
|
+
function (url) {
|
|
4048
|
+
_this.qrImage = url;
|
|
4049
|
+
_this.isGeneratingQr = false;
|
|
4050
|
+
_this.showQr = true;
|
|
4051
|
+
_this.expired = false;
|
|
4052
|
+
_this.startTimer();
|
|
4053
|
+
_this.startPaymentValidation();
|
|
4041
4054
|
}));
|
|
4042
4055
|
};
|
|
4043
4056
|
/**
|
|
4044
4057
|
* @return {?}
|
|
4045
4058
|
*/
|
|
4046
|
-
|
|
4059
|
+
GaliciaComponent.prototype.createInitPayment = /**
|
|
4047
4060
|
* @return {?}
|
|
4048
4061
|
*/
|
|
4049
4062
|
function () {
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
function () { return _this.amountCopied = false; }), 2000);
|
|
4063
|
+
this.OinitPayment = {
|
|
4064
|
+
sessionId: '',
|
|
4065
|
+
userId: this.userId,
|
|
4066
|
+
storeId: this.storeId,
|
|
4067
|
+
storeName: this.storeName,
|
|
4068
|
+
checkoutId: this.checkoutId
|
|
4069
|
+
};
|
|
4070
|
+
this.initPayment();
|
|
4059
4071
|
};
|
|
4060
4072
|
/**
|
|
4061
4073
|
* @return {?}
|
|
4062
4074
|
*/
|
|
4063
|
-
|
|
4075
|
+
GaliciaComponent.prototype.initPayment = /**
|
|
4064
4076
|
* @return {?}
|
|
4065
4077
|
*/
|
|
4066
4078
|
function () {
|
|
4067
4079
|
var _this = this;
|
|
4068
|
-
|
|
4080
|
+
this.isGeneratingQr = true;
|
|
4081
|
+
this.galiciaApiService.initPayment(this.vkUrlApi, this.OinitPayment)
|
|
4082
|
+
.subscribe({
|
|
4083
|
+
next: (/**
|
|
4084
|
+
* @param {?} v
|
|
4085
|
+
* @return {?}
|
|
4086
|
+
*/
|
|
4087
|
+
function (v) { return _this.initPaymentResponseHandler(v); }),
|
|
4088
|
+
error: (/**
|
|
4089
|
+
* @param {?} v
|
|
4090
|
+
* @return {?}
|
|
4091
|
+
*/
|
|
4092
|
+
function (v) { return _this.initPaymentErrorHandler(v); })
|
|
4093
|
+
});
|
|
4094
|
+
};
|
|
4095
|
+
/**
|
|
4096
|
+
* @private
|
|
4097
|
+
* @param {?} response
|
|
4098
|
+
* @return {?}
|
|
4099
|
+
*/
|
|
4100
|
+
GaliciaComponent.prototype.initPaymentResponseHandler = /**
|
|
4101
|
+
* @private
|
|
4102
|
+
* @param {?} response
|
|
4103
|
+
* @return {?}
|
|
4104
|
+
*/
|
|
4105
|
+
function (response) {
|
|
4106
|
+
if (!response.success) {
|
|
4107
|
+
this.isLoading = false;
|
|
4108
|
+
this.hasError = true;
|
|
4109
|
+
this.statusPay.emit(this.paymentResult);
|
|
4110
|
+
this.errorMessage = response.errorsMessages[0] || 'Ocurrió un error al generar el código QR.';
|
|
4069
4111
|
return;
|
|
4070
|
-
|
|
4071
|
-
this.errorMessage = '';
|
|
4112
|
+
}
|
|
4072
4113
|
/** @type {?} */
|
|
4073
|
-
var
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4114
|
+
var qrData = response.data.bills[0].qr.datos;
|
|
4115
|
+
this.billNumber = response.data.bills[0].nroBoleta;
|
|
4116
|
+
this.generateQr(qrData);
|
|
4117
|
+
};
|
|
4118
|
+
/**
|
|
4119
|
+
* @private
|
|
4120
|
+
* @param {?} error
|
|
4121
|
+
* @return {?}
|
|
4122
|
+
*/
|
|
4123
|
+
GaliciaComponent.prototype.initPaymentErrorHandler = /**
|
|
4124
|
+
* @private
|
|
4125
|
+
* @param {?} error
|
|
4126
|
+
* @return {?}
|
|
4127
|
+
*/
|
|
4128
|
+
function (error) {
|
|
4129
|
+
this.isLoading = false;
|
|
4130
|
+
this.hasError = true;
|
|
4131
|
+
this.errorMessage = error.errorsMessages[0] || 'Ocurrió un error al generar el código QR.';
|
|
4132
|
+
this.paymentResult.success = false;
|
|
4133
|
+
this.statusPay.emit(this.paymentResult);
|
|
4134
|
+
};
|
|
4135
|
+
/**
|
|
4136
|
+
* @return {?}
|
|
4137
|
+
*/
|
|
4138
|
+
GaliciaComponent.prototype.startTimer = /**
|
|
4139
|
+
* @return {?}
|
|
4140
|
+
*/
|
|
4141
|
+
function () {
|
|
4142
|
+
var _this = this;
|
|
4143
|
+
clearInterval(this.interval);
|
|
4144
|
+
this.minutes = 1;
|
|
4145
|
+
this.seconds = 0;
|
|
4146
|
+
this.interval = setInterval((/**
|
|
4083
4147
|
* @return {?}
|
|
4084
4148
|
*/
|
|
4085
|
-
function (
|
|
4086
|
-
_this.
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4149
|
+
function () {
|
|
4150
|
+
if (_this.seconds === 0) {
|
|
4151
|
+
if (_this.minutes === 0) {
|
|
4152
|
+
_this.stopValidation();
|
|
4153
|
+
_this.showQr = false;
|
|
4154
|
+
_this.expired = true;
|
|
4155
|
+
return;
|
|
4156
|
+
}
|
|
4157
|
+
_this.minutes--;
|
|
4158
|
+
_this.seconds = 59;
|
|
4094
4159
|
}
|
|
4095
4160
|
else {
|
|
4096
|
-
_this.
|
|
4097
|
-
? response.errorsMessages[0]
|
|
4098
|
-
: 'Ocurrió un error al registrar la transferencia.';
|
|
4099
|
-
_this.statusPay.emit({
|
|
4100
|
-
success: false,
|
|
4101
|
-
paymentId: '',
|
|
4102
|
-
integrator: 'BANK_TRANSFER'
|
|
4103
|
-
});
|
|
4161
|
+
_this.seconds--;
|
|
4104
4162
|
}
|
|
4105
|
-
}),
|
|
4106
|
-
* @param {?} error
|
|
4107
|
-
* @return {?}
|
|
4108
|
-
*/
|
|
4109
|
-
function (error) {
|
|
4110
|
-
_this.isLoading = false;
|
|
4111
|
-
_this.errorMessage = (error && error.error && error.error.errorsMessages && error.error.errorsMessages.length > 0)
|
|
4112
|
-
? error.error.errorsMessages[0]
|
|
4113
|
-
: 'Ocurrió un error de conexión al registrar la transferencia.';
|
|
4114
|
-
_this.statusPay.emit({
|
|
4115
|
-
success: false,
|
|
4116
|
-
paymentId: '',
|
|
4117
|
-
integrator: 'BANK_TRANSFER'
|
|
4118
|
-
});
|
|
4119
|
-
console.error('Error BankTransferApiService:', error);
|
|
4120
|
-
}));
|
|
4163
|
+
}), 1000);
|
|
4121
4164
|
};
|
|
4122
|
-
|
|
4123
|
-
|
|
4165
|
+
/**
|
|
4166
|
+
* @return {?}
|
|
4167
|
+
*/
|
|
4168
|
+
GaliciaComponent.prototype.startPaymentValidation = /**
|
|
4169
|
+
* @return {?}
|
|
4170
|
+
*/
|
|
4171
|
+
function () {
|
|
4172
|
+
var _this = this;
|
|
4173
|
+
this.validationInterval = setInterval((/**
|
|
4124
4174
|
* @return {?}
|
|
4125
4175
|
*/
|
|
4126
4176
|
function () {
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4177
|
+
_this.galiciaApiService.paymentStatus(_this.vkUrlApi, _this.billNumber)
|
|
4178
|
+
.subscribe({
|
|
4179
|
+
next: (/**
|
|
4180
|
+
* @param {?} v
|
|
4181
|
+
* @return {?}
|
|
4182
|
+
*/
|
|
4183
|
+
function (v) { return _this.paymentStatusResponseHandler(v); }),
|
|
4184
|
+
error: (/**
|
|
4185
|
+
* @param {?} v
|
|
4186
|
+
* @return {?}
|
|
4187
|
+
*/
|
|
4188
|
+
function (v) { return _this.paymentStatusErrorHandler(v); })
|
|
4189
|
+
});
|
|
4190
|
+
}), 5000);
|
|
4191
|
+
};
|
|
4192
|
+
/**
|
|
4193
|
+
* @param {?} response
|
|
4194
|
+
* @return {?}
|
|
4195
|
+
*/
|
|
4196
|
+
GaliciaComponent.prototype.paymentStatusResponseHandler = /**
|
|
4197
|
+
* @param {?} response
|
|
4198
|
+
* @return {?}
|
|
4199
|
+
*/
|
|
4200
|
+
function (response) {
|
|
4201
|
+
console.log(response);
|
|
4202
|
+
if (!response.success) {
|
|
4203
|
+
this.isLoading = false;
|
|
4204
|
+
this.statusPay.emit(this.paymentResult);
|
|
4205
|
+
return;
|
|
4206
|
+
}
|
|
4207
|
+
if (response.data.isPaid) {
|
|
4208
|
+
this.stopValidation();
|
|
4209
|
+
this.showQr = false;
|
|
4210
|
+
this.expired = false;
|
|
4211
|
+
this.paymentCompleted = true;
|
|
4212
|
+
this.paymentId = response.data.paymentId;
|
|
4213
|
+
this.paymentResult = {
|
|
4214
|
+
success: true,
|
|
4215
|
+
paymentId: this.paymentId,
|
|
4216
|
+
integrator: 'GALICIA'
|
|
4217
|
+
};
|
|
4218
|
+
this.statusPay.emit(this.paymentResult);
|
|
4219
|
+
}
|
|
4220
|
+
};
|
|
4221
|
+
/**
|
|
4222
|
+
* @private
|
|
4223
|
+
* @param {?} error
|
|
4224
|
+
* @return {?}
|
|
4225
|
+
*/
|
|
4226
|
+
GaliciaComponent.prototype.paymentStatusErrorHandler = /**
|
|
4227
|
+
* @private
|
|
4228
|
+
* @param {?} error
|
|
4229
|
+
* @return {?}
|
|
4230
|
+
*/
|
|
4231
|
+
function (error) {
|
|
4232
|
+
clearInterval(this.validationInterval);
|
|
4233
|
+
this.hasError = true;
|
|
4234
|
+
};
|
|
4235
|
+
/**
|
|
4236
|
+
* @return {?}
|
|
4237
|
+
*/
|
|
4238
|
+
GaliciaComponent.prototype.showQrAgain = /**
|
|
4239
|
+
* @return {?}
|
|
4240
|
+
*/
|
|
4241
|
+
function () {
|
|
4242
|
+
this.showQr = true;
|
|
4243
|
+
this.expired = false;
|
|
4244
|
+
this.startTimer();
|
|
4245
|
+
this.startPaymentValidation();
|
|
4246
|
+
};
|
|
4247
|
+
/**
|
|
4248
|
+
* @private
|
|
4249
|
+
* @return {?}
|
|
4250
|
+
*/
|
|
4251
|
+
GaliciaComponent.prototype.stopValidation = /**
|
|
4252
|
+
* @private
|
|
4253
|
+
* @return {?}
|
|
4254
|
+
*/
|
|
4255
|
+
function () {
|
|
4256
|
+
clearInterval(this.validationInterval);
|
|
4257
|
+
clearInterval(this.interval);
|
|
4258
|
+
};
|
|
4259
|
+
GaliciaComponent.decorators = [
|
|
4133
4260
|
{ type: core.Component, args: [{
|
|
4134
|
-
selector: '
|
|
4135
|
-
template: "<
|
|
4136
|
-
styles: [".
|
|
4261
|
+
selector: 'lib-galicia',
|
|
4262
|
+
template: "<div class=\"gc-payment\">\n <div class=\"formRow\">\n <p>\n Escane\u00E1 el c\u00F3digo QR con tu aplicaci\u00F3n bancaria para realizar el pago.\n </p>\n </div>\n\n <div *ngIf=\"isGeneratingQr && !hasError\" class=\"loading-container\">\n <div class=\"spinner\"></div>\n <p>Generando c\u00F3digo QR...</p>\n </div>\n\n <div *ngIf=\"showQr\">\n <div class=\"qr-container\">\n <img [src]=\"qrImage\" alt=\"QR Galicia\" />\n </div>\n\n <div class=\"timer\">\n Tiempo restante: {{ minutes }}:{{ seconds < 10 ? '0' + seconds : seconds }} \n </div>\n </div>\n\n <div *ngIf=\"hasError\" class=\"payment-error\">\n <div class=\"error-icon\">\n \u26A0\n </div>\n\n <div class=\"error-message\">\n <h3>No fue posible generar el c\u00F3digo QR</h3>\n\n <p>{{ errorMessage }}</p>\n </div>\n </div>\n\n <div *ngIf=\"paymentCompleted\" class=\"payment-success\">\n <div class=\"success-icon\">\n \u2713\n </div>\n\n <div class=\"success-message\">\n <h3>Pago realizado correctamente</h3>\n\n <p>\n ID de pago Galicia: <strong>{{ paymentId }}</strong>\n </p>\n </div>\n </div>\n\n <div *ngIf=\"expired\">\n <div class=\"pay-message info\">\n El c\u00F3digo QR expir\u00F3.\n </div>\n\n <button type=\"button\" (click)=\"showQrAgain()\">\n Regenerar c\u00F3digo QR\n </button>\n\n </div>\n</div>",
|
|
4263
|
+
styles: [".gc-payment{display:flex;flex-direction:column;align-items:center;text-align:center}.formRow{width:100%;max-width:400px;margin-bottom:20px}.loading-container{text-align:center;padding:30px}.spinner{width:40px;height:40px;margin:0 auto 15px;border:4px solid #e0e0e0;border-top:4px solid #06c;border-radius:50%;-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}.qr-container{margin:20px 0}.qr-container img{max-width:300px;width:100%;height:auto}.timer{margin-top:10px;font-size:18px;font-weight:600}.payment-error{text-align:center;padding:30px;max-width:400px}.error-icon{width:80px;height:80px;margin:0 auto 15px;border-radius:50%;background:#fc2626;color:#fff;font-size:48px;font-weight:700;display:flex;align-items:center;justify-content:center}.error-message h3{color:#fc2626;margin-bottom:10px}.payment-success{text-align:center;padding:30px}.success-icon{width:80px;height:80px;margin:0 auto 15px;border-radius:50%;background:#28a745;color:#fff;font-size:48px;font-weight:700;display:flex;align-items:center;justify-content:center}.success-message h3{color:#28a745;margin-bottom:10px}@-webkit-keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"]
|
|
4137
4264
|
}] }
|
|
4138
4265
|
];
|
|
4139
4266
|
/** @nocollapse */
|
|
4140
|
-
|
|
4141
|
-
{ type:
|
|
4267
|
+
GaliciaComponent.ctorParameters = function () { return [
|
|
4268
|
+
{ type: GaliciaApiService }
|
|
4142
4269
|
]; };
|
|
4143
|
-
|
|
4270
|
+
GaliciaComponent.propDecorators = {
|
|
4144
4271
|
accessToken: [{ type: core.Input }],
|
|
4272
|
+
gaUrlApi: [{ type: core.Input }],
|
|
4145
4273
|
vkUrlApi: [{ type: core.Input }],
|
|
4146
|
-
|
|
4274
|
+
userId: [{ type: core.Input }],
|
|
4275
|
+
logoGa: [{ type: core.Input }],
|
|
4147
4276
|
storeId: [{ type: core.Input }],
|
|
4148
4277
|
storeName: [{ type: core.Input }],
|
|
4278
|
+
sessionId: [{ type: core.Input }],
|
|
4149
4279
|
checkoutId: [{ type: core.Input }],
|
|
4150
|
-
|
|
4151
|
-
discountRate: [{ type: core.Input }],
|
|
4152
|
-
discountAmountValue: [{ type: core.Input }],
|
|
4280
|
+
data: [{ type: core.Input }],
|
|
4153
4281
|
statusPay: [{ type: core.Output }]
|
|
4154
4282
|
};
|
|
4155
|
-
return
|
|
4283
|
+
return GaliciaComponent;
|
|
4156
4284
|
}());
|
|
4157
4285
|
if (false) {
|
|
4158
4286
|
/** @type {?} */
|
|
4159
|
-
|
|
4287
|
+
GaliciaComponent.prototype.accessToken;
|
|
4288
|
+
/** @type {?} */
|
|
4289
|
+
GaliciaComponent.prototype.gaUrlApi;
|
|
4290
|
+
/** @type {?} */
|
|
4291
|
+
GaliciaComponent.prototype.vkUrlApi;
|
|
4292
|
+
/** @type {?} */
|
|
4293
|
+
GaliciaComponent.prototype.userId;
|
|
4294
|
+
/** @type {?} */
|
|
4295
|
+
GaliciaComponent.prototype.logoGa;
|
|
4296
|
+
/** @type {?} */
|
|
4297
|
+
GaliciaComponent.prototype.storeId;
|
|
4298
|
+
/** @type {?} */
|
|
4299
|
+
GaliciaComponent.prototype.storeName;
|
|
4300
|
+
/** @type {?} */
|
|
4301
|
+
GaliciaComponent.prototype.sessionId;
|
|
4302
|
+
/** @type {?} */
|
|
4303
|
+
GaliciaComponent.prototype.checkoutId;
|
|
4304
|
+
/** @type {?} */
|
|
4305
|
+
GaliciaComponent.prototype.data;
|
|
4160
4306
|
/** @type {?} */
|
|
4161
|
-
|
|
4307
|
+
GaliciaComponent.prototype.statusPay;
|
|
4162
4308
|
/** @type {?} */
|
|
4163
|
-
|
|
4309
|
+
GaliciaComponent.prototype.qrImage;
|
|
4164
4310
|
/** @type {?} */
|
|
4165
|
-
|
|
4311
|
+
GaliciaComponent.prototype.billNumber;
|
|
4166
4312
|
/** @type {?} */
|
|
4167
|
-
|
|
4313
|
+
GaliciaComponent.prototype.errorMessage;
|
|
4168
4314
|
/** @type {?} */
|
|
4169
|
-
|
|
4315
|
+
GaliciaComponent.prototype.OinitPayment;
|
|
4170
4316
|
/** @type {?} */
|
|
4171
|
-
|
|
4317
|
+
GaliciaComponent.prototype.isGeneratingQr;
|
|
4172
4318
|
/** @type {?} */
|
|
4173
|
-
|
|
4319
|
+
GaliciaComponent.prototype.paymentCompleted;
|
|
4174
4320
|
/** @type {?} */
|
|
4175
|
-
|
|
4321
|
+
GaliciaComponent.prototype.paymentId;
|
|
4176
4322
|
/** @type {?} */
|
|
4177
|
-
|
|
4323
|
+
GaliciaComponent.prototype.showQr;
|
|
4178
4324
|
/** @type {?} */
|
|
4179
|
-
|
|
4325
|
+
GaliciaComponent.prototype.expired;
|
|
4180
4326
|
/** @type {?} */
|
|
4181
|
-
|
|
4327
|
+
GaliciaComponent.prototype.isLoading;
|
|
4182
4328
|
/** @type {?} */
|
|
4183
|
-
|
|
4329
|
+
GaliciaComponent.prototype.hasError;
|
|
4184
4330
|
/** @type {?} */
|
|
4185
|
-
|
|
4331
|
+
GaliciaComponent.prototype.minutes;
|
|
4186
4332
|
/** @type {?} */
|
|
4187
|
-
|
|
4333
|
+
GaliciaComponent.prototype.seconds;
|
|
4188
4334
|
/**
|
|
4189
4335
|
* @type {?}
|
|
4190
4336
|
* @private
|
|
4191
4337
|
*/
|
|
4192
|
-
|
|
4338
|
+
GaliciaComponent.prototype.interval;
|
|
4339
|
+
/** @type {?} */
|
|
4340
|
+
GaliciaComponent.prototype.validationInterval;
|
|
4341
|
+
/** @type {?} */
|
|
4342
|
+
GaliciaComponent.prototype.paymentResult;
|
|
4343
|
+
/**
|
|
4344
|
+
* @type {?}
|
|
4345
|
+
* @private
|
|
4346
|
+
*/
|
|
4347
|
+
GaliciaComponent.prototype.galiciaApiService;
|
|
4193
4348
|
}
|
|
4194
4349
|
|
|
4195
4350
|
/**
|
|
4196
4351
|
* @fileoverview added by tsickle
|
|
4197
|
-
* Generated from: lib/
|
|
4352
|
+
* Generated from: lib/galicia/galicia.module.ts
|
|
4198
4353
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4199
4354
|
*/
|
|
4200
|
-
|
|
4201
|
-
|
|
4355
|
+
/** @type {?} */
|
|
4356
|
+
var COMPONENTS$2 = [
|
|
4357
|
+
GaliciaComponent
|
|
4358
|
+
];
|
|
4359
|
+
var GaliciaModule = /** @class */ (function () {
|
|
4360
|
+
function GaliciaModule() {
|
|
4202
4361
|
}
|
|
4203
|
-
|
|
4362
|
+
GaliciaModule.decorators = [
|
|
4204
4363
|
{ type: core.NgModule, args: [{
|
|
4205
4364
|
declarations: [
|
|
4206
|
-
|
|
4365
|
+
COMPONENTS$2
|
|
4366
|
+
],
|
|
4367
|
+
exports: [
|
|
4368
|
+
COMPONENTS$2
|
|
4207
4369
|
],
|
|
4208
4370
|
imports: [
|
|
4209
4371
|
common.CommonModule,
|
|
4210
4372
|
forms.FormsModule,
|
|
4211
4373
|
forms.ReactiveFormsModule,
|
|
4212
|
-
|
|
4213
|
-
],
|
|
4214
|
-
exports: [
|
|
4215
|
-
BankTransferComponent
|
|
4374
|
+
router.RouterModule,
|
|
4216
4375
|
],
|
|
4217
4376
|
providers: [
|
|
4218
|
-
|
|
4377
|
+
GaliciaApiService
|
|
4219
4378
|
]
|
|
4220
4379
|
},] }
|
|
4221
4380
|
];
|
|
4222
|
-
return
|
|
4381
|
+
return GaliciaModule;
|
|
4223
4382
|
}());
|
|
4224
4383
|
|
|
4225
4384
|
/**
|
|
@@ -4234,7 +4393,7 @@
|
|
|
4234
4393
|
PaypalModule,
|
|
4235
4394
|
GoCuotasModule,
|
|
4236
4395
|
ModoModule,
|
|
4237
|
-
|
|
4396
|
+
GaliciaModule
|
|
4238
4397
|
];
|
|
4239
4398
|
var VkPaymentsModule = /** @class */ (function () {
|
|
4240
4399
|
function VkPaymentsModule() {
|
|
@@ -4242,7 +4401,8 @@
|
|
|
4242
4401
|
VkPaymentsModule.decorators = [
|
|
4243
4402
|
{ type: core.NgModule, args: [{
|
|
4244
4403
|
imports: LIB_MODULES,
|
|
4245
|
-
exports: LIB_MODULES
|
|
4404
|
+
exports: LIB_MODULES,
|
|
4405
|
+
declarations: []
|
|
4246
4406
|
},] }
|
|
4247
4407
|
];
|
|
4248
4408
|
return VkPaymentsModule;
|
|
@@ -4265,9 +4425,9 @@
|
|
|
4265
4425
|
exports.ɵn = ModoModule;
|
|
4266
4426
|
exports.ɵo = ModoComponent;
|
|
4267
4427
|
exports.ɵp = ModoApiService;
|
|
4268
|
-
exports.ɵq =
|
|
4269
|
-
exports.ɵr =
|
|
4270
|
-
exports.ɵs =
|
|
4428
|
+
exports.ɵq = GaliciaModule;
|
|
4429
|
+
exports.ɵr = GaliciaComponent;
|
|
4430
|
+
exports.ɵs = GaliciaApiService;
|
|
4271
4431
|
|
|
4272
4432
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4273
4433
|
|