@houlak/plexo-sdk 0.1.45 → 0.1.46

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.
@@ -123,7 +123,7 @@ var unwrapCallback = function (fingerprint, response) { return __awaiter(void 0,
123
123
  logger_lib_1.default.info(canonizedObject, 'Objeto canonizado');
124
124
  objectInPascalCase = utils_1.caseUtils.toPascalKeys(canonizedObject);
125
125
  objectSorted = signatureUtils_1.signatureUtils.sortObject(objectInPascalCase);
126
- objectWithAmounts = (0, stringifyWithFloats_1.stringifyAmountsWithFloats)(objectSorted);
126
+ objectWithAmounts = (0, stringifyWithFloats_1.stringifyAmountsWithFloats)(objectSorted, 2);
127
127
  logger_lib_1.default.info(objectWithAmounts, 'Objeto a verificar');
128
128
  objectBuffer = Buffer.from(JSON.stringify(objectWithAmounts));
129
129
  verifySignature = (0, crypto_1.createVerify)('SHA512')
@@ -1 +1 @@
1
- export declare const stringifyAmountsWithFloats: (object: any) => string;
1
+ export declare const stringifyAmountsWithFloats: (object: any, amountAfterComma?: number) => string;
@@ -56,7 +56,7 @@ var stringifyWithFloats = function (config, decimals) {
56
56
  // By using this, when we have for example Amount: 100, we replace that for Amount: 100.0.
57
57
  // If we send just 100, Plexo doesn't like that and we receive a
58
58
  // "signature does not match" error message
59
- var stringifyAmountsWithFloats = function (object) {
59
+ var stringifyAmountsWithFloats = function (object, amountAfterComma) {
60
60
  return stringifyWithFloats({
61
61
  amount: 'float',
62
62
  billedAmount: 'float',
@@ -68,6 +68,6 @@ var stringifyAmountsWithFloats = function (object) {
68
68
  TaxedAmount: 'float',
69
69
  VATAmount: 'float',
70
70
  ReturnAmount: 'float',
71
- }, 2)(object, null, 0);
71
+ }, amountAfterComma || 1)(object, null, 0);
72
72
  };
73
73
  exports.stringifyAmountsWithFloats = stringifyAmountsWithFloats;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@houlak/plexo-sdk",
3
- "version": "0.1.45",
3
+ "version": "0.1.46",
4
4
  "description": "Node SDK for Plexo payment services",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",