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.
Files changed (39) hide show
  1. package/bundles/vk-payments.umd.js +354 -194
  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 +290 -157
  18. package/fesm2015/vk-payments.js.map +1 -1
  19. package/fesm5/vk-payments.js +350 -189
  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 -206
  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 -234
  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 -30
  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 { HttpHeaders, HttpClient, HttpClientModule } from '@angular/common/http';
6
6
  import sha256 from 'sha256';
7
7
  import { __awaiter } from 'tslib';
8
+ import { toDataURL } from 'qrcode';
8
9
 
9
10
  /**
10
11
  * @fileoverview added by tsickle
@@ -3186,278 +3187,409 @@ ModoModule.decorators = [
3186
3187
 
3187
3188
  /**
3188
3189
  * @fileoverview added by tsickle
3189
- * Generated from: lib/bank-transfer/services/bank-transfer.api.service.ts
3190
+ * Generated from: lib/galicia/services/galicia.api.service.ts
3190
3191
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3191
3192
  */
3192
- class BankTransferApiService {
3193
+ class GaliciaApiService {
3193
3194
  /**
3194
- * @param {?} http
3195
+ * @param {?} httpClient
3195
3196
  */
3196
- constructor(http) {
3197
- this.http = http;
3197
+ constructor(httpClient) {
3198
+ this.httpClient = httpClient;
3198
3199
  }
3199
3200
  /**
3200
- * @param {?} accessToken
3201
- * @param {?} request
3202
- * @param {?} vkApiUrl
3201
+ * @param {?} url
3203
3202
  * @return {?}
3204
3203
  */
3205
- createPayment(accessToken, request, vkApiUrl) {
3206
- /** @type {?} */
3207
- const headers = new HttpHeaders({
3208
- 'Content-Type': 'application/json',
3209
- Authorization: `Bearer ${accessToken}`
3210
- });
3211
- // Construimos la URL agregando la rute del Controller de BankTransfer
3204
+ normalizeUrl(url) {
3205
+ if (url.length > 0 && url.charAt(url.length - 1) == '/') {
3206
+ url = url.substr(0, url.length - 1);
3207
+ }
3208
+ return url;
3209
+ }
3210
+ /**
3211
+ * @param {?} url
3212
+ * @param {?} initPayment
3213
+ * @return {?}
3214
+ */
3215
+ initPayment(url, initPayment) {
3212
3216
  /** @type {?} */
3213
- const url = `${vkApiUrl}payments/BankTransfer/create-payment`;
3214
- return this.http.post(url, request, { headers });
3217
+ const body = {
3218
+ storeId: initPayment.storeId,
3219
+ userId: initPayment.userId,
3220
+ sessionId: initPayment.sessionId,
3221
+ storeName: initPayment.storeName,
3222
+ checkoutId: initPayment.checkoutId
3223
+ };
3224
+ return this.httpClient.post(this.normalizeUrl(url) + '/init-payment', body);
3225
+ }
3226
+ /**
3227
+ * @param {?} url
3228
+ * @param {?} billNumber
3229
+ * @return {?}
3230
+ */
3231
+ paymentStatus(url, billNumber) {
3232
+ return this.httpClient.get(this.normalizeUrl(url) + '/payment-status?billNumber=' + billNumber);
3215
3233
  }
3216
3234
  }
3217
- BankTransferApiService.decorators = [
3235
+ GaliciaApiService.decorators = [
3218
3236
  { type: Injectable, args: [{
3219
3237
  providedIn: 'root'
3220
3238
  },] }
3221
3239
  ];
3222
3240
  /** @nocollapse */
3223
- BankTransferApiService.ctorParameters = () => [
3241
+ GaliciaApiService.ctorParameters = () => [
3224
3242
  { type: HttpClient }
3225
3243
  ];
3226
- /** @nocollapse */ BankTransferApiService.ngInjectableDef = ɵɵdefineInjectable({ factory: function BankTransferApiService_Factory() { return new BankTransferApiService(ɵɵinject(HttpClient)); }, token: BankTransferApiService, providedIn: "root" });
3244
+ /** @nocollapse */ GaliciaApiService.ngInjectableDef = ɵɵdefineInjectable({ factory: function GaliciaApiService_Factory() { return new GaliciaApiService(ɵɵinject(HttpClient)); }, token: GaliciaApiService, providedIn: "root" });
3227
3245
  if (false) {
3228
3246
  /**
3229
3247
  * @type {?}
3230
3248
  * @private
3231
3249
  */
3232
- BankTransferApiService.prototype.http;
3250
+ GaliciaApiService.prototype.authHeaders;
3251
+ /**
3252
+ * @type {?}
3253
+ * @private
3254
+ */
3255
+ GaliciaApiService.prototype.httpClient;
3233
3256
  }
3234
3257
 
3235
3258
  /**
3236
3259
  * @fileoverview added by tsickle
3237
- * Generated from: lib/bank-transfer/components/bank-transfer.component.ts
3260
+ * Generated from: lib/galicia/components/galicia.component.ts
3238
3261
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3239
3262
  */
3240
- class BankTransferComponent {
3263
+ class GaliciaComponent {
3241
3264
  /**
3242
- * @param {?} bankTransferApi
3265
+ * @param {?} galiciaApiService
3243
3266
  */
3244
- constructor(bankTransferApi) {
3245
- this.bankTransferApi = bankTransferApi;
3246
- this.discountRate = 0.10; // Tasa de descuento (10% por defecto)
3247
- // Descuento explícito desde el carrito
3267
+ constructor(galiciaApiService) {
3268
+ this.galiciaApiService = galiciaApiService;
3248
3269
  this.statusPay = new EventEmitter();
3249
- this.isLoading = false;
3270
+ this.qrImage = '';
3271
+ this.billNumber = '';
3250
3272
  this.errorMessage = '';
3251
- this.submittedSuccessfully = false;
3252
- this.amountCopied = false;
3253
- // CUIT no se pide al usuario por ahora — se envía valor genérico
3254
- this.paymentForm = new FormGroup({
3255
- cuit: new FormControl('00000000000')
3256
- });
3273
+ this.isGeneratingQr = true;
3274
+ this.paymentCompleted = false;
3275
+ this.paymentId = '';
3276
+ this.showQr = false;
3277
+ this.expired = false;
3278
+ this.isLoading = false;
3279
+ this.hasError = false;
3280
+ this.minutes = 0;
3281
+ this.seconds = 0;
3282
+ this.paymentResult = { success: false, paymentId: '', integrator: 'GALICIA' };
3257
3283
  }
3258
- // Calculados a partir de `amount` (que ya tiene el descuento aplicado)
3259
3284
  /**
3260
3285
  * @return {?}
3261
3286
  */
3262
- get subtotalAmount() {
3263
- if (this.discountAmountValue !== undefined && this.discountAmountValue !== null) {
3264
- return this.amount + this.discountAmountValue;
3265
- }
3266
- return this.amount ? Math.round(this.amount / (1 - this.discountRate)) : 0;
3287
+ ngOnInit() {
3288
+ this.createInitPayment();
3267
3289
  }
3268
3290
  /**
3291
+ * @param {?} datos
3269
3292
  * @return {?}
3270
3293
  */
3271
- get discountAmount() {
3272
- if (this.discountAmountValue !== undefined && this.discountAmountValue !== null) {
3273
- return this.discountAmountValue;
3274
- }
3275
- return this.subtotalAmount - (this.amount || 0);
3294
+ generateQr(datos) {
3295
+ /** @type {?} */
3296
+ const decoded = atob(datos);
3297
+ toDataURL(decoded, {
3298
+ width: 300,
3299
+ margin: 2
3300
+ })
3301
+ .then((/**
3302
+ * @param {?} url
3303
+ * @return {?}
3304
+ */
3305
+ url => {
3306
+ this.qrImage = url;
3307
+ this.isGeneratingQr = false;
3308
+ this.showQr = true;
3309
+ this.expired = false;
3310
+ this.startTimer();
3311
+ this.startPaymentValidation();
3312
+ }));
3276
3313
  }
3277
3314
  /**
3278
3315
  * @return {?}
3279
3316
  */
3280
- ngOnInit() { }
3317
+ createInitPayment() {
3318
+ this.OinitPayment = {
3319
+ sessionId: '',
3320
+ userId: this.userId,
3321
+ storeId: this.storeId,
3322
+ storeName: this.storeName,
3323
+ checkoutId: this.checkoutId
3324
+ };
3325
+ this.initPayment();
3326
+ }
3281
3327
  /**
3282
- * @param {?} text
3283
3328
  * @return {?}
3284
3329
  */
3285
- copyToClipboard(text) {
3286
- navigator.clipboard.writeText(text).catch((/**
3287
- * @return {?}
3288
- */
3289
- () => {
3290
- /** @type {?} */
3291
- const el = document.createElement('textarea');
3292
- el.value = text;
3293
- document.body.appendChild(el);
3294
- el.select();
3295
- document.execCommand('copy');
3296
- document.body.removeChild(el);
3297
- }));
3330
+ initPayment() {
3331
+ this.isGeneratingQr = true;
3332
+ this.galiciaApiService.initPayment(this.vkUrlApi, this.OinitPayment)
3333
+ .subscribe({
3334
+ next: (/**
3335
+ * @param {?} v
3336
+ * @return {?}
3337
+ */
3338
+ (v) => this.initPaymentResponseHandler(v)),
3339
+ error: (/**
3340
+ * @param {?} v
3341
+ * @return {?}
3342
+ */
3343
+ (v) => this.initPaymentErrorHandler(v))
3344
+ });
3298
3345
  }
3299
3346
  /**
3347
+ * @private
3348
+ * @param {?} response
3300
3349
  * @return {?}
3301
3350
  */
3302
- copyAmount() {
3351
+ initPaymentResponseHandler(response) {
3352
+ if (!response.success) {
3353
+ this.isLoading = false;
3354
+ this.hasError = true;
3355
+ this.statusPay.emit(this.paymentResult);
3356
+ this.errorMessage = response.errorsMessages[0] || 'Ocurrió un error al generar el código QR.';
3357
+ return;
3358
+ }
3303
3359
  /** @type {?} */
3304
- const amountStr = this.amount ? this.amount.toFixed(2) : '0';
3305
- this.copyToClipboard(amountStr);
3306
- this.amountCopied = true;
3307
- setTimeout((/**
3308
- * @return {?}
3309
- */
3310
- () => this.amountCopied = false), 2000);
3360
+ var qrData = response.data.bills[0].qr.datos;
3361
+ this.billNumber = response.data.bills[0].nroBoleta;
3362
+ this.generateQr(qrData);
3311
3363
  }
3312
3364
  /**
3365
+ * @private
3366
+ * @param {?} error
3313
3367
  * @return {?}
3314
3368
  */
3315
- onSubmit() {
3316
- if (this.submittedSuccessfully || this.isLoading)
3317
- return;
3318
- this.isLoading = true;
3319
- this.errorMessage = '';
3320
- /** @type {?} */
3321
- const request = {
3322
- cuit: '00000000000',
3323
- // Valor genérico mientras no se pide al usuario
3324
- checkoutId: this.checkoutId,
3325
- checkoutAdditionalData: this.checkoutAdditionalData,
3326
- storeName: this.storeName || 'Tienda VK',
3327
- storeId: this.storeId
3328
- };
3329
- this.bankTransferApi.createPayment(this.accessToken, request, this.vkUrlApi).subscribe((/**
3330
- * @param {?} response
3369
+ initPaymentErrorHandler(error) {
3370
+ this.isLoading = false;
3371
+ this.hasError = true;
3372
+ this.errorMessage = error.errorsMessages[0] || 'Ocurrió un error al generar el código QR.';
3373
+ this.paymentResult.success = false;
3374
+ this.statusPay.emit(this.paymentResult);
3375
+ }
3376
+ /**
3377
+ * @return {?}
3378
+ */
3379
+ startTimer() {
3380
+ clearInterval(this.interval);
3381
+ this.minutes = 1;
3382
+ this.seconds = 0;
3383
+ this.interval = setInterval((/**
3331
3384
  * @return {?}
3332
3385
  */
3333
- (response) => {
3334
- this.isLoading = false;
3335
- if (response && response.success) {
3336
- this.submittedSuccessfully = true;
3337
- this.statusPay.emit({
3338
- success: true,
3339
- paymentId: (response.data && response.data.bankTransferEcommId) ? response.data.bankTransferEcommId : '',
3340
- integrator: 'BANK_TRANSFER'
3341
- });
3386
+ () => {
3387
+ if (this.seconds === 0) {
3388
+ if (this.minutes === 0) {
3389
+ this.stopValidation();
3390
+ this.showQr = false;
3391
+ this.expired = true;
3392
+ return;
3393
+ }
3394
+ this.minutes--;
3395
+ this.seconds = 59;
3342
3396
  }
3343
3397
  else {
3344
- this.errorMessage = (response.errorsMessages && response.errorsMessages.length > 0)
3345
- ? response.errorsMessages[0]
3346
- : 'Ocurrió un error al registrar la transferencia.';
3347
- this.statusPay.emit({
3348
- success: false,
3349
- paymentId: '',
3350
- integrator: 'BANK_TRANSFER'
3351
- });
3398
+ this.seconds--;
3352
3399
  }
3353
- }), (/**
3354
- * @param {?} error
3400
+ }), 1000);
3401
+ }
3402
+ /**
3403
+ * @return {?}
3404
+ */
3405
+ startPaymentValidation() {
3406
+ this.validationInterval = setInterval((/**
3355
3407
  * @return {?}
3356
3408
  */
3357
- (error) => {
3358
- this.isLoading = false;
3359
- this.errorMessage = (error && error.error && error.error.errorsMessages && error.error.errorsMessages.length > 0)
3360
- ? error.error.errorsMessages[0]
3361
- : 'Ocurrió un error de conexión al registrar la transferencia.';
3362
- this.statusPay.emit({
3363
- success: false,
3364
- paymentId: '',
3365
- integrator: 'BANK_TRANSFER'
3409
+ () => {
3410
+ this.galiciaApiService.paymentStatus(this.vkUrlApi, this.billNumber)
3411
+ .subscribe({
3412
+ next: (/**
3413
+ * @param {?} v
3414
+ * @return {?}
3415
+ */
3416
+ (v) => this.paymentStatusResponseHandler(v)),
3417
+ error: (/**
3418
+ * @param {?} v
3419
+ * @return {?}
3420
+ */
3421
+ (v) => this.paymentStatusErrorHandler(v))
3366
3422
  });
3367
- console.error('Error BankTransferApiService:', error);
3368
- }));
3423
+ }), 5000);
3369
3424
  }
3370
3425
  /**
3426
+ * @param {?} response
3371
3427
  * @return {?}
3372
3428
  */
3373
- get cuitControl() {
3374
- return this.paymentForm.get('cuit');
3429
+ paymentStatusResponseHandler(response) {
3430
+ console.log(response);
3431
+ if (!response.success) {
3432
+ this.isLoading = false;
3433
+ this.statusPay.emit(this.paymentResult);
3434
+ return;
3435
+ }
3436
+ if (response.data.isPaid) {
3437
+ this.stopValidation();
3438
+ this.showQr = false;
3439
+ this.expired = false;
3440
+ this.paymentCompleted = true;
3441
+ this.paymentId = response.data.paymentId;
3442
+ this.paymentResult = {
3443
+ success: true,
3444
+ paymentId: this.paymentId,
3445
+ integrator: 'GALICIA'
3446
+ };
3447
+ this.statusPay.emit(this.paymentResult);
3448
+ }
3449
+ }
3450
+ /**
3451
+ * @private
3452
+ * @param {?} error
3453
+ * @return {?}
3454
+ */
3455
+ paymentStatusErrorHandler(error) {
3456
+ clearInterval(this.validationInterval);
3457
+ this.hasError = true;
3458
+ }
3459
+ /**
3460
+ * @return {?}
3461
+ */
3462
+ showQrAgain() {
3463
+ this.showQr = true;
3464
+ this.expired = false;
3465
+ this.startTimer();
3466
+ this.startPaymentValidation();
3467
+ }
3468
+ /**
3469
+ * @private
3470
+ * @return {?}
3471
+ */
3472
+ stopValidation() {
3473
+ clearInterval(this.validationInterval);
3474
+ clearInterval(this.interval);
3375
3475
  }
3376
3476
  }
3377
- BankTransferComponent.decorators = [
3477
+ GaliciaComponent.decorators = [
3378
3478
  { type: Component, args: [{
3379
- selector: 'vk-bank-transfer',
3380
- 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",
3381
- 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}"]
3479
+ selector: 'lib-galicia',
3480
+ 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>",
3481
+ 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)}}"]
3382
3482
  }] }
3383
3483
  ];
3384
3484
  /** @nocollapse */
3385
- BankTransferComponent.ctorParameters = () => [
3386
- { type: BankTransferApiService }
3485
+ GaliciaComponent.ctorParameters = () => [
3486
+ { type: GaliciaApiService }
3387
3487
  ];
3388
- BankTransferComponent.propDecorators = {
3488
+ GaliciaComponent.propDecorators = {
3389
3489
  accessToken: [{ type: Input }],
3490
+ gaUrlApi: [{ type: Input }],
3390
3491
  vkUrlApi: [{ type: Input }],
3391
- amount: [{ type: Input }],
3492
+ userId: [{ type: Input }],
3493
+ logoGa: [{ type: Input }],
3392
3494
  storeId: [{ type: Input }],
3393
3495
  storeName: [{ type: Input }],
3496
+ sessionId: [{ type: Input }],
3394
3497
  checkoutId: [{ type: Input }],
3395
- checkoutAdditionalData: [{ type: Input }],
3396
- discountRate: [{ type: Input }],
3397
- discountAmountValue: [{ type: Input }],
3498
+ data: [{ type: Input }],
3398
3499
  statusPay: [{ type: Output }]
3399
3500
  };
3400
3501
  if (false) {
3401
3502
  /** @type {?} */
3402
- BankTransferComponent.prototype.accessToken;
3503
+ GaliciaComponent.prototype.accessToken;
3504
+ /** @type {?} */
3505
+ GaliciaComponent.prototype.gaUrlApi;
3506
+ /** @type {?} */
3507
+ GaliciaComponent.prototype.vkUrlApi;
3508
+ /** @type {?} */
3509
+ GaliciaComponent.prototype.userId;
3403
3510
  /** @type {?} */
3404
- BankTransferComponent.prototype.vkUrlApi;
3511
+ GaliciaComponent.prototype.logoGa;
3405
3512
  /** @type {?} */
3406
- BankTransferComponent.prototype.amount;
3513
+ GaliciaComponent.prototype.storeId;
3407
3514
  /** @type {?} */
3408
- BankTransferComponent.prototype.storeId;
3515
+ GaliciaComponent.prototype.storeName;
3409
3516
  /** @type {?} */
3410
- BankTransferComponent.prototype.storeName;
3517
+ GaliciaComponent.prototype.sessionId;
3411
3518
  /** @type {?} */
3412
- BankTransferComponent.prototype.checkoutId;
3519
+ GaliciaComponent.prototype.checkoutId;
3413
3520
  /** @type {?} */
3414
- BankTransferComponent.prototype.checkoutAdditionalData;
3521
+ GaliciaComponent.prototype.data;
3415
3522
  /** @type {?} */
3416
- BankTransferComponent.prototype.discountRate;
3523
+ GaliciaComponent.prototype.statusPay;
3417
3524
  /** @type {?} */
3418
- BankTransferComponent.prototype.discountAmountValue;
3525
+ GaliciaComponent.prototype.qrImage;
3419
3526
  /** @type {?} */
3420
- BankTransferComponent.prototype.statusPay;
3527
+ GaliciaComponent.prototype.billNumber;
3421
3528
  /** @type {?} */
3422
- BankTransferComponent.prototype.paymentForm;
3529
+ GaliciaComponent.prototype.errorMessage;
3423
3530
  /** @type {?} */
3424
- BankTransferComponent.prototype.isLoading;
3531
+ GaliciaComponent.prototype.OinitPayment;
3425
3532
  /** @type {?} */
3426
- BankTransferComponent.prototype.errorMessage;
3533
+ GaliciaComponent.prototype.isGeneratingQr;
3427
3534
  /** @type {?} */
3428
- BankTransferComponent.prototype.submittedSuccessfully;
3535
+ GaliciaComponent.prototype.paymentCompleted;
3429
3536
  /** @type {?} */
3430
- BankTransferComponent.prototype.amountCopied;
3537
+ GaliciaComponent.prototype.paymentId;
3538
+ /** @type {?} */
3539
+ GaliciaComponent.prototype.showQr;
3540
+ /** @type {?} */
3541
+ GaliciaComponent.prototype.expired;
3542
+ /** @type {?} */
3543
+ GaliciaComponent.prototype.isLoading;
3544
+ /** @type {?} */
3545
+ GaliciaComponent.prototype.hasError;
3546
+ /** @type {?} */
3547
+ GaliciaComponent.prototype.minutes;
3548
+ /** @type {?} */
3549
+ GaliciaComponent.prototype.seconds;
3431
3550
  /**
3432
3551
  * @type {?}
3433
3552
  * @private
3434
3553
  */
3435
- BankTransferComponent.prototype.bankTransferApi;
3554
+ GaliciaComponent.prototype.interval;
3555
+ /** @type {?} */
3556
+ GaliciaComponent.prototype.validationInterval;
3557
+ /** @type {?} */
3558
+ GaliciaComponent.prototype.paymentResult;
3559
+ /**
3560
+ * @type {?}
3561
+ * @private
3562
+ */
3563
+ GaliciaComponent.prototype.galiciaApiService;
3436
3564
  }
3437
3565
 
3438
3566
  /**
3439
3567
  * @fileoverview added by tsickle
3440
- * Generated from: lib/bank-transfer/bank-transfer.module.ts
3568
+ * Generated from: lib/galicia/galicia.module.ts
3441
3569
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3442
3570
  */
3443
- class BankTransferModule {
3571
+ /** @type {?} */
3572
+ const COMPONENTS$2 = [
3573
+ GaliciaComponent
3574
+ ];
3575
+ class GaliciaModule {
3444
3576
  }
3445
- BankTransferModule.decorators = [
3577
+ GaliciaModule.decorators = [
3446
3578
  { type: NgModule, args: [{
3447
3579
  declarations: [
3448
- BankTransferComponent
3580
+ COMPONENTS$2
3581
+ ],
3582
+ exports: [
3583
+ COMPONENTS$2
3449
3584
  ],
3450
3585
  imports: [
3451
3586
  CommonModule,
3452
3587
  FormsModule,
3453
3588
  ReactiveFormsModule,
3454
- HttpClientModule
3455
- ],
3456
- exports: [
3457
- BankTransferComponent
3589
+ RouterModule,
3458
3590
  ],
3459
3591
  providers: [
3460
- BankTransferApiService
3592
+ GaliciaApiService
3461
3593
  ]
3462
3594
  },] }
3463
3595
  ];
@@ -3474,14 +3606,15 @@ const LIB_MODULES = [
3474
3606
  PaypalModule,
3475
3607
  GoCuotasModule,
3476
3608
  ModoModule,
3477
- BankTransferModule
3609
+ GaliciaModule
3478
3610
  ];
3479
3611
  class VkPaymentsModule {
3480
3612
  }
3481
3613
  VkPaymentsModule.decorators = [
3482
3614
  { type: NgModule, args: [{
3483
3615
  imports: LIB_MODULES,
3484
- exports: LIB_MODULES
3616
+ exports: LIB_MODULES,
3617
+ declarations: []
3485
3618
  },] }
3486
3619
  ];
3487
3620
 
@@ -3497,5 +3630,5 @@ VkPaymentsModule.decorators = [
3497
3630
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3498
3631
  */
3499
3632
 
3500
- 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 };
3633
+ 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 };
3501
3634
  //# sourceMappingURL=vk-payments.js.map