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
package/fesm5/vk-payments.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Injectable, ɵɵdefineInjectable, ɵɵinject, EventEmitter, Component, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { FormsModule, ReactiveFormsModule
|
|
3
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
4
|
import { Router, RouterModule } from '@angular/router';
|
|
5
5
|
import { __values, __awaiter, __generator } from 'tslib';
|
|
6
6
|
import { HttpHeaders, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
7
7
|
import sha256 from 'sha256';
|
|
8
|
+
import { toDataURL } from 'qrcode';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* @fileoverview added by tsickle
|
|
@@ -3715,305 +3716,473 @@ var ModoModule = /** @class */ (function () {
|
|
|
3715
3716
|
|
|
3716
3717
|
/**
|
|
3717
3718
|
* @fileoverview added by tsickle
|
|
3718
|
-
* Generated from: lib/
|
|
3719
|
+
* Generated from: lib/galicia/services/galicia.api.service.ts
|
|
3719
3720
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3720
3721
|
*/
|
|
3721
|
-
var
|
|
3722
|
-
function
|
|
3723
|
-
this.
|
|
3722
|
+
var GaliciaApiService = /** @class */ (function () {
|
|
3723
|
+
function GaliciaApiService(httpClient) {
|
|
3724
|
+
this.httpClient = httpClient;
|
|
3724
3725
|
}
|
|
3725
3726
|
/**
|
|
3726
|
-
* @param {?}
|
|
3727
|
-
* @param {?} request
|
|
3728
|
-
* @param {?} vkApiUrl
|
|
3727
|
+
* @param {?} url
|
|
3729
3728
|
* @return {?}
|
|
3730
3729
|
*/
|
|
3731
|
-
|
|
3732
|
-
* @param {?}
|
|
3733
|
-
* @param {?} request
|
|
3734
|
-
* @param {?} vkApiUrl
|
|
3730
|
+
GaliciaApiService.prototype.normalizeUrl = /**
|
|
3731
|
+
* @param {?} url
|
|
3735
3732
|
* @return {?}
|
|
3736
3733
|
*/
|
|
3737
|
-
function (
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3734
|
+
function (url) {
|
|
3735
|
+
if (url.length > 0 && url.charAt(url.length - 1) == '/') {
|
|
3736
|
+
url = url.substr(0, url.length - 1);
|
|
3737
|
+
}
|
|
3738
|
+
return url;
|
|
3739
|
+
};
|
|
3740
|
+
/**
|
|
3741
|
+
* @param {?} url
|
|
3742
|
+
* @param {?} initPayment
|
|
3743
|
+
* @return {?}
|
|
3744
|
+
*/
|
|
3745
|
+
GaliciaApiService.prototype.initPayment = /**
|
|
3746
|
+
* @param {?} url
|
|
3747
|
+
* @param {?} initPayment
|
|
3748
|
+
* @return {?}
|
|
3749
|
+
*/
|
|
3750
|
+
function (url, initPayment) {
|
|
3744
3751
|
/** @type {?} */
|
|
3745
|
-
var
|
|
3746
|
-
|
|
3752
|
+
var body = {
|
|
3753
|
+
storeId: initPayment.storeId,
|
|
3754
|
+
userId: initPayment.userId,
|
|
3755
|
+
sessionId: initPayment.sessionId,
|
|
3756
|
+
storeName: initPayment.storeName,
|
|
3757
|
+
checkoutId: initPayment.checkoutId
|
|
3758
|
+
};
|
|
3759
|
+
return this.httpClient.post(this.normalizeUrl(url) + '/init-payment', body);
|
|
3747
3760
|
};
|
|
3748
|
-
|
|
3761
|
+
/**
|
|
3762
|
+
* @param {?} url
|
|
3763
|
+
* @param {?} billNumber
|
|
3764
|
+
* @return {?}
|
|
3765
|
+
*/
|
|
3766
|
+
GaliciaApiService.prototype.paymentStatus = /**
|
|
3767
|
+
* @param {?} url
|
|
3768
|
+
* @param {?} billNumber
|
|
3769
|
+
* @return {?}
|
|
3770
|
+
*/
|
|
3771
|
+
function (url, billNumber) {
|
|
3772
|
+
return this.httpClient.get(this.normalizeUrl(url) + '/payment-status?billNumber=' + billNumber);
|
|
3773
|
+
};
|
|
3774
|
+
GaliciaApiService.decorators = [
|
|
3749
3775
|
{ type: Injectable, args: [{
|
|
3750
3776
|
providedIn: 'root'
|
|
3751
3777
|
},] }
|
|
3752
3778
|
];
|
|
3753
3779
|
/** @nocollapse */
|
|
3754
|
-
|
|
3780
|
+
GaliciaApiService.ctorParameters = function () { return [
|
|
3755
3781
|
{ type: HttpClient }
|
|
3756
3782
|
]; };
|
|
3757
|
-
/** @nocollapse */
|
|
3758
|
-
return
|
|
3783
|
+
/** @nocollapse */ GaliciaApiService.ngInjectableDef = ɵɵdefineInjectable({ factory: function GaliciaApiService_Factory() { return new GaliciaApiService(ɵɵinject(HttpClient)); }, token: GaliciaApiService, providedIn: "root" });
|
|
3784
|
+
return GaliciaApiService;
|
|
3759
3785
|
}());
|
|
3760
3786
|
if (false) {
|
|
3761
3787
|
/**
|
|
3762
3788
|
* @type {?}
|
|
3763
3789
|
* @private
|
|
3764
3790
|
*/
|
|
3765
|
-
|
|
3791
|
+
GaliciaApiService.prototype.authHeaders;
|
|
3792
|
+
/**
|
|
3793
|
+
* @type {?}
|
|
3794
|
+
* @private
|
|
3795
|
+
*/
|
|
3796
|
+
GaliciaApiService.prototype.httpClient;
|
|
3766
3797
|
}
|
|
3767
3798
|
|
|
3768
3799
|
/**
|
|
3769
3800
|
* @fileoverview added by tsickle
|
|
3770
|
-
* Generated from: lib/
|
|
3801
|
+
* Generated from: lib/galicia/components/galicia.component.ts
|
|
3771
3802
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3772
3803
|
*/
|
|
3773
|
-
var
|
|
3774
|
-
function
|
|
3775
|
-
this.
|
|
3776
|
-
this.discountRate = 0.10; // Tasa de descuento (10% por defecto)
|
|
3777
|
-
// Tasa de descuento (10% por defecto)
|
|
3804
|
+
var GaliciaComponent = /** @class */ (function () {
|
|
3805
|
+
function GaliciaComponent(galiciaApiService) {
|
|
3806
|
+
this.galiciaApiService = galiciaApiService;
|
|
3778
3807
|
this.statusPay = new EventEmitter();
|
|
3779
|
-
this.
|
|
3808
|
+
this.qrImage = '';
|
|
3809
|
+
this.billNumber = '';
|
|
3780
3810
|
this.errorMessage = '';
|
|
3781
|
-
this.
|
|
3782
|
-
this.
|
|
3783
|
-
|
|
3784
|
-
this.
|
|
3785
|
-
|
|
3786
|
-
|
|
3811
|
+
this.isGeneratingQr = true;
|
|
3812
|
+
this.paymentCompleted = false;
|
|
3813
|
+
this.paymentId = '';
|
|
3814
|
+
this.showQr = false;
|
|
3815
|
+
this.expired = false;
|
|
3816
|
+
this.isLoading = false;
|
|
3817
|
+
this.hasError = false;
|
|
3818
|
+
this.minutes = 0;
|
|
3819
|
+
this.seconds = 0;
|
|
3820
|
+
this.paymentResult = { success: false, paymentId: '', integrator: 'GALICIA' };
|
|
3787
3821
|
}
|
|
3788
|
-
Object.defineProperty(BankTransferComponent.prototype, "subtotalAmount", {
|
|
3789
|
-
// Calculados a partir de `amount` (que ya tiene el descuento aplicado)
|
|
3790
|
-
get:
|
|
3791
|
-
// Calculados a partir de `amount` (que ya tiene el descuento aplicado)
|
|
3792
|
-
/**
|
|
3793
|
-
* @return {?}
|
|
3794
|
-
*/
|
|
3795
|
-
function () {
|
|
3796
|
-
return this.amount ? Math.round(this.amount / (1 - this.discountRate)) : 0;
|
|
3797
|
-
},
|
|
3798
|
-
enumerable: true,
|
|
3799
|
-
configurable: true
|
|
3800
|
-
});
|
|
3801
|
-
Object.defineProperty(BankTransferComponent.prototype, "discountAmount", {
|
|
3802
|
-
get: /**
|
|
3803
|
-
* @return {?}
|
|
3804
|
-
*/
|
|
3805
|
-
function () {
|
|
3806
|
-
return this.subtotalAmount - (this.amount || 0);
|
|
3807
|
-
},
|
|
3808
|
-
enumerable: true,
|
|
3809
|
-
configurable: true
|
|
3810
|
-
});
|
|
3811
3822
|
/**
|
|
3812
3823
|
* @return {?}
|
|
3813
3824
|
*/
|
|
3814
|
-
|
|
3825
|
+
GaliciaComponent.prototype.ngOnInit = /**
|
|
3815
3826
|
* @return {?}
|
|
3816
3827
|
*/
|
|
3817
|
-
function () {
|
|
3828
|
+
function () {
|
|
3829
|
+
this.createInitPayment();
|
|
3830
|
+
};
|
|
3818
3831
|
/**
|
|
3819
|
-
* @param {?}
|
|
3832
|
+
* @param {?} datos
|
|
3820
3833
|
* @return {?}
|
|
3821
3834
|
*/
|
|
3822
|
-
|
|
3823
|
-
* @param {?}
|
|
3835
|
+
GaliciaComponent.prototype.generateQr = /**
|
|
3836
|
+
* @param {?} datos
|
|
3824
3837
|
* @return {?}
|
|
3825
3838
|
*/
|
|
3826
|
-
function (
|
|
3827
|
-
|
|
3839
|
+
function (datos) {
|
|
3840
|
+
var _this = this;
|
|
3841
|
+
/** @type {?} */
|
|
3842
|
+
var decoded = atob(datos);
|
|
3843
|
+
toDataURL(decoded, {
|
|
3844
|
+
width: 300,
|
|
3845
|
+
margin: 2
|
|
3846
|
+
})
|
|
3847
|
+
.then((/**
|
|
3848
|
+
* @param {?} url
|
|
3828
3849
|
* @return {?}
|
|
3829
3850
|
*/
|
|
3830
|
-
function () {
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
document.body.removeChild(el);
|
|
3851
|
+
function (url) {
|
|
3852
|
+
_this.qrImage = url;
|
|
3853
|
+
_this.isGeneratingQr = false;
|
|
3854
|
+
_this.showQr = true;
|
|
3855
|
+
_this.expired = false;
|
|
3856
|
+
_this.startTimer();
|
|
3857
|
+
_this.startPaymentValidation();
|
|
3838
3858
|
}));
|
|
3839
3859
|
};
|
|
3840
3860
|
/**
|
|
3841
3861
|
* @return {?}
|
|
3842
3862
|
*/
|
|
3843
|
-
|
|
3863
|
+
GaliciaComponent.prototype.createInitPayment = /**
|
|
3844
3864
|
* @return {?}
|
|
3845
3865
|
*/
|
|
3846
3866
|
function () {
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
function () { return _this.amountCopied = false; }), 2000);
|
|
3867
|
+
this.OinitPayment = {
|
|
3868
|
+
sessionId: '',
|
|
3869
|
+
userId: this.userId,
|
|
3870
|
+
storeId: this.storeId,
|
|
3871
|
+
storeName: this.storeName,
|
|
3872
|
+
checkoutId: this.checkoutId
|
|
3873
|
+
};
|
|
3874
|
+
this.initPayment();
|
|
3856
3875
|
};
|
|
3857
3876
|
/**
|
|
3858
3877
|
* @return {?}
|
|
3859
3878
|
*/
|
|
3860
|
-
|
|
3879
|
+
GaliciaComponent.prototype.initPayment = /**
|
|
3861
3880
|
* @return {?}
|
|
3862
3881
|
*/
|
|
3863
3882
|
function () {
|
|
3864
3883
|
var _this = this;
|
|
3865
|
-
|
|
3884
|
+
this.isGeneratingQr = true;
|
|
3885
|
+
this.galiciaApiService.initPayment(this.vkUrlApi, this.OinitPayment)
|
|
3886
|
+
.subscribe({
|
|
3887
|
+
next: (/**
|
|
3888
|
+
* @param {?} v
|
|
3889
|
+
* @return {?}
|
|
3890
|
+
*/
|
|
3891
|
+
function (v) { return _this.initPaymentResponseHandler(v); }),
|
|
3892
|
+
error: (/**
|
|
3893
|
+
* @param {?} v
|
|
3894
|
+
* @return {?}
|
|
3895
|
+
*/
|
|
3896
|
+
function (v) { return _this.initPaymentErrorHandler(v); })
|
|
3897
|
+
});
|
|
3898
|
+
};
|
|
3899
|
+
/**
|
|
3900
|
+
* @private
|
|
3901
|
+
* @param {?} response
|
|
3902
|
+
* @return {?}
|
|
3903
|
+
*/
|
|
3904
|
+
GaliciaComponent.prototype.initPaymentResponseHandler = /**
|
|
3905
|
+
* @private
|
|
3906
|
+
* @param {?} response
|
|
3907
|
+
* @return {?}
|
|
3908
|
+
*/
|
|
3909
|
+
function (response) {
|
|
3910
|
+
if (!response.success) {
|
|
3911
|
+
this.isLoading = false;
|
|
3912
|
+
this.hasError = true;
|
|
3913
|
+
this.statusPay.emit(this.paymentResult);
|
|
3914
|
+
this.errorMessage = response.errorsMessages[0] || 'Ocurrió un error al generar el código QR.';
|
|
3866
3915
|
return;
|
|
3867
|
-
|
|
3868
|
-
this.errorMessage = '';
|
|
3916
|
+
}
|
|
3869
3917
|
/** @type {?} */
|
|
3870
|
-
var
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3918
|
+
var qrData = response.data.bills[0].qr.datos;
|
|
3919
|
+
this.billNumber = response.data.bills[0].nroBoleta;
|
|
3920
|
+
this.generateQr(qrData);
|
|
3921
|
+
};
|
|
3922
|
+
/**
|
|
3923
|
+
* @private
|
|
3924
|
+
* @param {?} error
|
|
3925
|
+
* @return {?}
|
|
3926
|
+
*/
|
|
3927
|
+
GaliciaComponent.prototype.initPaymentErrorHandler = /**
|
|
3928
|
+
* @private
|
|
3929
|
+
* @param {?} error
|
|
3930
|
+
* @return {?}
|
|
3931
|
+
*/
|
|
3932
|
+
function (error) {
|
|
3933
|
+
this.isLoading = false;
|
|
3934
|
+
this.hasError = true;
|
|
3935
|
+
this.errorMessage = error.errorsMessages[0] || 'Ocurrió un error al generar el código QR.';
|
|
3936
|
+
this.paymentResult.success = false;
|
|
3937
|
+
this.statusPay.emit(this.paymentResult);
|
|
3938
|
+
};
|
|
3939
|
+
/**
|
|
3940
|
+
* @return {?}
|
|
3941
|
+
*/
|
|
3942
|
+
GaliciaComponent.prototype.startTimer = /**
|
|
3943
|
+
* @return {?}
|
|
3944
|
+
*/
|
|
3945
|
+
function () {
|
|
3946
|
+
var _this = this;
|
|
3947
|
+
clearInterval(this.interval);
|
|
3948
|
+
this.minutes = 1;
|
|
3949
|
+
this.seconds = 0;
|
|
3950
|
+
this.interval = setInterval((/**
|
|
3880
3951
|
* @return {?}
|
|
3881
3952
|
*/
|
|
3882
|
-
function (
|
|
3883
|
-
_this.
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3953
|
+
function () {
|
|
3954
|
+
if (_this.seconds === 0) {
|
|
3955
|
+
if (_this.minutes === 0) {
|
|
3956
|
+
_this.stopValidation();
|
|
3957
|
+
_this.showQr = false;
|
|
3958
|
+
_this.expired = true;
|
|
3959
|
+
return;
|
|
3960
|
+
}
|
|
3961
|
+
_this.minutes--;
|
|
3962
|
+
_this.seconds = 59;
|
|
3891
3963
|
}
|
|
3892
3964
|
else {
|
|
3893
|
-
_this.
|
|
3894
|
-
? response.errorsMessages[0]
|
|
3895
|
-
: 'Ocurrió un error al registrar la transferencia.';
|
|
3896
|
-
_this.statusPay.emit({
|
|
3897
|
-
success: false,
|
|
3898
|
-
paymentId: '',
|
|
3899
|
-
integrator: 'BANK_TRANSFER'
|
|
3900
|
-
});
|
|
3965
|
+
_this.seconds--;
|
|
3901
3966
|
}
|
|
3902
|
-
}),
|
|
3903
|
-
* @param {?} error
|
|
3904
|
-
* @return {?}
|
|
3905
|
-
*/
|
|
3906
|
-
function (error) {
|
|
3907
|
-
_this.isLoading = false;
|
|
3908
|
-
_this.errorMessage = (error && error.error && error.error.errorsMessages && error.error.errorsMessages.length > 0)
|
|
3909
|
-
? error.error.errorsMessages[0]
|
|
3910
|
-
: 'Ocurrió un error de conexión al registrar la transferencia.';
|
|
3911
|
-
_this.statusPay.emit({
|
|
3912
|
-
success: false,
|
|
3913
|
-
paymentId: '',
|
|
3914
|
-
integrator: 'BANK_TRANSFER'
|
|
3915
|
-
});
|
|
3916
|
-
console.error('Error BankTransferApiService:', error);
|
|
3917
|
-
}));
|
|
3967
|
+
}), 1000);
|
|
3918
3968
|
};
|
|
3919
|
-
|
|
3920
|
-
|
|
3969
|
+
/**
|
|
3970
|
+
* @return {?}
|
|
3971
|
+
*/
|
|
3972
|
+
GaliciaComponent.prototype.startPaymentValidation = /**
|
|
3973
|
+
* @return {?}
|
|
3974
|
+
*/
|
|
3975
|
+
function () {
|
|
3976
|
+
var _this = this;
|
|
3977
|
+
this.validationInterval = setInterval((/**
|
|
3921
3978
|
* @return {?}
|
|
3922
3979
|
*/
|
|
3923
3980
|
function () {
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3981
|
+
_this.galiciaApiService.paymentStatus(_this.vkUrlApi, _this.billNumber)
|
|
3982
|
+
.subscribe({
|
|
3983
|
+
next: (/**
|
|
3984
|
+
* @param {?} v
|
|
3985
|
+
* @return {?}
|
|
3986
|
+
*/
|
|
3987
|
+
function (v) { return _this.paymentStatusResponseHandler(v); }),
|
|
3988
|
+
error: (/**
|
|
3989
|
+
* @param {?} v
|
|
3990
|
+
* @return {?}
|
|
3991
|
+
*/
|
|
3992
|
+
function (v) { return _this.paymentStatusErrorHandler(v); })
|
|
3993
|
+
});
|
|
3994
|
+
}), 5000);
|
|
3995
|
+
};
|
|
3996
|
+
/**
|
|
3997
|
+
* @param {?} response
|
|
3998
|
+
* @return {?}
|
|
3999
|
+
*/
|
|
4000
|
+
GaliciaComponent.prototype.paymentStatusResponseHandler = /**
|
|
4001
|
+
* @param {?} response
|
|
4002
|
+
* @return {?}
|
|
4003
|
+
*/
|
|
4004
|
+
function (response) {
|
|
4005
|
+
console.log(response);
|
|
4006
|
+
if (!response.success) {
|
|
4007
|
+
this.isLoading = false;
|
|
4008
|
+
this.statusPay.emit(this.paymentResult);
|
|
4009
|
+
return;
|
|
4010
|
+
}
|
|
4011
|
+
if (response.data.isPaid) {
|
|
4012
|
+
this.stopValidation();
|
|
4013
|
+
this.showQr = false;
|
|
4014
|
+
this.expired = false;
|
|
4015
|
+
this.paymentCompleted = true;
|
|
4016
|
+
this.paymentId = response.data.paymentId;
|
|
4017
|
+
this.paymentResult = {
|
|
4018
|
+
success: true,
|
|
4019
|
+
paymentId: this.paymentId,
|
|
4020
|
+
integrator: 'GALICIA'
|
|
4021
|
+
};
|
|
4022
|
+
this.statusPay.emit(this.paymentResult);
|
|
4023
|
+
}
|
|
4024
|
+
};
|
|
4025
|
+
/**
|
|
4026
|
+
* @private
|
|
4027
|
+
* @param {?} error
|
|
4028
|
+
* @return {?}
|
|
4029
|
+
*/
|
|
4030
|
+
GaliciaComponent.prototype.paymentStatusErrorHandler = /**
|
|
4031
|
+
* @private
|
|
4032
|
+
* @param {?} error
|
|
4033
|
+
* @return {?}
|
|
4034
|
+
*/
|
|
4035
|
+
function (error) {
|
|
4036
|
+
clearInterval(this.validationInterval);
|
|
4037
|
+
this.hasError = true;
|
|
4038
|
+
};
|
|
4039
|
+
/**
|
|
4040
|
+
* @return {?}
|
|
4041
|
+
*/
|
|
4042
|
+
GaliciaComponent.prototype.showQrAgain = /**
|
|
4043
|
+
* @return {?}
|
|
4044
|
+
*/
|
|
4045
|
+
function () {
|
|
4046
|
+
this.showQr = true;
|
|
4047
|
+
this.expired = false;
|
|
4048
|
+
this.startTimer();
|
|
4049
|
+
this.startPaymentValidation();
|
|
4050
|
+
};
|
|
4051
|
+
/**
|
|
4052
|
+
* @private
|
|
4053
|
+
* @return {?}
|
|
4054
|
+
*/
|
|
4055
|
+
GaliciaComponent.prototype.stopValidation = /**
|
|
4056
|
+
* @private
|
|
4057
|
+
* @return {?}
|
|
4058
|
+
*/
|
|
4059
|
+
function () {
|
|
4060
|
+
clearInterval(this.validationInterval);
|
|
4061
|
+
clearInterval(this.interval);
|
|
4062
|
+
};
|
|
4063
|
+
GaliciaComponent.decorators = [
|
|
3930
4064
|
{ type: Component, args: [{
|
|
3931
|
-
selector: '
|
|
3932
|
-
template: "<
|
|
3933
|
-
styles: [".
|
|
4065
|
+
selector: 'lib-galicia',
|
|
4066
|
+
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>",
|
|
4067
|
+
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)}}"]
|
|
3934
4068
|
}] }
|
|
3935
4069
|
];
|
|
3936
4070
|
/** @nocollapse */
|
|
3937
|
-
|
|
3938
|
-
{ type:
|
|
4071
|
+
GaliciaComponent.ctorParameters = function () { return [
|
|
4072
|
+
{ type: GaliciaApiService }
|
|
3939
4073
|
]; };
|
|
3940
|
-
|
|
4074
|
+
GaliciaComponent.propDecorators = {
|
|
3941
4075
|
accessToken: [{ type: Input }],
|
|
4076
|
+
gaUrlApi: [{ type: Input }],
|
|
3942
4077
|
vkUrlApi: [{ type: Input }],
|
|
3943
|
-
|
|
4078
|
+
userId: [{ type: Input }],
|
|
4079
|
+
logoGa: [{ type: Input }],
|
|
3944
4080
|
storeId: [{ type: Input }],
|
|
3945
4081
|
storeName: [{ type: Input }],
|
|
4082
|
+
sessionId: [{ type: Input }],
|
|
3946
4083
|
checkoutId: [{ type: Input }],
|
|
3947
|
-
|
|
3948
|
-
discountRate: [{ type: Input }],
|
|
4084
|
+
data: [{ type: Input }],
|
|
3949
4085
|
statusPay: [{ type: Output }]
|
|
3950
4086
|
};
|
|
3951
|
-
return
|
|
4087
|
+
return GaliciaComponent;
|
|
3952
4088
|
}());
|
|
3953
4089
|
if (false) {
|
|
3954
4090
|
/** @type {?} */
|
|
3955
|
-
|
|
4091
|
+
GaliciaComponent.prototype.accessToken;
|
|
4092
|
+
/** @type {?} */
|
|
4093
|
+
GaliciaComponent.prototype.gaUrlApi;
|
|
4094
|
+
/** @type {?} */
|
|
4095
|
+
GaliciaComponent.prototype.vkUrlApi;
|
|
4096
|
+
/** @type {?} */
|
|
4097
|
+
GaliciaComponent.prototype.userId;
|
|
4098
|
+
/** @type {?} */
|
|
4099
|
+
GaliciaComponent.prototype.logoGa;
|
|
4100
|
+
/** @type {?} */
|
|
4101
|
+
GaliciaComponent.prototype.storeId;
|
|
3956
4102
|
/** @type {?} */
|
|
3957
|
-
|
|
4103
|
+
GaliciaComponent.prototype.storeName;
|
|
3958
4104
|
/** @type {?} */
|
|
3959
|
-
|
|
4105
|
+
GaliciaComponent.prototype.sessionId;
|
|
3960
4106
|
/** @type {?} */
|
|
3961
|
-
|
|
4107
|
+
GaliciaComponent.prototype.checkoutId;
|
|
3962
4108
|
/** @type {?} */
|
|
3963
|
-
|
|
4109
|
+
GaliciaComponent.prototype.data;
|
|
3964
4110
|
/** @type {?} */
|
|
3965
|
-
|
|
4111
|
+
GaliciaComponent.prototype.statusPay;
|
|
3966
4112
|
/** @type {?} */
|
|
3967
|
-
|
|
4113
|
+
GaliciaComponent.prototype.qrImage;
|
|
3968
4114
|
/** @type {?} */
|
|
3969
|
-
|
|
4115
|
+
GaliciaComponent.prototype.billNumber;
|
|
3970
4116
|
/** @type {?} */
|
|
3971
|
-
|
|
4117
|
+
GaliciaComponent.prototype.errorMessage;
|
|
3972
4118
|
/** @type {?} */
|
|
3973
|
-
|
|
4119
|
+
GaliciaComponent.prototype.OinitPayment;
|
|
3974
4120
|
/** @type {?} */
|
|
3975
|
-
|
|
4121
|
+
GaliciaComponent.prototype.isGeneratingQr;
|
|
3976
4122
|
/** @type {?} */
|
|
3977
|
-
|
|
4123
|
+
GaliciaComponent.prototype.paymentCompleted;
|
|
3978
4124
|
/** @type {?} */
|
|
3979
|
-
|
|
4125
|
+
GaliciaComponent.prototype.paymentId;
|
|
3980
4126
|
/** @type {?} */
|
|
3981
|
-
|
|
4127
|
+
GaliciaComponent.prototype.showQr;
|
|
4128
|
+
/** @type {?} */
|
|
4129
|
+
GaliciaComponent.prototype.expired;
|
|
4130
|
+
/** @type {?} */
|
|
4131
|
+
GaliciaComponent.prototype.isLoading;
|
|
4132
|
+
/** @type {?} */
|
|
4133
|
+
GaliciaComponent.prototype.hasError;
|
|
4134
|
+
/** @type {?} */
|
|
4135
|
+
GaliciaComponent.prototype.minutes;
|
|
4136
|
+
/** @type {?} */
|
|
4137
|
+
GaliciaComponent.prototype.seconds;
|
|
3982
4138
|
/**
|
|
3983
4139
|
* @type {?}
|
|
3984
4140
|
* @private
|
|
3985
4141
|
*/
|
|
3986
|
-
|
|
4142
|
+
GaliciaComponent.prototype.interval;
|
|
4143
|
+
/** @type {?} */
|
|
4144
|
+
GaliciaComponent.prototype.validationInterval;
|
|
4145
|
+
/** @type {?} */
|
|
4146
|
+
GaliciaComponent.prototype.paymentResult;
|
|
4147
|
+
/**
|
|
4148
|
+
* @type {?}
|
|
4149
|
+
* @private
|
|
4150
|
+
*/
|
|
4151
|
+
GaliciaComponent.prototype.galiciaApiService;
|
|
3987
4152
|
}
|
|
3988
4153
|
|
|
3989
4154
|
/**
|
|
3990
4155
|
* @fileoverview added by tsickle
|
|
3991
|
-
* Generated from: lib/
|
|
4156
|
+
* Generated from: lib/galicia/galicia.module.ts
|
|
3992
4157
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3993
4158
|
*/
|
|
3994
|
-
|
|
3995
|
-
|
|
4159
|
+
/** @type {?} */
|
|
4160
|
+
var COMPONENTS$2 = [
|
|
4161
|
+
GaliciaComponent
|
|
4162
|
+
];
|
|
4163
|
+
var GaliciaModule = /** @class */ (function () {
|
|
4164
|
+
function GaliciaModule() {
|
|
3996
4165
|
}
|
|
3997
|
-
|
|
4166
|
+
GaliciaModule.decorators = [
|
|
3998
4167
|
{ type: NgModule, args: [{
|
|
3999
4168
|
declarations: [
|
|
4000
|
-
|
|
4169
|
+
COMPONENTS$2
|
|
4170
|
+
],
|
|
4171
|
+
exports: [
|
|
4172
|
+
COMPONENTS$2
|
|
4001
4173
|
],
|
|
4002
4174
|
imports: [
|
|
4003
4175
|
CommonModule,
|
|
4004
4176
|
FormsModule,
|
|
4005
4177
|
ReactiveFormsModule,
|
|
4006
|
-
|
|
4007
|
-
],
|
|
4008
|
-
exports: [
|
|
4009
|
-
BankTransferComponent
|
|
4178
|
+
RouterModule,
|
|
4010
4179
|
],
|
|
4011
4180
|
providers: [
|
|
4012
|
-
|
|
4181
|
+
GaliciaApiService
|
|
4013
4182
|
]
|
|
4014
4183
|
},] }
|
|
4015
4184
|
];
|
|
4016
|
-
return
|
|
4185
|
+
return GaliciaModule;
|
|
4017
4186
|
}());
|
|
4018
4187
|
|
|
4019
4188
|
/**
|
|
@@ -4028,7 +4197,7 @@ var LIB_MODULES = [
|
|
|
4028
4197
|
PaypalModule,
|
|
4029
4198
|
GoCuotasModule,
|
|
4030
4199
|
ModoModule,
|
|
4031
|
-
|
|
4200
|
+
GaliciaModule
|
|
4032
4201
|
];
|
|
4033
4202
|
var VkPaymentsModule = /** @class */ (function () {
|
|
4034
4203
|
function VkPaymentsModule() {
|
|
@@ -4036,7 +4205,8 @@ var VkPaymentsModule = /** @class */ (function () {
|
|
|
4036
4205
|
VkPaymentsModule.decorators = [
|
|
4037
4206
|
{ type: NgModule, args: [{
|
|
4038
4207
|
imports: LIB_MODULES,
|
|
4039
|
-
exports: LIB_MODULES
|
|
4208
|
+
exports: LIB_MODULES,
|
|
4209
|
+
declarations: []
|
|
4040
4210
|
},] }
|
|
4041
4211
|
];
|
|
4042
4212
|
return VkPaymentsModule;
|
|
@@ -4054,5 +4224,5 @@ var VkPaymentsModule = /** @class */ (function () {
|
|
|
4054
4224
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4055
4225
|
*/
|
|
4056
4226
|
|
|
4057
|
-
export { VkPaymentsModule, MercadopagoModule as ɵa, MercadoPagoComponent as ɵb, MercadopagoApiService as ɵc, PromotionBankComponent as ɵd, SpsDecidirModule as ɵe, SpsDecidirComponent as ɵf, SpsDecidirApiService as ɵg, PaypalModule as ɵh, PayPalNewComponent as ɵi, GoCuotasModule as ɵj, GoCuotasComponent as ɵk, ModalComponent as ɵl, GoCuotasApiService as ɵm, ModoModule as ɵn, ModoComponent as ɵo, ModoApiService as ɵp,
|
|
4227
|
+
export { VkPaymentsModule, MercadopagoModule as ɵa, MercadoPagoComponent as ɵb, MercadopagoApiService as ɵc, PromotionBankComponent as ɵd, SpsDecidirModule as ɵe, SpsDecidirComponent as ɵf, SpsDecidirApiService as ɵg, PaypalModule as ɵh, PayPalNewComponent as ɵi, GoCuotasModule as ɵj, GoCuotasComponent as ɵk, ModalComponent as ɵl, GoCuotasApiService as ɵm, ModoModule as ɵn, ModoComponent as ɵo, ModoApiService as ɵp, GaliciaModule as ɵq, GaliciaComponent as ɵr, GaliciaApiService as ɵs };
|
|
4058
4228
|
//# sourceMappingURL=vk-payments.js.map
|