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 { 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,269 +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
- // Tasa de descuento (10% por defecto)
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
- return this.amount ? Math.round(this.amount / (1 - this.discountRate)) : 0;
3287
+ ngOnInit() {
3288
+ this.createInitPayment();
3264
3289
  }
3265
3290
  /**
3291
+ * @param {?} datos
3266
3292
  * @return {?}
3267
3293
  */
3268
- get discountAmount() {
3269
- 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
+ }));
3270
3313
  }
3271
3314
  /**
3272
3315
  * @return {?}
3273
3316
  */
3274
- 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
+ }
3275
3327
  /**
3276
- * @param {?} text
3277
3328
  * @return {?}
3278
3329
  */
3279
- copyToClipboard(text) {
3280
- navigator.clipboard.writeText(text).catch((/**
3281
- * @return {?}
3282
- */
3283
- () => {
3284
- /** @type {?} */
3285
- const el = document.createElement('textarea');
3286
- el.value = text;
3287
- document.body.appendChild(el);
3288
- el.select();
3289
- document.execCommand('copy');
3290
- document.body.removeChild(el);
3291
- }));
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
+ });
3292
3345
  }
3293
3346
  /**
3347
+ * @private
3348
+ * @param {?} response
3294
3349
  * @return {?}
3295
3350
  */
3296
- 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
+ }
3297
3359
  /** @type {?} */
3298
- const amountStr = this.amount ? this.amount.toFixed(2) : '0';
3299
- this.copyToClipboard(amountStr);
3300
- this.amountCopied = true;
3301
- setTimeout((/**
3302
- * @return {?}
3303
- */
3304
- () => 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);
3363
+ }
3364
+ /**
3365
+ * @private
3366
+ * @param {?} error
3367
+ * @return {?}
3368
+ */
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);
3305
3375
  }
3306
3376
  /**
3307
3377
  * @return {?}
3308
3378
  */
3309
- onSubmit() {
3310
- if (this.submittedSuccessfully || this.isLoading)
3311
- return;
3312
- this.isLoading = true;
3313
- this.errorMessage = '';
3314
- /** @type {?} */
3315
- const request = {
3316
- cuit: '00000000000',
3317
- // Valor genérico mientras no se pide al usuario
3318
- checkoutId: this.checkoutId,
3319
- checkoutAdditionalData: this.checkoutAdditionalData,
3320
- storeName: this.storeName || 'Tienda VK',
3321
- storeId: this.storeId
3322
- };
3323
- this.bankTransferApi.createPayment(this.accessToken, request, this.vkUrlApi).subscribe((/**
3324
- * @param {?} response
3379
+ startTimer() {
3380
+ clearInterval(this.interval);
3381
+ this.minutes = 1;
3382
+ this.seconds = 0;
3383
+ this.interval = setInterval((/**
3325
3384
  * @return {?}
3326
3385
  */
3327
- (response) => {
3328
- this.isLoading = false;
3329
- if (response && response.success) {
3330
- this.submittedSuccessfully = true;
3331
- this.statusPay.emit({
3332
- success: true,
3333
- paymentId: (response.data && response.data.bankTransferEcommId) ? response.data.bankTransferEcommId : '',
3334
- integrator: 'BANK_TRANSFER'
3335
- });
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;
3336
3396
  }
3337
3397
  else {
3338
- this.errorMessage = (response.errorsMessages && response.errorsMessages.length > 0)
3339
- ? response.errorsMessages[0]
3340
- : 'Ocurrió un error al registrar la transferencia.';
3341
- this.statusPay.emit({
3342
- success: false,
3343
- paymentId: '',
3344
- integrator: 'BANK_TRANSFER'
3345
- });
3398
+ this.seconds--;
3346
3399
  }
3347
- }), (/**
3348
- * @param {?} error
3400
+ }), 1000);
3401
+ }
3402
+ /**
3403
+ * @return {?}
3404
+ */
3405
+ startPaymentValidation() {
3406
+ this.validationInterval = setInterval((/**
3349
3407
  * @return {?}
3350
3408
  */
3351
- (error) => {
3352
- this.isLoading = false;
3353
- this.errorMessage = (error && error.error && error.error.errorsMessages && error.error.errorsMessages.length > 0)
3354
- ? error.error.errorsMessages[0]
3355
- : 'Ocurrió un error de conexión al registrar la transferencia.';
3356
- this.statusPay.emit({
3357
- success: false,
3358
- paymentId: '',
3359
- 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))
3360
3422
  });
3361
- console.error('Error BankTransferApiService:', error);
3362
- }));
3423
+ }), 5000);
3363
3424
  }
3364
3425
  /**
3426
+ * @param {?} response
3365
3427
  * @return {?}
3366
3428
  */
3367
- get cuitControl() {
3368
- 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);
3369
3475
  }
3370
3476
  }
3371
- BankTransferComponent.decorators = [
3477
+ GaliciaComponent.decorators = [
3372
3478
  { type: Component, args: [{
3373
- selector: 'vk-bank-transfer',
3374
- 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",
3375
- 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)}}"]
3376
3482
  }] }
3377
3483
  ];
3378
3484
  /** @nocollapse */
3379
- BankTransferComponent.ctorParameters = () => [
3380
- { type: BankTransferApiService }
3485
+ GaliciaComponent.ctorParameters = () => [
3486
+ { type: GaliciaApiService }
3381
3487
  ];
3382
- BankTransferComponent.propDecorators = {
3488
+ GaliciaComponent.propDecorators = {
3383
3489
  accessToken: [{ type: Input }],
3490
+ gaUrlApi: [{ type: Input }],
3384
3491
  vkUrlApi: [{ type: Input }],
3385
- amount: [{ type: Input }],
3492
+ userId: [{ type: Input }],
3493
+ logoGa: [{ type: Input }],
3386
3494
  storeId: [{ type: Input }],
3387
3495
  storeName: [{ type: Input }],
3496
+ sessionId: [{ type: Input }],
3388
3497
  checkoutId: [{ type: Input }],
3389
- checkoutAdditionalData: [{ type: Input }],
3390
- discountRate: [{ type: Input }],
3498
+ data: [{ type: Input }],
3391
3499
  statusPay: [{ type: Output }]
3392
3500
  };
3393
3501
  if (false) {
3394
3502
  /** @type {?} */
3395
- 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;
3510
+ /** @type {?} */
3511
+ GaliciaComponent.prototype.logoGa;
3396
3512
  /** @type {?} */
3397
- BankTransferComponent.prototype.vkUrlApi;
3513
+ GaliciaComponent.prototype.storeId;
3398
3514
  /** @type {?} */
3399
- BankTransferComponent.prototype.amount;
3515
+ GaliciaComponent.prototype.storeName;
3400
3516
  /** @type {?} */
3401
- BankTransferComponent.prototype.storeId;
3517
+ GaliciaComponent.prototype.sessionId;
3402
3518
  /** @type {?} */
3403
- BankTransferComponent.prototype.storeName;
3519
+ GaliciaComponent.prototype.checkoutId;
3404
3520
  /** @type {?} */
3405
- BankTransferComponent.prototype.checkoutId;
3521
+ GaliciaComponent.prototype.data;
3406
3522
  /** @type {?} */
3407
- BankTransferComponent.prototype.checkoutAdditionalData;
3523
+ GaliciaComponent.prototype.statusPay;
3408
3524
  /** @type {?} */
3409
- BankTransferComponent.prototype.discountRate;
3525
+ GaliciaComponent.prototype.qrImage;
3410
3526
  /** @type {?} */
3411
- BankTransferComponent.prototype.statusPay;
3527
+ GaliciaComponent.prototype.billNumber;
3412
3528
  /** @type {?} */
3413
- BankTransferComponent.prototype.paymentForm;
3529
+ GaliciaComponent.prototype.errorMessage;
3414
3530
  /** @type {?} */
3415
- BankTransferComponent.prototype.isLoading;
3531
+ GaliciaComponent.prototype.OinitPayment;
3416
3532
  /** @type {?} */
3417
- BankTransferComponent.prototype.errorMessage;
3533
+ GaliciaComponent.prototype.isGeneratingQr;
3418
3534
  /** @type {?} */
3419
- BankTransferComponent.prototype.submittedSuccessfully;
3535
+ GaliciaComponent.prototype.paymentCompleted;
3420
3536
  /** @type {?} */
3421
- 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;
3422
3550
  /**
3423
3551
  * @type {?}
3424
3552
  * @private
3425
3553
  */
3426
- 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;
3427
3564
  }
3428
3565
 
3429
3566
  /**
3430
3567
  * @fileoverview added by tsickle
3431
- * Generated from: lib/bank-transfer/bank-transfer.module.ts
3568
+ * Generated from: lib/galicia/galicia.module.ts
3432
3569
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3433
3570
  */
3434
- class BankTransferModule {
3571
+ /** @type {?} */
3572
+ const COMPONENTS$2 = [
3573
+ GaliciaComponent
3574
+ ];
3575
+ class GaliciaModule {
3435
3576
  }
3436
- BankTransferModule.decorators = [
3577
+ GaliciaModule.decorators = [
3437
3578
  { type: NgModule, args: [{
3438
3579
  declarations: [
3439
- BankTransferComponent
3580
+ COMPONENTS$2
3581
+ ],
3582
+ exports: [
3583
+ COMPONENTS$2
3440
3584
  ],
3441
3585
  imports: [
3442
3586
  CommonModule,
3443
3587
  FormsModule,
3444
3588
  ReactiveFormsModule,
3445
- HttpClientModule
3446
- ],
3447
- exports: [
3448
- BankTransferComponent
3589
+ RouterModule,
3449
3590
  ],
3450
3591
  providers: [
3451
- BankTransferApiService
3592
+ GaliciaApiService
3452
3593
  ]
3453
3594
  },] }
3454
3595
  ];
@@ -3465,14 +3606,15 @@ const LIB_MODULES = [
3465
3606
  PaypalModule,
3466
3607
  GoCuotasModule,
3467
3608
  ModoModule,
3468
- BankTransferModule
3609
+ GaliciaModule
3469
3610
  ];
3470
3611
  class VkPaymentsModule {
3471
3612
  }
3472
3613
  VkPaymentsModule.decorators = [
3473
3614
  { type: NgModule, args: [{
3474
3615
  imports: LIB_MODULES,
3475
- exports: LIB_MODULES
3616
+ exports: LIB_MODULES,
3617
+ declarations: []
3476
3618
  },] }
3477
3619
  ];
3478
3620
 
@@ -3488,5 +3630,5 @@ VkPaymentsModule.decorators = [
3488
3630
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3489
3631
  */
3490
3632
 
3491
- 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 };
3492
3634
  //# sourceMappingURL=vk-payments.js.map