vk-payments 0.2.30 → 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 +355 -186
- 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 +291 -149
- package/fesm2015/vk-payments.js.map +1 -1
- package/fesm5/vk-payments.js +351 -181
- 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 -197
- 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 -225
- 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 -29
- 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,305 +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
|
-
// Tasa de descuento (10% por defecto)
|
|
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
|
-
return this.amount ? Math.round(this.amount / (1 - this.discountRate)) : 0;
|
|
3994
|
-
},
|
|
3995
|
-
enumerable: true,
|
|
3996
|
-
configurable: true
|
|
3997
|
-
});
|
|
3998
|
-
Object.defineProperty(BankTransferComponent.prototype, "discountAmount", {
|
|
3999
|
-
get: /**
|
|
4000
|
-
* @return {?}
|
|
4001
|
-
*/
|
|
4002
|
-
function () {
|
|
4003
|
-
return this.subtotalAmount - (this.amount || 0);
|
|
4004
|
-
},
|
|
4005
|
-
enumerable: true,
|
|
4006
|
-
configurable: true
|
|
4007
|
-
});
|
|
4008
4018
|
/**
|
|
4009
4019
|
* @return {?}
|
|
4010
4020
|
*/
|
|
4011
|
-
|
|
4021
|
+
GaliciaComponent.prototype.ngOnInit = /**
|
|
4012
4022
|
* @return {?}
|
|
4013
4023
|
*/
|
|
4014
|
-
function () {
|
|
4024
|
+
function () {
|
|
4025
|
+
this.createInitPayment();
|
|
4026
|
+
};
|
|
4015
4027
|
/**
|
|
4016
|
-
* @param {?}
|
|
4028
|
+
* @param {?} datos
|
|
4017
4029
|
* @return {?}
|
|
4018
4030
|
*/
|
|
4019
|
-
|
|
4020
|
-
* @param {?}
|
|
4031
|
+
GaliciaComponent.prototype.generateQr = /**
|
|
4032
|
+
* @param {?} datos
|
|
4021
4033
|
* @return {?}
|
|
4022
4034
|
*/
|
|
4023
|
-
function (
|
|
4024
|
-
|
|
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
|
|
4025
4045
|
* @return {?}
|
|
4026
4046
|
*/
|
|
4027
|
-
function () {
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
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();
|
|
4035
4054
|
}));
|
|
4036
4055
|
};
|
|
4037
4056
|
/**
|
|
4038
4057
|
* @return {?}
|
|
4039
4058
|
*/
|
|
4040
|
-
|
|
4059
|
+
GaliciaComponent.prototype.createInitPayment = /**
|
|
4041
4060
|
* @return {?}
|
|
4042
4061
|
*/
|
|
4043
4062
|
function () {
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
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();
|
|
4053
4071
|
};
|
|
4054
4072
|
/**
|
|
4055
4073
|
* @return {?}
|
|
4056
4074
|
*/
|
|
4057
|
-
|
|
4075
|
+
GaliciaComponent.prototype.initPayment = /**
|
|
4058
4076
|
* @return {?}
|
|
4059
4077
|
*/
|
|
4060
4078
|
function () {
|
|
4061
4079
|
var _this = this;
|
|
4062
|
-
|
|
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.';
|
|
4063
4111
|
return;
|
|
4064
|
-
|
|
4065
|
-
this.errorMessage = '';
|
|
4112
|
+
}
|
|
4066
4113
|
/** @type {?} */
|
|
4067
|
-
var
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
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((/**
|
|
4077
4147
|
* @return {?}
|
|
4078
4148
|
*/
|
|
4079
|
-
function (
|
|
4080
|
-
_this.
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
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;
|
|
4088
4159
|
}
|
|
4089
4160
|
else {
|
|
4090
|
-
_this.
|
|
4091
|
-
? response.errorsMessages[0]
|
|
4092
|
-
: 'Ocurrió un error al registrar la transferencia.';
|
|
4093
|
-
_this.statusPay.emit({
|
|
4094
|
-
success: false,
|
|
4095
|
-
paymentId: '',
|
|
4096
|
-
integrator: 'BANK_TRANSFER'
|
|
4097
|
-
});
|
|
4161
|
+
_this.seconds--;
|
|
4098
4162
|
}
|
|
4099
|
-
}),
|
|
4100
|
-
* @param {?} error
|
|
4101
|
-
* @return {?}
|
|
4102
|
-
*/
|
|
4103
|
-
function (error) {
|
|
4104
|
-
_this.isLoading = false;
|
|
4105
|
-
_this.errorMessage = (error && error.error && error.error.errorsMessages && error.error.errorsMessages.length > 0)
|
|
4106
|
-
? error.error.errorsMessages[0]
|
|
4107
|
-
: 'Ocurrió un error de conexión al registrar la transferencia.';
|
|
4108
|
-
_this.statusPay.emit({
|
|
4109
|
-
success: false,
|
|
4110
|
-
paymentId: '',
|
|
4111
|
-
integrator: 'BANK_TRANSFER'
|
|
4112
|
-
});
|
|
4113
|
-
console.error('Error BankTransferApiService:', error);
|
|
4114
|
-
}));
|
|
4163
|
+
}), 1000);
|
|
4115
4164
|
};
|
|
4116
|
-
|
|
4117
|
-
|
|
4165
|
+
/**
|
|
4166
|
+
* @return {?}
|
|
4167
|
+
*/
|
|
4168
|
+
GaliciaComponent.prototype.startPaymentValidation = /**
|
|
4169
|
+
* @return {?}
|
|
4170
|
+
*/
|
|
4171
|
+
function () {
|
|
4172
|
+
var _this = this;
|
|
4173
|
+
this.validationInterval = setInterval((/**
|
|
4118
4174
|
* @return {?}
|
|
4119
4175
|
*/
|
|
4120
4176
|
function () {
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
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 = [
|
|
4127
4260
|
{ type: core.Component, args: [{
|
|
4128
|
-
selector: '
|
|
4129
|
-
template: "<
|
|
4130
|
-
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)}}"]
|
|
4131
4264
|
}] }
|
|
4132
4265
|
];
|
|
4133
4266
|
/** @nocollapse */
|
|
4134
|
-
|
|
4135
|
-
{ type:
|
|
4267
|
+
GaliciaComponent.ctorParameters = function () { return [
|
|
4268
|
+
{ type: GaliciaApiService }
|
|
4136
4269
|
]; };
|
|
4137
|
-
|
|
4270
|
+
GaliciaComponent.propDecorators = {
|
|
4138
4271
|
accessToken: [{ type: core.Input }],
|
|
4272
|
+
gaUrlApi: [{ type: core.Input }],
|
|
4139
4273
|
vkUrlApi: [{ type: core.Input }],
|
|
4140
|
-
|
|
4274
|
+
userId: [{ type: core.Input }],
|
|
4275
|
+
logoGa: [{ type: core.Input }],
|
|
4141
4276
|
storeId: [{ type: core.Input }],
|
|
4142
4277
|
storeName: [{ type: core.Input }],
|
|
4278
|
+
sessionId: [{ type: core.Input }],
|
|
4143
4279
|
checkoutId: [{ type: core.Input }],
|
|
4144
|
-
|
|
4145
|
-
discountRate: [{ type: core.Input }],
|
|
4280
|
+
data: [{ type: core.Input }],
|
|
4146
4281
|
statusPay: [{ type: core.Output }]
|
|
4147
4282
|
};
|
|
4148
|
-
return
|
|
4283
|
+
return GaliciaComponent;
|
|
4149
4284
|
}());
|
|
4150
4285
|
if (false) {
|
|
4151
4286
|
/** @type {?} */
|
|
4152
|
-
|
|
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;
|
|
4306
|
+
/** @type {?} */
|
|
4307
|
+
GaliciaComponent.prototype.statusPay;
|
|
4153
4308
|
/** @type {?} */
|
|
4154
|
-
|
|
4309
|
+
GaliciaComponent.prototype.qrImage;
|
|
4155
4310
|
/** @type {?} */
|
|
4156
|
-
|
|
4311
|
+
GaliciaComponent.prototype.billNumber;
|
|
4157
4312
|
/** @type {?} */
|
|
4158
|
-
|
|
4313
|
+
GaliciaComponent.prototype.errorMessage;
|
|
4159
4314
|
/** @type {?} */
|
|
4160
|
-
|
|
4315
|
+
GaliciaComponent.prototype.OinitPayment;
|
|
4161
4316
|
/** @type {?} */
|
|
4162
|
-
|
|
4317
|
+
GaliciaComponent.prototype.isGeneratingQr;
|
|
4163
4318
|
/** @type {?} */
|
|
4164
|
-
|
|
4319
|
+
GaliciaComponent.prototype.paymentCompleted;
|
|
4165
4320
|
/** @type {?} */
|
|
4166
|
-
|
|
4321
|
+
GaliciaComponent.prototype.paymentId;
|
|
4167
4322
|
/** @type {?} */
|
|
4168
|
-
|
|
4323
|
+
GaliciaComponent.prototype.showQr;
|
|
4169
4324
|
/** @type {?} */
|
|
4170
|
-
|
|
4325
|
+
GaliciaComponent.prototype.expired;
|
|
4171
4326
|
/** @type {?} */
|
|
4172
|
-
|
|
4327
|
+
GaliciaComponent.prototype.isLoading;
|
|
4173
4328
|
/** @type {?} */
|
|
4174
|
-
|
|
4329
|
+
GaliciaComponent.prototype.hasError;
|
|
4175
4330
|
/** @type {?} */
|
|
4176
|
-
|
|
4331
|
+
GaliciaComponent.prototype.minutes;
|
|
4177
4332
|
/** @type {?} */
|
|
4178
|
-
|
|
4333
|
+
GaliciaComponent.prototype.seconds;
|
|
4179
4334
|
/**
|
|
4180
4335
|
* @type {?}
|
|
4181
4336
|
* @private
|
|
4182
4337
|
*/
|
|
4183
|
-
|
|
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;
|
|
4184
4348
|
}
|
|
4185
4349
|
|
|
4186
4350
|
/**
|
|
4187
4351
|
* @fileoverview added by tsickle
|
|
4188
|
-
* Generated from: lib/
|
|
4352
|
+
* Generated from: lib/galicia/galicia.module.ts
|
|
4189
4353
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4190
4354
|
*/
|
|
4191
|
-
|
|
4192
|
-
|
|
4355
|
+
/** @type {?} */
|
|
4356
|
+
var COMPONENTS$2 = [
|
|
4357
|
+
GaliciaComponent
|
|
4358
|
+
];
|
|
4359
|
+
var GaliciaModule = /** @class */ (function () {
|
|
4360
|
+
function GaliciaModule() {
|
|
4193
4361
|
}
|
|
4194
|
-
|
|
4362
|
+
GaliciaModule.decorators = [
|
|
4195
4363
|
{ type: core.NgModule, args: [{
|
|
4196
4364
|
declarations: [
|
|
4197
|
-
|
|
4365
|
+
COMPONENTS$2
|
|
4366
|
+
],
|
|
4367
|
+
exports: [
|
|
4368
|
+
COMPONENTS$2
|
|
4198
4369
|
],
|
|
4199
4370
|
imports: [
|
|
4200
4371
|
common.CommonModule,
|
|
4201
4372
|
forms.FormsModule,
|
|
4202
4373
|
forms.ReactiveFormsModule,
|
|
4203
|
-
|
|
4204
|
-
],
|
|
4205
|
-
exports: [
|
|
4206
|
-
BankTransferComponent
|
|
4374
|
+
router.RouterModule,
|
|
4207
4375
|
],
|
|
4208
4376
|
providers: [
|
|
4209
|
-
|
|
4377
|
+
GaliciaApiService
|
|
4210
4378
|
]
|
|
4211
4379
|
},] }
|
|
4212
4380
|
];
|
|
4213
|
-
return
|
|
4381
|
+
return GaliciaModule;
|
|
4214
4382
|
}());
|
|
4215
4383
|
|
|
4216
4384
|
/**
|
|
@@ -4225,7 +4393,7 @@
|
|
|
4225
4393
|
PaypalModule,
|
|
4226
4394
|
GoCuotasModule,
|
|
4227
4395
|
ModoModule,
|
|
4228
|
-
|
|
4396
|
+
GaliciaModule
|
|
4229
4397
|
];
|
|
4230
4398
|
var VkPaymentsModule = /** @class */ (function () {
|
|
4231
4399
|
function VkPaymentsModule() {
|
|
@@ -4233,7 +4401,8 @@
|
|
|
4233
4401
|
VkPaymentsModule.decorators = [
|
|
4234
4402
|
{ type: core.NgModule, args: [{
|
|
4235
4403
|
imports: LIB_MODULES,
|
|
4236
|
-
exports: LIB_MODULES
|
|
4404
|
+
exports: LIB_MODULES,
|
|
4405
|
+
declarations: []
|
|
4237
4406
|
},] }
|
|
4238
4407
|
];
|
|
4239
4408
|
return VkPaymentsModule;
|
|
@@ -4256,9 +4425,9 @@
|
|
|
4256
4425
|
exports.ɵn = ModoModule;
|
|
4257
4426
|
exports.ɵo = ModoComponent;
|
|
4258
4427
|
exports.ɵp = ModoApiService;
|
|
4259
|
-
exports.ɵq =
|
|
4260
|
-
exports.ɵr =
|
|
4261
|
-
exports.ɵs =
|
|
4428
|
+
exports.ɵq = GaliciaModule;
|
|
4429
|
+
exports.ɵr = GaliciaComponent;
|
|
4430
|
+
exports.ɵs = GaliciaApiService;
|
|
4262
4431
|
|
|
4263
4432
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4264
4433
|
|