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
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,314 +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
|
-
// Descuento explícito desde el carrito
|
|
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
|
-
if (this.discountAmountValue !== undefined && this.discountAmountValue !== null) {
|
|
3797
|
-
return this.amount + this.discountAmountValue;
|
|
3798
|
-
}
|
|
3799
|
-
return this.amount ? Math.round(this.amount / (1 - this.discountRate)) : 0;
|
|
3800
|
-
},
|
|
3801
|
-
enumerable: true,
|
|
3802
|
-
configurable: true
|
|
3803
|
-
});
|
|
3804
|
-
Object.defineProperty(BankTransferComponent.prototype, "discountAmount", {
|
|
3805
|
-
get: /**
|
|
3806
|
-
* @return {?}
|
|
3807
|
-
*/
|
|
3808
|
-
function () {
|
|
3809
|
-
if (this.discountAmountValue !== undefined && this.discountAmountValue !== null) {
|
|
3810
|
-
return this.discountAmountValue;
|
|
3811
|
-
}
|
|
3812
|
-
return this.subtotalAmount - (this.amount || 0);
|
|
3813
|
-
},
|
|
3814
|
-
enumerable: true,
|
|
3815
|
-
configurable: true
|
|
3816
|
-
});
|
|
3817
3822
|
/**
|
|
3818
3823
|
* @return {?}
|
|
3819
3824
|
*/
|
|
3820
|
-
|
|
3825
|
+
GaliciaComponent.prototype.ngOnInit = /**
|
|
3821
3826
|
* @return {?}
|
|
3822
3827
|
*/
|
|
3823
|
-
function () {
|
|
3828
|
+
function () {
|
|
3829
|
+
this.createInitPayment();
|
|
3830
|
+
};
|
|
3824
3831
|
/**
|
|
3825
|
-
* @param {?}
|
|
3832
|
+
* @param {?} datos
|
|
3826
3833
|
* @return {?}
|
|
3827
3834
|
*/
|
|
3828
|
-
|
|
3829
|
-
* @param {?}
|
|
3835
|
+
GaliciaComponent.prototype.generateQr = /**
|
|
3836
|
+
* @param {?} datos
|
|
3830
3837
|
* @return {?}
|
|
3831
3838
|
*/
|
|
3832
|
-
function (
|
|
3833
|
-
|
|
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
|
|
3834
3849
|
* @return {?}
|
|
3835
3850
|
*/
|
|
3836
|
-
function () {
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
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();
|
|
3844
3858
|
}));
|
|
3845
3859
|
};
|
|
3846
3860
|
/**
|
|
3847
3861
|
* @return {?}
|
|
3848
3862
|
*/
|
|
3849
|
-
|
|
3863
|
+
GaliciaComponent.prototype.createInitPayment = /**
|
|
3850
3864
|
* @return {?}
|
|
3851
3865
|
*/
|
|
3852
3866
|
function () {
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
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();
|
|
3862
3875
|
};
|
|
3863
3876
|
/**
|
|
3864
3877
|
* @return {?}
|
|
3865
3878
|
*/
|
|
3866
|
-
|
|
3879
|
+
GaliciaComponent.prototype.initPayment = /**
|
|
3867
3880
|
* @return {?}
|
|
3868
3881
|
*/
|
|
3869
3882
|
function () {
|
|
3870
3883
|
var _this = this;
|
|
3871
|
-
|
|
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.';
|
|
3872
3915
|
return;
|
|
3873
|
-
|
|
3874
|
-
this.errorMessage = '';
|
|
3916
|
+
}
|
|
3875
3917
|
/** @type {?} */
|
|
3876
|
-
var
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
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((/**
|
|
3886
3951
|
* @return {?}
|
|
3887
3952
|
*/
|
|
3888
|
-
function (
|
|
3889
|
-
_this.
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
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;
|
|
3897
3963
|
}
|
|
3898
3964
|
else {
|
|
3899
|
-
_this.
|
|
3900
|
-
? response.errorsMessages[0]
|
|
3901
|
-
: 'Ocurrió un error al registrar la transferencia.';
|
|
3902
|
-
_this.statusPay.emit({
|
|
3903
|
-
success: false,
|
|
3904
|
-
paymentId: '',
|
|
3905
|
-
integrator: 'BANK_TRANSFER'
|
|
3906
|
-
});
|
|
3965
|
+
_this.seconds--;
|
|
3907
3966
|
}
|
|
3908
|
-
}),
|
|
3909
|
-
* @param {?} error
|
|
3910
|
-
* @return {?}
|
|
3911
|
-
*/
|
|
3912
|
-
function (error) {
|
|
3913
|
-
_this.isLoading = false;
|
|
3914
|
-
_this.errorMessage = (error && error.error && error.error.errorsMessages && error.error.errorsMessages.length > 0)
|
|
3915
|
-
? error.error.errorsMessages[0]
|
|
3916
|
-
: 'Ocurrió un error de conexión al registrar la transferencia.';
|
|
3917
|
-
_this.statusPay.emit({
|
|
3918
|
-
success: false,
|
|
3919
|
-
paymentId: '',
|
|
3920
|
-
integrator: 'BANK_TRANSFER'
|
|
3921
|
-
});
|
|
3922
|
-
console.error('Error BankTransferApiService:', error);
|
|
3923
|
-
}));
|
|
3967
|
+
}), 1000);
|
|
3924
3968
|
};
|
|
3925
|
-
|
|
3926
|
-
|
|
3969
|
+
/**
|
|
3970
|
+
* @return {?}
|
|
3971
|
+
*/
|
|
3972
|
+
GaliciaComponent.prototype.startPaymentValidation = /**
|
|
3973
|
+
* @return {?}
|
|
3974
|
+
*/
|
|
3975
|
+
function () {
|
|
3976
|
+
var _this = this;
|
|
3977
|
+
this.validationInterval = setInterval((/**
|
|
3927
3978
|
* @return {?}
|
|
3928
3979
|
*/
|
|
3929
3980
|
function () {
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
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 = [
|
|
3936
4064
|
{ type: Component, args: [{
|
|
3937
|
-
selector: '
|
|
3938
|
-
template: "<
|
|
3939
|
-
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)}}"]
|
|
3940
4068
|
}] }
|
|
3941
4069
|
];
|
|
3942
4070
|
/** @nocollapse */
|
|
3943
|
-
|
|
3944
|
-
{ type:
|
|
4071
|
+
GaliciaComponent.ctorParameters = function () { return [
|
|
4072
|
+
{ type: GaliciaApiService }
|
|
3945
4073
|
]; };
|
|
3946
|
-
|
|
4074
|
+
GaliciaComponent.propDecorators = {
|
|
3947
4075
|
accessToken: [{ type: Input }],
|
|
4076
|
+
gaUrlApi: [{ type: Input }],
|
|
3948
4077
|
vkUrlApi: [{ type: Input }],
|
|
3949
|
-
|
|
4078
|
+
userId: [{ type: Input }],
|
|
4079
|
+
logoGa: [{ type: Input }],
|
|
3950
4080
|
storeId: [{ type: Input }],
|
|
3951
4081
|
storeName: [{ type: Input }],
|
|
4082
|
+
sessionId: [{ type: Input }],
|
|
3952
4083
|
checkoutId: [{ type: Input }],
|
|
3953
|
-
|
|
3954
|
-
discountRate: [{ type: Input }],
|
|
3955
|
-
discountAmountValue: [{ type: Input }],
|
|
4084
|
+
data: [{ type: Input }],
|
|
3956
4085
|
statusPay: [{ type: Output }]
|
|
3957
4086
|
};
|
|
3958
|
-
return
|
|
4087
|
+
return GaliciaComponent;
|
|
3959
4088
|
}());
|
|
3960
4089
|
if (false) {
|
|
3961
4090
|
/** @type {?} */
|
|
3962
|
-
|
|
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;
|
|
3963
4100
|
/** @type {?} */
|
|
3964
|
-
|
|
4101
|
+
GaliciaComponent.prototype.storeId;
|
|
3965
4102
|
/** @type {?} */
|
|
3966
|
-
|
|
4103
|
+
GaliciaComponent.prototype.storeName;
|
|
3967
4104
|
/** @type {?} */
|
|
3968
|
-
|
|
4105
|
+
GaliciaComponent.prototype.sessionId;
|
|
3969
4106
|
/** @type {?} */
|
|
3970
|
-
|
|
4107
|
+
GaliciaComponent.prototype.checkoutId;
|
|
3971
4108
|
/** @type {?} */
|
|
3972
|
-
|
|
4109
|
+
GaliciaComponent.prototype.data;
|
|
3973
4110
|
/** @type {?} */
|
|
3974
|
-
|
|
4111
|
+
GaliciaComponent.prototype.statusPay;
|
|
3975
4112
|
/** @type {?} */
|
|
3976
|
-
|
|
4113
|
+
GaliciaComponent.prototype.qrImage;
|
|
3977
4114
|
/** @type {?} */
|
|
3978
|
-
|
|
4115
|
+
GaliciaComponent.prototype.billNumber;
|
|
3979
4116
|
/** @type {?} */
|
|
3980
|
-
|
|
4117
|
+
GaliciaComponent.prototype.errorMessage;
|
|
3981
4118
|
/** @type {?} */
|
|
3982
|
-
|
|
4119
|
+
GaliciaComponent.prototype.OinitPayment;
|
|
3983
4120
|
/** @type {?} */
|
|
3984
|
-
|
|
4121
|
+
GaliciaComponent.prototype.isGeneratingQr;
|
|
3985
4122
|
/** @type {?} */
|
|
3986
|
-
|
|
4123
|
+
GaliciaComponent.prototype.paymentCompleted;
|
|
3987
4124
|
/** @type {?} */
|
|
3988
|
-
|
|
4125
|
+
GaliciaComponent.prototype.paymentId;
|
|
3989
4126
|
/** @type {?} */
|
|
3990
|
-
|
|
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;
|
|
3991
4138
|
/**
|
|
3992
4139
|
* @type {?}
|
|
3993
4140
|
* @private
|
|
3994
4141
|
*/
|
|
3995
|
-
|
|
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;
|
|
3996
4152
|
}
|
|
3997
4153
|
|
|
3998
4154
|
/**
|
|
3999
4155
|
* @fileoverview added by tsickle
|
|
4000
|
-
* Generated from: lib/
|
|
4156
|
+
* Generated from: lib/galicia/galicia.module.ts
|
|
4001
4157
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4002
4158
|
*/
|
|
4003
|
-
|
|
4004
|
-
|
|
4159
|
+
/** @type {?} */
|
|
4160
|
+
var COMPONENTS$2 = [
|
|
4161
|
+
GaliciaComponent
|
|
4162
|
+
];
|
|
4163
|
+
var GaliciaModule = /** @class */ (function () {
|
|
4164
|
+
function GaliciaModule() {
|
|
4005
4165
|
}
|
|
4006
|
-
|
|
4166
|
+
GaliciaModule.decorators = [
|
|
4007
4167
|
{ type: NgModule, args: [{
|
|
4008
4168
|
declarations: [
|
|
4009
|
-
|
|
4169
|
+
COMPONENTS$2
|
|
4170
|
+
],
|
|
4171
|
+
exports: [
|
|
4172
|
+
COMPONENTS$2
|
|
4010
4173
|
],
|
|
4011
4174
|
imports: [
|
|
4012
4175
|
CommonModule,
|
|
4013
4176
|
FormsModule,
|
|
4014
4177
|
ReactiveFormsModule,
|
|
4015
|
-
|
|
4016
|
-
],
|
|
4017
|
-
exports: [
|
|
4018
|
-
BankTransferComponent
|
|
4178
|
+
RouterModule,
|
|
4019
4179
|
],
|
|
4020
4180
|
providers: [
|
|
4021
|
-
|
|
4181
|
+
GaliciaApiService
|
|
4022
4182
|
]
|
|
4023
4183
|
},] }
|
|
4024
4184
|
];
|
|
4025
|
-
return
|
|
4185
|
+
return GaliciaModule;
|
|
4026
4186
|
}());
|
|
4027
4187
|
|
|
4028
4188
|
/**
|
|
@@ -4037,7 +4197,7 @@ var LIB_MODULES = [
|
|
|
4037
4197
|
PaypalModule,
|
|
4038
4198
|
GoCuotasModule,
|
|
4039
4199
|
ModoModule,
|
|
4040
|
-
|
|
4200
|
+
GaliciaModule
|
|
4041
4201
|
];
|
|
4042
4202
|
var VkPaymentsModule = /** @class */ (function () {
|
|
4043
4203
|
function VkPaymentsModule() {
|
|
@@ -4045,7 +4205,8 @@ var VkPaymentsModule = /** @class */ (function () {
|
|
|
4045
4205
|
VkPaymentsModule.decorators = [
|
|
4046
4206
|
{ type: NgModule, args: [{
|
|
4047
4207
|
imports: LIB_MODULES,
|
|
4048
|
-
exports: LIB_MODULES
|
|
4208
|
+
exports: LIB_MODULES,
|
|
4209
|
+
declarations: []
|
|
4049
4210
|
},] }
|
|
4050
4211
|
];
|
|
4051
4212
|
return VkPaymentsModule;
|
|
@@ -4063,5 +4224,5 @@ var VkPaymentsModule = /** @class */ (function () {
|
|
|
4063
4224
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4064
4225
|
*/
|
|
4065
4226
|
|
|
4066
|
-
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 };
|
|
4067
4228
|
//# sourceMappingURL=vk-payments.js.map
|