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.
Files changed (39) hide show
  1. package/bundles/vk-payments.umd.js +355 -186
  2. package/bundles/vk-payments.umd.js.map +1 -1
  3. package/bundles/vk-payments.umd.min.js +1 -1
  4. package/bundles/vk-payments.umd.min.js.map +1 -1
  5. package/esm2015/lib/galicia/components/galicia.component.js +311 -0
  6. package/esm2015/lib/galicia/galicia.module.js +37 -0
  7. package/esm2015/lib/galicia/models/galicia.models.js +46 -0
  8. package/esm2015/lib/galicia/services/galicia.api.service.js +74 -0
  9. package/esm2015/lib/vk-payments.module.js +5 -4
  10. package/esm2015/vk-payments.js +4 -4
  11. package/esm5/lib/galicia/components/galicia.component.js +359 -0
  12. package/esm5/lib/galicia/galicia.module.js +41 -0
  13. package/esm5/lib/galicia/models/galicia.models.js +46 -0
  14. package/esm5/lib/galicia/services/galicia.api.service.js +87 -0
  15. package/esm5/lib/vk-payments.module.js +5 -4
  16. package/esm5/vk-payments.js +4 -4
  17. package/fesm2015/vk-payments.js +291 -149
  18. package/fesm2015/vk-payments.js.map +1 -1
  19. package/fesm5/vk-payments.js +351 -181
  20. package/fesm5/vk-payments.js.map +1 -1
  21. package/lib/galicia/components/galicia.component.d.ts +46 -0
  22. package/lib/galicia/galicia.module.d.ts +2 -0
  23. package/lib/galicia/models/galicia.models.d.ts +17 -0
  24. package/lib/galicia/services/galicia.api.service.d.ts +11 -0
  25. package/package.json +4 -1
  26. package/vk-payments.d.ts +3 -3
  27. package/vk-payments.metadata.json +1 -1
  28. package/esm2015/lib/bank-transfer/bank-transfer.module.js +0 -33
  29. package/esm2015/lib/bank-transfer/components/bank-transfer.component.js +0 -197
  30. package/esm2015/lib/bank-transfer/models/bank-transfer.models.js +0 -54
  31. package/esm2015/lib/bank-transfer/services/bank-transfer.api.service.js +0 -52
  32. package/esm5/lib/bank-transfer/bank-transfer.module.js +0 -37
  33. package/esm5/lib/bank-transfer/components/bank-transfer.component.js +0 -225
  34. package/esm5/lib/bank-transfer/models/bank-transfer.models.js +0 -54
  35. package/esm5/lib/bank-transfer/services/bank-transfer.api.service.js +0 -57
  36. package/lib/bank-transfer/bank-transfer.module.d.ts +0 -2
  37. package/lib/bank-transfer/components/bank-transfer.component.d.ts +0 -29
  38. package/lib/bank-transfer/models/bank-transfer.models.d.ts +0 -20
  39. package/lib/bank-transfer/services/bank-transfer.api.service.d.ts +0 -8
@@ -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, FormGroup, FormControl } from '@angular/forms';
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/bank-transfer/services/bank-transfer.api.service.ts
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 BankTransferApiService = /** @class */ (function () {
3722
- function BankTransferApiService(http) {
3723
- this.http = http;
3722
+ var GaliciaApiService = /** @class */ (function () {
3723
+ function GaliciaApiService(httpClient) {
3724
+ this.httpClient = httpClient;
3724
3725
  }
3725
3726
  /**
3726
- * @param {?} accessToken
3727
- * @param {?} request
3728
- * @param {?} vkApiUrl
3727
+ * @param {?} url
3729
3728
  * @return {?}
3730
3729
  */
3731
- BankTransferApiService.prototype.createPayment = /**
3732
- * @param {?} accessToken
3733
- * @param {?} request
3734
- * @param {?} vkApiUrl
3730
+ GaliciaApiService.prototype.normalizeUrl = /**
3731
+ * @param {?} url
3735
3732
  * @return {?}
3736
3733
  */
3737
- function (accessToken, request, vkApiUrl) {
3738
- /** @type {?} */
3739
- var headers = new HttpHeaders({
3740
- 'Content-Type': 'application/json',
3741
- Authorization: "Bearer " + accessToken
3742
- });
3743
- // Construimos la URL agregando la rute del Controller de BankTransfer
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 url = vkApiUrl + "payments/BankTransfer/create-payment";
3746
- return this.http.post(url, request, { headers: headers });
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
- BankTransferApiService.decorators = [
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
- BankTransferApiService.ctorParameters = function () { return [
3780
+ GaliciaApiService.ctorParameters = function () { return [
3755
3781
  { type: HttpClient }
3756
3782
  ]; };
3757
- /** @nocollapse */ BankTransferApiService.ngInjectableDef = ɵɵdefineInjectable({ factory: function BankTransferApiService_Factory() { return new BankTransferApiService(ɵɵinject(HttpClient)); }, token: BankTransferApiService, providedIn: "root" });
3758
- return BankTransferApiService;
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
- BankTransferApiService.prototype.http;
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/bank-transfer/components/bank-transfer.component.ts
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 BankTransferComponent = /** @class */ (function () {
3774
- function BankTransferComponent(bankTransferApi) {
3775
- this.bankTransferApi = bankTransferApi;
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.isLoading = false;
3808
+ this.qrImage = '';
3809
+ this.billNumber = '';
3780
3810
  this.errorMessage = '';
3781
- this.submittedSuccessfully = false;
3782
- this.amountCopied = false;
3783
- // CUIT no se pide al usuario por ahora — se envía valor genérico
3784
- this.paymentForm = new FormGroup({
3785
- cuit: new FormControl('00000000000')
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
- BankTransferComponent.prototype.ngOnInit = /**
3825
+ GaliciaComponent.prototype.ngOnInit = /**
3815
3826
  * @return {?}
3816
3827
  */
3817
- function () { };
3828
+ function () {
3829
+ this.createInitPayment();
3830
+ };
3818
3831
  /**
3819
- * @param {?} text
3832
+ * @param {?} datos
3820
3833
  * @return {?}
3821
3834
  */
3822
- BankTransferComponent.prototype.copyToClipboard = /**
3823
- * @param {?} text
3835
+ GaliciaComponent.prototype.generateQr = /**
3836
+ * @param {?} datos
3824
3837
  * @return {?}
3825
3838
  */
3826
- function (text) {
3827
- navigator.clipboard.writeText(text).catch((/**
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
- /** @type {?} */
3832
- var el = document.createElement('textarea');
3833
- el.value = text;
3834
- document.body.appendChild(el);
3835
- el.select();
3836
- document.execCommand('copy');
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
- BankTransferComponent.prototype.copyAmount = /**
3863
+ GaliciaComponent.prototype.createInitPayment = /**
3844
3864
  * @return {?}
3845
3865
  */
3846
3866
  function () {
3847
- var _this = this;
3848
- /** @type {?} */
3849
- var amountStr = this.amount ? this.amount.toFixed(2) : '0';
3850
- this.copyToClipboard(amountStr);
3851
- this.amountCopied = true;
3852
- setTimeout((/**
3853
- * @return {?}
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
- BankTransferComponent.prototype.onSubmit = /**
3879
+ GaliciaComponent.prototype.initPayment = /**
3861
3880
  * @return {?}
3862
3881
  */
3863
3882
  function () {
3864
3883
  var _this = this;
3865
- if (this.submittedSuccessfully || this.isLoading)
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
- this.isLoading = true;
3868
- this.errorMessage = '';
3916
+ }
3869
3917
  /** @type {?} */
3870
- var request = {
3871
- cuit: '00000000000',
3872
- // Valor genérico mientras no se pide al usuario
3873
- checkoutId: this.checkoutId,
3874
- checkoutAdditionalData: this.checkoutAdditionalData,
3875
- storeName: this.storeName || 'Tienda VK',
3876
- storeId: this.storeId
3877
- };
3878
- this.bankTransferApi.createPayment(this.accessToken, request, this.vkUrlApi).subscribe((/**
3879
- * @param {?} response
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 (response) {
3883
- _this.isLoading = false;
3884
- if (response && response.success) {
3885
- _this.submittedSuccessfully = true;
3886
- _this.statusPay.emit({
3887
- success: true,
3888
- paymentId: (response.data && response.data.bankTransferEcommId) ? response.data.bankTransferEcommId : '',
3889
- integrator: 'BANK_TRANSFER'
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.errorMessage = (response.errorsMessages && response.errorsMessages.length > 0)
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
- Object.defineProperty(BankTransferComponent.prototype, "cuitControl", {
3920
- get: /**
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
- return this.paymentForm.get('cuit');
3925
- },
3926
- enumerable: true,
3927
- configurable: true
3928
- });
3929
- BankTransferComponent.decorators = [
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: 'vk-bank-transfer',
3932
- template: "<form\n [formGroup]=\"paymentForm\"\n (ngSubmit)=\"onSubmit()\"\n class=\"bt-payment\"\n id=\"formularioBT\"\n autocomplete=\"off\"\n>\n\n <!-- Datos bancarios -->\n <div class=\"bank-info-box\">\n <div class=\"bank-info-header\">\n <i class=\"material-icons\">account_balance</i>\n <span>Datos para la transferencia</span>\n </div>\n <div class=\"bank-info-row\">\n <span class=\"bank-info-label\"><i class=\"material-icons\">tag</i>N\u00FAmero de cuenta</span>\n <span class=\"bank-info-value\">2-311972/1</span>\n </div>\n <div class=\"bank-info-row\">\n <span class=\"bank-info-label\"><i class=\"material-icons\">qr_code</i>CBU</span>\n <span class=\"bank-info-value bank-info-copy\">\n <span class=\"bank-info-copy-text\">4150002012003119720013</span>\n <button class=\"copy-btn\" type=\"button\" title=\"Copiar CBU\" (click)=\"copyToClipboard('4150002012003119720013')\">\n <i class=\"material-icons\">content_copy</i>\n </button>\n </span>\n </div>\n <div class=\"bank-info-row\">\n <span class=\"bank-info-label\"><i class=\"material-icons\">alternate_email</i>Alias</span>\n <span class=\"bank-info-value bank-info-copy\">\n <span class=\"bank-info-copy-text\">reba.vitnik</span>\n <button class=\"copy-btn\" type=\"button\" title=\"Copiar alias\" (click)=\"copyToClipboard('reba.vitnik')\">\n <i class=\"material-icons\">content_copy</i>\n </button>\n </span>\n </div>\n <div class=\"bank-info-row\">\n <span class=\"bank-info-label\"><i class=\"material-icons\">badge</i>CUIT/CUIL</span>\n <span class=\"bank-info-value\">30708777893</span>\n </div>\n <div class=\"bank-info-row\">\n <span class=\"bank-info-label\"><i class=\"material-icons\">attach_money</i>Moneda</span>\n <span class=\"bank-info-value\">Peso Argentino</span>\n </div>\n </div>\n\n <!-- Resumen con desglose del descuento -->\n <div class=\"summary-box\">\n <div class=\"summary-row\">\n <span class=\"summary-label\">Subtotal</span>\n <span class=\"summary-value\">${{ subtotalAmount | number:'1.2-2' }}</span>\n </div>\n <div class=\"summary-row discount\">\n <span class=\"summary-label\">\n <i class=\"material-icons\">local_offer</i>\n Descuento transferencia ({{ discountRate * 100 | number:'1.0-0' }}%)\n </span>\n <span class=\"summary-value discount-value\">-${{ discountAmount | number:'1.2-2' }}</span>\n </div>\n <div class=\"summary-row total\">\n <span class=\"summary-label\">Total a transferir</span>\n <span class=\"summary-value total-value\">\n ${{ amount | number:'1.2-2' }}\n <button\n class=\"copy-btn copy-amount-btn\"\n type=\"button\"\n [title]=\"amountCopied ? 'Copiado!' : 'Copiar monto'\"\n (click)=\"copyAmount()\"\n >\n <i class=\"material-icons\">{{ amountCopied ? 'check' : 'content_copy' }}</i>\n </button>\n </span>\n </div>\n </div>\n\n <!-- Leyenda de monto exacto -->\n <div class=\"exact-amount-notice\">\n <i class=\"material-icons notice-icon\">info</i>\n <p>\n <strong>\u00A1Ya casi es tuyo!</strong> Para que podamos procesar tu pedido sin demoras,\n asegurate de que el importe de la transferencia sea <strong>id\u00E9ntico</strong> al total indicado arriba.\n </p>\n </div>\n\n <!-- Error devuelto por la API -->\n <div class=\"pay-message error\" *ngIf=\"errorMessage && !isLoading\">\n <i class=\"material-icons\">error</i>\n <p>{{ errorMessage }}</p>\n </div>\n\n <!-- Loading -->\n <div *ngIf=\"isLoading\" class=\"pay-message info\">\n <i class=\"material-icons\">info</i>\n <p>Procesando informaci\u00F3n de transferencia...</p>\n </div>\n\n <!-- Bot\u00F3n confirmar (oculto tras \u00E9xito) -->\n <div *ngIf=\"!submittedSuccessfully\">\n <button type=\"submit\" [disabled]=\"paymentForm.invalid || isLoading\">\n Confirmar Transferencia\n </button>\n </div>\n\n</form>\n",
3933
- styles: [".bt-payment{background-color:transparent;font-family:inherit,sans-serif;padding:0 12px}.bt-payment p.description{font-size:16px;color:#888;margin-bottom:5px}.bt-payment .bank-info-box{border:1px solid #c8e0f0;border-radius:8px;overflow:hidden;margin-bottom:18px}.bt-payment .bank-info-box .bank-info-header{display:flex;align-items:center;gap:8px;background-color:#009ee3;color:#fff;padding:10px 14px;font-size:18px;font-weight:600;letter-spacing:.4px;text-transform:uppercase}.bt-payment .bank-info-box .bank-info-header i.material-icons{font-size:18px}.bt-payment .bank-info-box .bank-info-row{display:flex;justify-content:space-between;align-items:center;font-size:18px;padding:8px 14px;background-color:#fff;border-bottom:1px solid #eef3f7}.bt-payment .bank-info-box .bank-info-row:last-child{border-bottom:none}.bt-payment .bank-info-box .bank-info-label{display:flex;align-items:center;gap:6px;color:#777;flex-shrink:0;margin-right:8px}.bt-payment .bank-info-box .bank-info-label i.material-icons{font-size:15px;color:#009ee3}.bt-payment .bank-info-box .bank-info-value{font-weight:600;color:#1a1a1a;text-align:right}.bt-payment .bank-info-box .bank-info-value.bank-info-copy{display:flex;align-items:center;gap:4px}.bt-payment .bank-info-box .bank-info-value .bank-info-copy-text{font-family:\"Courier New\",monospace;font-size:18px;letter-spacing:.3px}.bt-payment .bank-info-box .copy-btn{background:0 0;border:none;cursor:pointer;padding:2px 4px;border-radius:4px;color:#009ee3;display:flex;align-items:center;margin-top:0;width:auto;min-width:unset}.bt-payment .bank-info-box .copy-btn i.material-icons{font-size:16px}.bt-payment .bank-info-box .copy-btn:hover{background-color:#e8f4fb}.bt-payment .bank-info-box .copy-btn:disabled{background-color:transparent;cursor:default}.bt-payment .summary-box{margin:20px 0;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.bt-payment .summary-box .summary-row{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;font-size:16px;background-color:#fff;border-bottom:1px solid #f0f0f0}.bt-payment .summary-box .summary-row:last-child{border-bottom:none}.bt-payment .summary-box .summary-row .summary-label{display:flex;align-items:center;gap:6px;color:#555}.bt-payment .summary-box .summary-row .summary-label i.material-icons{font-size:14px}.bt-payment .summary-box .summary-row .summary-value{font-weight:600;color:#1a1a1a;display:flex;align-items:center;gap:6px}.bt-payment .summary-box .summary-row.discount{background-color:#f0fdf4}.bt-payment .summary-box .summary-row.discount .summary-label{color:#16a34a;font-weight:500}.bt-payment .summary-box .summary-row.discount .summary-label i.material-icons{color:#16a34a}.bt-payment .summary-box .summary-row.discount .discount-value{color:#16a34a;font-weight:700}.bt-payment .summary-box .summary-row.total{background-color:#f8f9fa;border-top:2px solid #009ee3}.bt-payment .summary-box .summary-row.total .summary-label{font-size:17px;font-weight:700;color:#1a1a1a}.bt-payment .summary-box .summary-row.total .total-value{font-size:20px;font-weight:800;color:#009ee3}.bt-payment .summary-box .copy-amount-btn{background:0 0;border:1px solid #009ee3;border-radius:6px;cursor:pointer;padding:2px 6px;color:#009ee3;display:flex;align-items:center;width:auto;min-width:unset;margin-top:0;transition:background-color .2s}.bt-payment .summary-box .copy-amount-btn i.material-icons{font-size:16px}.bt-payment .summary-box .copy-amount-btn:hover{background-color:#e8f4fb}.bt-payment .exact-amount-notice{display:flex;align-items:flex-start;gap:10px;background-color:#fffbeb;border:1px solid #fcd34d;border-radius:8px;padding:12px 14px;margin-bottom:20px}.bt-payment .exact-amount-notice .notice-icon{font-size:20px;color:#d97706;flex-shrink:0;margin-top:2px}.bt-payment .exact-amount-notice p{font-size:14px;color:#78350f;margin:0;line-height:1.5}.bt-payment .formRow{margin-top:10px;display:none}.bt-payment .formRow label{font-size:16px;color:#888}.bt-payment .formRow span{background-color:#fff;border:.5px solid #707070;border-radius:2px;padding:2px 10px;display:block;margin-top:4px}.bt-payment .formRow span input[type=text]{background:0 0;border:none;color:#000;font-size:16px;height:23px;width:100%;text-transform:uppercase;vertical-align:top;padding:0;margin:0}.bt-payment .formRow span input[type=text]:focus{outline:0}.bt-payment .alert-text{font-size:16px;color:#009ee3;margin-top:7px;margin-bottom:0}.bt-payment button[type=submit]{background-color:#009ee3;color:#fff;font-size:18px;text-align:center;padding:10px 0;width:100%;border:none;border-radius:20px;margin-top:20px;cursor:pointer}.bt-payment button[type=submit]:disabled{background-color:#525252;cursor:not-allowed}.bt-payment .pay-message{margin-top:10px;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px;border-radius:8px}.bt-payment .pay-message p{font-size:1.1rem;text-align:center;line-height:130%;margin-bottom:10px}.bt-payment .pay-message i.material-icons{font-size:2rem;margin-bottom:5px}.bt-payment .success{background-color:#dff2bf;color:#4f8a10}.bt-payment .error{color:#d8000c;background-color:#ffd2d2}.bt-payment .info{color:#00529b;background-color:#bde5f8}:focus{outline:0}"]
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
- BankTransferComponent.ctorParameters = function () { return [
3938
- { type: BankTransferApiService }
4071
+ GaliciaComponent.ctorParameters = function () { return [
4072
+ { type: GaliciaApiService }
3939
4073
  ]; };
3940
- BankTransferComponent.propDecorators = {
4074
+ GaliciaComponent.propDecorators = {
3941
4075
  accessToken: [{ type: Input }],
4076
+ gaUrlApi: [{ type: Input }],
3942
4077
  vkUrlApi: [{ type: Input }],
3943
- amount: [{ type: Input }],
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
- checkoutAdditionalData: [{ type: Input }],
3948
- discountRate: [{ type: Input }],
4084
+ data: [{ type: Input }],
3949
4085
  statusPay: [{ type: Output }]
3950
4086
  };
3951
- return BankTransferComponent;
4087
+ return GaliciaComponent;
3952
4088
  }());
3953
4089
  if (false) {
3954
4090
  /** @type {?} */
3955
- BankTransferComponent.prototype.accessToken;
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
- BankTransferComponent.prototype.vkUrlApi;
4103
+ GaliciaComponent.prototype.storeName;
3958
4104
  /** @type {?} */
3959
- BankTransferComponent.prototype.amount;
4105
+ GaliciaComponent.prototype.sessionId;
3960
4106
  /** @type {?} */
3961
- BankTransferComponent.prototype.storeId;
4107
+ GaliciaComponent.prototype.checkoutId;
3962
4108
  /** @type {?} */
3963
- BankTransferComponent.prototype.storeName;
4109
+ GaliciaComponent.prototype.data;
3964
4110
  /** @type {?} */
3965
- BankTransferComponent.prototype.checkoutId;
4111
+ GaliciaComponent.prototype.statusPay;
3966
4112
  /** @type {?} */
3967
- BankTransferComponent.prototype.checkoutAdditionalData;
4113
+ GaliciaComponent.prototype.qrImage;
3968
4114
  /** @type {?} */
3969
- BankTransferComponent.prototype.discountRate;
4115
+ GaliciaComponent.prototype.billNumber;
3970
4116
  /** @type {?} */
3971
- BankTransferComponent.prototype.statusPay;
4117
+ GaliciaComponent.prototype.errorMessage;
3972
4118
  /** @type {?} */
3973
- BankTransferComponent.prototype.paymentForm;
4119
+ GaliciaComponent.prototype.OinitPayment;
3974
4120
  /** @type {?} */
3975
- BankTransferComponent.prototype.isLoading;
4121
+ GaliciaComponent.prototype.isGeneratingQr;
3976
4122
  /** @type {?} */
3977
- BankTransferComponent.prototype.errorMessage;
4123
+ GaliciaComponent.prototype.paymentCompleted;
3978
4124
  /** @type {?} */
3979
- BankTransferComponent.prototype.submittedSuccessfully;
4125
+ GaliciaComponent.prototype.paymentId;
3980
4126
  /** @type {?} */
3981
- BankTransferComponent.prototype.amountCopied;
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
- BankTransferComponent.prototype.bankTransferApi;
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/bank-transfer/bank-transfer.module.ts
4156
+ * Generated from: lib/galicia/galicia.module.ts
3992
4157
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3993
4158
  */
3994
- var BankTransferModule = /** @class */ (function () {
3995
- function BankTransferModule() {
4159
+ /** @type {?} */
4160
+ var COMPONENTS$2 = [
4161
+ GaliciaComponent
4162
+ ];
4163
+ var GaliciaModule = /** @class */ (function () {
4164
+ function GaliciaModule() {
3996
4165
  }
3997
- BankTransferModule.decorators = [
4166
+ GaliciaModule.decorators = [
3998
4167
  { type: NgModule, args: [{
3999
4168
  declarations: [
4000
- BankTransferComponent
4169
+ COMPONENTS$2
4170
+ ],
4171
+ exports: [
4172
+ COMPONENTS$2
4001
4173
  ],
4002
4174
  imports: [
4003
4175
  CommonModule,
4004
4176
  FormsModule,
4005
4177
  ReactiveFormsModule,
4006
- HttpClientModule
4007
- ],
4008
- exports: [
4009
- BankTransferComponent
4178
+ RouterModule,
4010
4179
  ],
4011
4180
  providers: [
4012
- BankTransferApiService
4181
+ GaliciaApiService
4013
4182
  ]
4014
4183
  },] }
4015
4184
  ];
4016
- return BankTransferModule;
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
- BankTransferModule
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, BankTransferModule as ɵq, BankTransferComponent as ɵr, BankTransferApiService as ɵs };
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