vk-payments 0.0.11 → 0.0.12
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 +83 -23
- 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/mercadopago/components/mercadopago.component.js +44 -18
- package/esm2015/lib/mercadopago/models/mercadopago.model.js +3 -1
- package/esm2015/lib/sps-decidir/components/sps-decidir.component.js +22 -2
- package/esm2015/lib/sps-decidir/models/payment.model.js +3 -1
- package/esm5/lib/mercadopago/components/mercadopago.component.js +54 -19
- package/esm5/lib/mercadopago/models/mercadopago.model.js +3 -1
- package/esm5/lib/sps-decidir/components/sps-decidir.component.js +28 -2
- package/esm5/lib/sps-decidir/models/payment.model.js +3 -1
- package/fesm2015/vk-payments.js +62 -18
- package/fesm2015/vk-payments.js.map +1 -1
- package/fesm5/vk-payments.js +78 -19
- package/fesm5/vk-payments.js.map +1 -1
- package/lib/mercadopago/components/mercadopago.component.d.ts +2 -0
- package/lib/mercadopago/models/mercadopago.model.d.ts +1 -0
- package/lib/sps-decidir/components/sps-decidir.component.d.ts +1 -0
- package/lib/sps-decidir/models/payment.model.d.ts +1 -0
- package/package.json +1 -1
- package/vk-payments.metadata.json +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@angular/common/http')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('vk-payments', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/router', '@angular/common/http'], factory) :
|
|
4
|
-
(global = global || self, factory(global['vk-payments'] = {}, global.ng.core, global.ng.common, global.ng.forms, global.ng.router, global.ng.common.http));
|
|
5
|
-
}(this, function (exports, core, common, forms, router, http) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@angular/common/http'), require('sha1'), require('sha256')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('vk-payments', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/router', '@angular/common/http', 'sha1', 'sha256'], factory) :
|
|
4
|
+
(global = global || self, factory(global['vk-payments'] = {}, global.ng.core, global.ng.common, global.ng.forms, global.ng.router, global.ng.common.http, global.sha1, global.sha256));
|
|
5
|
+
}(this, function (exports, core, common, forms, router, http, sha1, sha256) { 'use strict';
|
|
6
|
+
|
|
7
|
+
sha1 = sha1 && sha1.hasOwnProperty('default') ? sha1['default'] : sha1;
|
|
8
|
+
sha256 = sha256 && sha256.hasOwnProperty('default') ? sha256['default'] : sha256;
|
|
6
9
|
|
|
7
10
|
/*! *****************************************************************************
|
|
8
11
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -422,7 +425,8 @@
|
|
|
422
425
|
* @return {?}
|
|
423
426
|
*/
|
|
424
427
|
function () {
|
|
425
|
-
|
|
428
|
+
/** @type {?} */
|
|
429
|
+
var hashedCard = this.hashText(this.cardText, 100000);
|
|
426
430
|
this.cardPayment = {
|
|
427
431
|
tokenId: this.tokenId,
|
|
428
432
|
transactionAmount: this.totalAmount,
|
|
@@ -433,24 +437,31 @@
|
|
|
433
437
|
codCP: this.idVen,
|
|
434
438
|
docNumber: this.checkOutForm.value.docNumber,
|
|
435
439
|
additionalData: this.data,
|
|
436
|
-
storeId: this.storeId
|
|
440
|
+
storeId: this.storeId,
|
|
441
|
+
hash: hashedCard
|
|
437
442
|
};
|
|
438
|
-
this.
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}
|
|
443
|
+
this.mercadoPagoPayment();
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* @private
|
|
447
|
+
* @param {?} text
|
|
448
|
+
* @param {?} iterations
|
|
449
|
+
* @return {?}
|
|
450
|
+
*/
|
|
451
|
+
MercadoPagoComponent.prototype.hashText = /**
|
|
452
|
+
* @private
|
|
453
|
+
* @param {?} text
|
|
454
|
+
* @param {?} iterations
|
|
455
|
+
* @return {?}
|
|
456
|
+
*/
|
|
457
|
+
function (text, iterations) {
|
|
458
|
+
/** @type {?} */
|
|
459
|
+
var hashedtext = text;
|
|
460
|
+
for (var i = 0; i < iterations; i++) {
|
|
461
|
+
hashedtext = sha256(hashedtext);
|
|
462
|
+
}
|
|
463
|
+
hashedtext = sha1(hashedtext);
|
|
464
|
+
return hashedtext;
|
|
454
465
|
};
|
|
455
466
|
/**
|
|
456
467
|
* @private
|
|
@@ -893,6 +904,31 @@
|
|
|
893
904
|
console.log(message, JSON.stringify(data));
|
|
894
905
|
}
|
|
895
906
|
};
|
|
907
|
+
/**
|
|
908
|
+
* @return {?}
|
|
909
|
+
*/
|
|
910
|
+
MercadoPagoComponent.prototype.mercadoPagoPayment = /**
|
|
911
|
+
* @return {?}
|
|
912
|
+
*/
|
|
913
|
+
function () {
|
|
914
|
+
var _this = this;
|
|
915
|
+
this.mercadopagoApiService.makePayment(this.cardPayment, this.accessToken, this.vkUrlApi)
|
|
916
|
+
.subscribe((/**
|
|
917
|
+
* @param {?} res
|
|
918
|
+
* @return {?}
|
|
919
|
+
*/
|
|
920
|
+
function (res) {
|
|
921
|
+
_this.paymentResponseHandler(res);
|
|
922
|
+
}), (/**
|
|
923
|
+
* @param {?} error
|
|
924
|
+
* @return {?}
|
|
925
|
+
*/
|
|
926
|
+
function (error) {
|
|
927
|
+
_this.statusPay.emit(_this.paymentResult);
|
|
928
|
+
_this.paymentState = 'apiError';
|
|
929
|
+
console.log(error);
|
|
930
|
+
}));
|
|
931
|
+
};
|
|
896
932
|
/**
|
|
897
933
|
* @return {?}
|
|
898
934
|
*/
|
|
@@ -1760,6 +1796,8 @@
|
|
|
1760
1796
|
function (form, paymentResponse) {
|
|
1761
1797
|
var _this = this;
|
|
1762
1798
|
this.logger('makePayment:', JSON.stringify(paymentResponse));
|
|
1799
|
+
/** @type {?} */
|
|
1800
|
+
var hashedCard = this.hashText(this.cardText, 100000);
|
|
1763
1801
|
this.payment = {
|
|
1764
1802
|
token: paymentResponse.id,
|
|
1765
1803
|
amount: this.totalAmount,
|
|
@@ -1775,7 +1813,8 @@
|
|
|
1775
1813
|
cardholder: this.payerNameText,
|
|
1776
1814
|
storeId: this.storeId,
|
|
1777
1815
|
data: this.data,
|
|
1778
|
-
subPayments: []
|
|
1816
|
+
subPayments: [],
|
|
1817
|
+
creditCardHash: hashedCard
|
|
1779
1818
|
};
|
|
1780
1819
|
this.logger('payment:', JSON.stringify(this.payment));
|
|
1781
1820
|
this.spsDecidirApiService.makePayment(this.payment, this.accessToken, this.vkUrlApi)
|
|
@@ -1795,6 +1834,27 @@
|
|
|
1795
1834
|
console.error(error);
|
|
1796
1835
|
}));
|
|
1797
1836
|
};
|
|
1837
|
+
/**
|
|
1838
|
+
* @private
|
|
1839
|
+
* @param {?} text
|
|
1840
|
+
* @param {?} iterations
|
|
1841
|
+
* @return {?}
|
|
1842
|
+
*/
|
|
1843
|
+
SpsDecidirComponent.prototype.hashText = /**
|
|
1844
|
+
* @private
|
|
1845
|
+
* @param {?} text
|
|
1846
|
+
* @param {?} iterations
|
|
1847
|
+
* @return {?}
|
|
1848
|
+
*/
|
|
1849
|
+
function (text, iterations) {
|
|
1850
|
+
/** @type {?} */
|
|
1851
|
+
var hashedtext = text;
|
|
1852
|
+
for (var i = 0; i < iterations; i++) {
|
|
1853
|
+
hashedtext = sha256(hashedtext);
|
|
1854
|
+
}
|
|
1855
|
+
hashedtext = sha1(hashedtext);
|
|
1856
|
+
return hashedtext;
|
|
1857
|
+
};
|
|
1798
1858
|
/**
|
|
1799
1859
|
* @param {?} response
|
|
1800
1860
|
* @return {?}
|