vk-payments 0.0.19 → 0.0.21

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.
@@ -1453,6 +1453,19 @@
1453
1453
  this._setAuthHeaders(access_token);
1454
1454
  return this.httpClient.post(this.normalizeUrl(url) + '/Payment', payment, { headers: this.authHeaders });
1455
1455
  };
1456
+ /**
1457
+ * @param {?} bin
1458
+ * @param {?} url
1459
+ * @return {?}
1460
+ */
1461
+ SpsDecidirApiService.prototype.getDecidirConfigByBin = /**
1462
+ * @param {?} bin
1463
+ * @param {?} url
1464
+ * @return {?}
1465
+ */
1466
+ function (bin, url) {
1467
+ return this.httpClient.get(this.normalizeUrl(url) + ("/GetDecidirConfigByBin?bin=" + bin));
1468
+ };
1456
1469
  /**
1457
1470
  * @param {?} url
1458
1471
  * @return {?}
@@ -1698,7 +1711,7 @@
1698
1711
  function () {
1699
1712
  this.decidir = new Decidir(this.spsDecidirApiService.normalizeUrl(this.spsUrlApi), !this.useCybersource);
1700
1713
  this.decidir.setTimeout(15000);
1701
- this.decidir.setPublishableKey(this.publishableKey);
1714
+ this.decidir.setPublishableKey(this.defaultPublishableKey);
1702
1715
  };
1703
1716
  /**
1704
1717
  * @private
@@ -1771,23 +1784,34 @@
1771
1784
  if (!this.checkOutForm.valid) {
1772
1785
  return;
1773
1786
  }
1774
- this.paymentState = 'processing';
1775
- /** @type {?} */
1776
- var form = document.querySelector('#formulario');
1777
- this.decidir.createToken(form, (/**
1778
- * @param {?} status
1779
- * @param {?} response
1787
+ this.spsDecidirApiService.getDecidirConfigByBin(this.cardText.substring(0, 8), this.vkUrlApi)
1788
+ .subscribe((/**
1789
+ * @param {?} config
1780
1790
  * @return {?}
1781
1791
  */
1782
- function (status, response) {
1783
- if (status !== 200 && status !== 201) {
1784
- _this.paymentState = 'error';
1785
- _this.statusPay.emit(_this.paymentResult);
1786
- _this.processErrorToken(response);
1787
- }
1788
- else {
1789
- _this.makePayment(form, response);
1792
+ function (config) {
1793
+ if (config = 'SPS-Decidir-Supervielle') {
1794
+ console.log('Modo Supervielle');
1795
+ _this.decidir.setPublishableKey(_this.superviellePublishableKey);
1790
1796
  }
1797
+ _this.paymentState = 'processing';
1798
+ /** @type {?} */
1799
+ var form = document.querySelector('#formulario');
1800
+ _this.decidir.createToken(form, (/**
1801
+ * @param {?} status
1802
+ * @param {?} response
1803
+ * @return {?}
1804
+ */
1805
+ function (status, response) {
1806
+ if (status !== 200 && status !== 201) {
1807
+ _this.paymentState = 'error';
1808
+ _this.statusPay.emit(_this.paymentResult);
1809
+ _this.processErrorToken(response);
1810
+ }
1811
+ else {
1812
+ _this.makePayment(form, response);
1813
+ }
1814
+ }));
1791
1815
  }));
1792
1816
  };
1793
1817
  /**
@@ -2351,7 +2375,7 @@
2351
2375
  bin.substring(0, 2) === '53' ||
2352
2376
  bin.substring(0, 2) === '54' ||
2353
2377
  bin.substring(0, 2) === '55') {
2354
- this.issuer = 15;
2378
+ this.issuer = 104;
2355
2379
  }
2356
2380
  // tarjeta naranja
2357
2381
  else if (bin.substring(0, 6) === '589562') {
@@ -2431,7 +2455,8 @@
2431
2455
  paymentAmount: [{ type: core.Input }],
2432
2456
  logoSps: [{ type: core.Input }],
2433
2457
  currency: [{ type: core.Input }],
2434
- publishableKey: [{ type: core.Input }],
2458
+ defaultPublishableKey: [{ type: core.Input }],
2459
+ superviellePublishableKey: [{ type: core.Input }],
2435
2460
  successUrl: [{ type: core.Input }],
2436
2461
  failureUrl: [{ type: core.Input }],
2437
2462
  useCybersource: [{ type: core.Input }],
@@ -2462,7 +2487,9 @@
2462
2487
  /** @type {?} */
2463
2488
  SpsDecidirComponent.prototype.currency;
2464
2489
  /** @type {?} */
2465
- SpsDecidirComponent.prototype.publishableKey;
2490
+ SpsDecidirComponent.prototype.defaultPublishableKey;
2491
+ /** @type {?} */
2492
+ SpsDecidirComponent.prototype.superviellePublishableKey;
2466
2493
  /** @type {?} */
2467
2494
  SpsDecidirComponent.prototype.successUrl;
2468
2495
  /** @type {?} */