vk-payments 0.2.33 → 0.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/vk-payments.umd.js +38 -2
- package/bundles/vk-payments.umd.js.map +1 -1
- package/bundles/vk-payments.umd.min.js +1 -1
- package/bundles/vk-payments.umd.min.js.map +1 -1
- package/esm2015/lib/galicia/components/galicia.component.js +31 -3
- package/esm5/lib/galicia/components/galicia.component.js +39 -3
- package/fesm2015/vk-payments.js +30 -2
- package/fesm2015/vk-payments.js.map +1 -1
- package/fesm5/vk-payments.js +38 -2
- package/fesm5/vk-payments.js.map +1 -1
- package/lib/galicia/components/galicia.component.d.ts +5 -0
- package/package.json +1 -1
- package/vk-payments.metadata.json +1 -1
package/fesm5/vk-payments.js
CHANGED
|
@@ -4116,6 +4116,7 @@ if (false) {
|
|
|
4116
4116
|
var GaliciaComponent = /** @class */ (function () {
|
|
4117
4117
|
function GaliciaComponent(galiciaApiService) {
|
|
4118
4118
|
this.galiciaApiService = galiciaApiService;
|
|
4119
|
+
this.discountRate = 0.10;
|
|
4119
4120
|
this.statusPay = new EventEmitter();
|
|
4120
4121
|
this.qrImage = '';
|
|
4121
4122
|
this.billNumber = '';
|
|
@@ -4169,6 +4170,32 @@ var GaliciaComponent = /** @class */ (function () {
|
|
|
4169
4170
|
_this.startPaymentValidation();
|
|
4170
4171
|
}));
|
|
4171
4172
|
};
|
|
4173
|
+
Object.defineProperty(GaliciaComponent.prototype, "subtotalAmount", {
|
|
4174
|
+
get: /**
|
|
4175
|
+
* @return {?}
|
|
4176
|
+
*/
|
|
4177
|
+
function () {
|
|
4178
|
+
if (this.discountAmountValue !== undefined && this.discountAmountValue !== null) {
|
|
4179
|
+
return this.amount + this.discountAmountValue;
|
|
4180
|
+
}
|
|
4181
|
+
return this.amount ? Math.round(this.amount / (1 - this.discountRate)) : 0;
|
|
4182
|
+
},
|
|
4183
|
+
enumerable: true,
|
|
4184
|
+
configurable: true
|
|
4185
|
+
});
|
|
4186
|
+
Object.defineProperty(GaliciaComponent.prototype, "discountAmount", {
|
|
4187
|
+
get: /**
|
|
4188
|
+
* @return {?}
|
|
4189
|
+
*/
|
|
4190
|
+
function () {
|
|
4191
|
+
if (this.discountAmountValue !== undefined && this.discountAmountValue !== null) {
|
|
4192
|
+
return this.discountAmountValue;
|
|
4193
|
+
}
|
|
4194
|
+
return this.subtotalAmount - (this.amount || 0);
|
|
4195
|
+
},
|
|
4196
|
+
enumerable: true,
|
|
4197
|
+
configurable: true
|
|
4198
|
+
});
|
|
4172
4199
|
/**
|
|
4173
4200
|
* @return {?}
|
|
4174
4201
|
*/
|
|
@@ -4374,8 +4401,8 @@ var GaliciaComponent = /** @class */ (function () {
|
|
|
4374
4401
|
GaliciaComponent.decorators = [
|
|
4375
4402
|
{ type: Component, args: [{
|
|
4376
4403
|
selector: 'lib-galicia',
|
|
4377
|
-
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>",
|
|
4378
|
-
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)}}"]
|
|
4404
|
+
template: "<div class=\"gc-payment\">\n\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 ({{ 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 abonar</span>\n <span class=\"summary-value total-value\">\n ${{ amount | number:'1.2-2' }} \n </span>\n </div>\n </div>\n\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>",
|
|
4405
|
+
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}.summary-box{margin:20px 0;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden;min-width:250px;max-width:400px}.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}.summary-box .summary-row:last-child{border-bottom:none}.summary-box .summary-row .summary-label{display:flex;align-items:center;gap:6px;color:#555}.summary-box .summary-row .summary-label i.material-icons{font-size:14px}.summary-box .summary-row .summary-value{font-weight:600;color:#1a1a1a;display:flex;align-items:center;margin-left:45px;gap:6px}.summary-box .summary-row.discount{background-color:#f0fdf4}.summary-box .summary-row.discount .summary-label{color:#16a34a;font-weight:500}.summary-box .summary-row.discount .summary-label i.material-icons{color:#16a34a}.summary-box .summary-row.discount .discount-value{color:#16a34a;font-weight:700}.summary-box .summary-row.total{background-color:#f8f9fa;border-top:2px solid #009ee3}.summary-box .summary-row.total .summary-label{font-size:17px;font-weight:700;color:#1a1a1a}.summary-box .summary-row.total .total-value{font-size:20px;font-weight:800;color:#009ee3}.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}.summary-box .copy-amount-btn i.material-icons{font-size:16px}.summary-box .copy-amount-btn:hover{background-color:#e8f4fb}@-webkit-keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"]
|
|
4379
4406
|
}] }
|
|
4380
4407
|
];
|
|
4381
4408
|
/** @nocollapse */
|
|
@@ -4392,6 +4419,9 @@ var GaliciaComponent = /** @class */ (function () {
|
|
|
4392
4419
|
storeName: [{ type: Input }],
|
|
4393
4420
|
sessionId: [{ type: Input }],
|
|
4394
4421
|
checkoutId: [{ type: Input }],
|
|
4422
|
+
amount: [{ type: Input }],
|
|
4423
|
+
discountRate: [{ type: Input }],
|
|
4424
|
+
discountAmountValue: [{ type: Input }],
|
|
4395
4425
|
data: [{ type: Input }],
|
|
4396
4426
|
statusPay: [{ type: Output }]
|
|
4397
4427
|
};
|
|
@@ -4417,6 +4447,12 @@ if (false) {
|
|
|
4417
4447
|
/** @type {?} */
|
|
4418
4448
|
GaliciaComponent.prototype.checkoutId;
|
|
4419
4449
|
/** @type {?} */
|
|
4450
|
+
GaliciaComponent.prototype.amount;
|
|
4451
|
+
/** @type {?} */
|
|
4452
|
+
GaliciaComponent.prototype.discountRate;
|
|
4453
|
+
/** @type {?} */
|
|
4454
|
+
GaliciaComponent.prototype.discountAmountValue;
|
|
4455
|
+
/** @type {?} */
|
|
4420
4456
|
GaliciaComponent.prototype.data;
|
|
4421
4457
|
/** @type {?} */
|
|
4422
4458
|
GaliciaComponent.prototype.statusPay;
|