@blindpay/node 2.4.0 → 3.0.0

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 (77) hide show
  1. package/dist/{api-client-Cw2mNJeR.d.mts → api-client-B7VQkM_4.d.mts} +96 -35
  2. package/dist/{api-client-Cw2mNJeR.d.ts → api-client-B7VQkM_4.d.ts} +96 -35
  3. package/dist/{chunk-5XJJKYXE.mjs → chunk-LEPGLH7Q.mjs} +20 -10
  4. package/dist/{chunk-3QQCDR3E.mjs → chunk-VBZHAPK7.mjs} +8 -0
  5. package/dist/{chunk-OTRFWEEC.mjs → chunk-VRA5HP7F.mjs} +4 -0
  6. package/dist/{chunk-4DVSRRBP.mjs → chunk-WH2VNZE7.mjs} +25 -22
  7. package/dist/index.d.mts +14 -14
  8. package/dist/index.d.ts +14 -14
  9. package/dist/index.js +50 -25
  10. package/dist/index.mjs +8 -8
  11. package/dist/resources/api-keys/api-keys.test.js +50 -25
  12. package/dist/resources/api-keys/api-keys.test.mjs +5 -5
  13. package/dist/resources/api-keys/index.d.mts +1 -1
  14. package/dist/resources/api-keys/index.d.ts +1 -1
  15. package/dist/resources/available/available.test.js +50 -25
  16. package/dist/resources/available/available.test.mjs +5 -5
  17. package/dist/resources/available/index.d.mts +1 -1
  18. package/dist/resources/available/index.d.ts +1 -1
  19. package/dist/resources/bank-accounts/bank-accounts.test.js +50 -25
  20. package/dist/resources/bank-accounts/bank-accounts.test.mjs +5 -5
  21. package/dist/resources/bank-accounts/index.d.mts +2 -4
  22. package/dist/resources/bank-accounts/index.d.ts +2 -4
  23. package/dist/resources/instances/index.d.mts +1 -1
  24. package/dist/resources/instances/index.d.ts +1 -1
  25. package/dist/resources/instances/instances.test.js +50 -25
  26. package/dist/resources/instances/instances.test.mjs +5 -5
  27. package/dist/resources/partner-fees/index.d.mts +1 -1
  28. package/dist/resources/partner-fees/index.d.ts +1 -1
  29. package/dist/resources/partner-fees/partner-fees.test.js +50 -25
  30. package/dist/resources/partner-fees/partner-fees.test.mjs +5 -5
  31. package/dist/resources/payins/index.d.mts +9 -33
  32. package/dist/resources/payins/index.d.ts +9 -33
  33. package/dist/resources/payins/payins-quotes.test.js +100 -25
  34. package/dist/resources/payins/payins-quotes.test.mjs +55 -5
  35. package/dist/resources/payins/payins.test.js +164 -52
  36. package/dist/resources/payins/payins.test.mjs +119 -32
  37. package/dist/resources/payins/quotes.d.mts +38 -2
  38. package/dist/resources/payins/quotes.d.ts +38 -2
  39. package/dist/resources/payins/quotes.js +4 -0
  40. package/dist/resources/payins/quotes.mjs +1 -1
  41. package/dist/resources/payouts/index.d.mts +42 -17
  42. package/dist/resources/payouts/index.d.ts +42 -17
  43. package/dist/resources/payouts/index.js +8 -0
  44. package/dist/resources/payouts/index.mjs +1 -1
  45. package/dist/resources/payouts/payouts.test.js +162 -27
  46. package/dist/resources/payouts/payouts.test.mjs +117 -7
  47. package/dist/resources/quotes/index.d.mts +1 -1
  48. package/dist/resources/quotes/index.d.ts +1 -1
  49. package/dist/resources/quotes/quotes.test.js +50 -25
  50. package/dist/resources/quotes/quotes.test.mjs +5 -5
  51. package/dist/resources/receivers/index.d.mts +9 -7
  52. package/dist/resources/receivers/index.d.ts +9 -7
  53. package/dist/resources/receivers/receivers.test.js +57 -33
  54. package/dist/resources/receivers/receivers.test.mjs +12 -13
  55. package/dist/resources/terms-of-service/index.d.mts +1 -1
  56. package/dist/resources/terms-of-service/index.d.ts +1 -1
  57. package/dist/resources/terms-of-service/terms-of-service.test.js +50 -25
  58. package/dist/resources/terms-of-service/terms-of-service.test.mjs +5 -5
  59. package/dist/resources/virtual-accounts/index.d.mts +22 -7
  60. package/dist/resources/virtual-accounts/index.d.ts +22 -7
  61. package/dist/resources/virtual-accounts/index.js +20 -10
  62. package/dist/resources/virtual-accounts/index.mjs +1 -1
  63. package/dist/resources/virtual-accounts/virtual-accounts.test.js +169 -44
  64. package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +124 -24
  65. package/dist/resources/wallets/blockchain.d.mts +1 -1
  66. package/dist/resources/wallets/blockchain.d.ts +1 -1
  67. package/dist/resources/wallets/blockchain.test.js +50 -25
  68. package/dist/resources/wallets/blockchain.test.mjs +5 -5
  69. package/dist/resources/wallets/offramp.d.mts +1 -1
  70. package/dist/resources/wallets/offramp.d.ts +1 -1
  71. package/dist/resources/wallets/offramp.test.js +50 -25
  72. package/dist/resources/wallets/offramp.test.mjs +5 -5
  73. package/dist/resources/webhooks/index.d.mts +1 -1
  74. package/dist/resources/webhooks/index.d.ts +1 -1
  75. package/dist/resources/webhooks/webhooks.test.js +50 -25
  76. package/dist/resources/webhooks/webhooks.test.mjs +5 -5
  77. package/package.json +6 -2
@@ -18699,10 +18699,10 @@ function getImporter(name) {
18699
18699
  var import_expect_type = __toESM(require_dist(), 1);
18700
18700
 
18701
18701
  // src/client.ts
18702
- var import_node_crypto = require("crypto");
18702
+ var import_svix = require("svix");
18703
18703
 
18704
18704
  // package.json
18705
- var version = "2.4.0";
18705
+ var version = "3.0.0";
18706
18706
 
18707
18707
  // src/internal/blindpay-error.ts
18708
18708
  var BlindPayError = class extends Error {
@@ -18931,6 +18931,10 @@ function createPayinQuotesResource(instanceId, client) {
18931
18931
  },
18932
18932
  get(id) {
18933
18933
  return client.get(`/instances/${instanceId}/payin-quotes/${id}`);
18934
+ },
18935
+ list(params) {
18936
+ const queryParams = params ? `?${new URLSearchParams(params)}` : "";
18937
+ return client.get(`/instances/${instanceId}/payin-quotes${queryParams}`);
18934
18938
  }
18935
18939
  };
18936
18940
  }
@@ -18963,6 +18967,14 @@ function createPayoutsResource(instanceId, client) {
18963
18967
  createEvm(_c) {
18964
18968
  var data = __objRest(_c, []);
18965
18969
  return client.post(`/instances/${instanceId}/payouts/evm`, data);
18970
+ },
18971
+ authorizeSolana(_d) {
18972
+ var data = __objRest(_d, []);
18973
+ return client.post(`/instances/${instanceId}/payouts/solana/authorize`, data);
18974
+ },
18975
+ createSolana(_e) {
18976
+ var data = __objRest(_e, []);
18977
+ return client.post(`/instances/${instanceId}/payouts/solana`, data);
18966
18978
  }
18967
18979
  };
18968
18980
  }
@@ -19055,30 +19067,40 @@ function createTermsOfServiceResource(instanceId, client) {
19055
19067
  // src/resources/virtual-accounts/index.ts
19056
19068
  function createVirtualAccountsResource(instanceId, client) {
19057
19069
  return {
19058
- update(_a3) {
19070
+ list(receiver_id) {
19071
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19072
+ },
19073
+ get({
19074
+ receiver_id,
19075
+ id
19076
+ }) {
19077
+ return client.get(
19078
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts/${id}`
19079
+ );
19080
+ },
19081
+ create(_a3) {
19059
19082
  var _b = _a3, {
19060
19083
  receiver_id
19061
19084
  } = _b, data = __objRest(_b, [
19062
19085
  "receiver_id"
19063
19086
  ]);
19064
- return client.put(
19087
+ return client.post(
19065
19088
  `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19066
19089
  data
19067
19090
  );
19068
19091
  },
19069
- create(_c) {
19092
+ update(_c) {
19070
19093
  var _d = _c, {
19071
- receiver_id
19094
+ receiver_id,
19095
+ id
19072
19096
  } = _d, data = __objRest(_d, [
19073
- "receiver_id"
19097
+ "receiver_id",
19098
+ "id"
19074
19099
  ]);
19075
- return client.post(
19076
- `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19100
+ return client.put(
19101
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts/${id}`,
19077
19102
  data
19078
19103
  );
19079
- },
19080
- get(receiver_id) {
19081
- return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19082
19104
  }
19083
19105
  };
19084
19106
  }
@@ -19336,26 +19358,29 @@ var BlindPay = class {
19336
19358
  });
19337
19359
  }
19338
19360
  /**
19339
- * Verifies the BlindPay webhook signature
19361
+ * Verifies the BlindPay webhook signature using Svix
19340
19362
  *
19341
19363
  * @param params.secret The webhook secret from BlindPay dashboard
19342
- * @param params.id The value of the `svix-id` header
19343
- * @param params.timestamp The value of the `svix-timestamp` header
19344
- * @param params.payload The raw request body
19345
- * @param params.svixSignature The value of the `svix-signature` header
19364
+ * @param params.headers The webhook headers object containing svix-id, svix-timestamp, and svix-signature
19365
+ * @param params.payload The raw request body as a string
19346
19366
  * @returns {boolean} True if the signature is valid, false otherwise
19347
19367
  */
19348
19368
  verifyWebhookSignature({
19349
19369
  secret,
19350
- id,
19351
- timestamp,
19352
- payload,
19353
- svixSignature
19370
+ headers,
19371
+ payload
19354
19372
  }) {
19355
- const signedContent = `${id}.${timestamp}.${payload}`;
19356
- const secretBytes = Buffer.from(secret.split("_")[1], "base64");
19357
- const expectedSignature = (0, import_node_crypto.createHmac)("sha256", secretBytes).update(signedContent).digest("base64");
19358
- return svixSignature.length === expectedSignature.length && (0, import_node_crypto.timingSafeEqual)(Buffer.from(svixSignature), Buffer.from(expectedSignature));
19373
+ try {
19374
+ const webhook = new import_svix.Webhook(secret);
19375
+ webhook.verify(payload, {
19376
+ "svix-id": headers.id,
19377
+ "svix-timestamp": headers.timestamp,
19378
+ "svix-signature": headers.signature
19379
+ });
19380
+ return true;
19381
+ } catch (e) {
19382
+ return false;
19383
+ }
19359
19384
  }
19360
19385
  };
19361
19386
 
@@ -19452,6 +19477,56 @@ describe("Payin quotes", () => {
19452
19477
  globalExpect(data).toEqual(mockedPayinQuote);
19453
19478
  }));
19454
19479
  });
19480
+ describe("List payin quotes", () => {
19481
+ it("should get a payin quote", () => __async(null, null, function* () {
19482
+ const mockedPayinQuote = {
19483
+ data: [
19484
+ {
19485
+ id: "qu_000000000000",
19486
+ payment_method: "pix",
19487
+ token: "USDC",
19488
+ request_amount: 1e3,
19489
+ cover_fees: true,
19490
+ currency_type: "sender",
19491
+ expires_at: 1712958191,
19492
+ currency: "BRL",
19493
+ commercial_quotation: 495,
19494
+ blindpay_quotation: 505,
19495
+ receiver_amount: 1010,
19496
+ sender_amount: 5240,
19497
+ partner_fee_amount: 150,
19498
+ flat_fee: 50,
19499
+ total_fee_amount: 1.53,
19500
+ payer_rules: {
19501
+ pix_allowed_tax_ids: ["149.476.037-68"]
19502
+ },
19503
+ blockchain_wallet_id: "bw_000000000000",
19504
+ instance_id: "in_000000000000",
19505
+ partner_fee_id: "pf_000000000000",
19506
+ billing_fee: 100,
19507
+ created_at: "2021-01-01T00:00:00Z",
19508
+ updated_at: "2021-01-01T00:00:00Z"
19509
+ }
19510
+ ],
19511
+ pagination: {
19512
+ has_more: true,
19513
+ next_page: "qu_123",
19514
+ prev_page: "qu_123"
19515
+ }
19516
+ };
19517
+ fetchMock.mockResponseOnce(JSON.stringify(mockedPayinQuote), {
19518
+ headers: { "Content-Type": "application/json" }
19519
+ });
19520
+ const { data, error } = yield blindpay.payins.quotes.list({
19521
+ blockchain_wallet_id: "bw_000000000000",
19522
+ payment_method: "pix",
19523
+ token: "USDC",
19524
+ receiver_id: "re_000000000000"
19525
+ });
19526
+ globalExpect(error).toBeNull();
19527
+ globalExpect(data).toEqual(mockedPayinQuote);
19528
+ }));
19529
+ });
19455
19530
  });
19456
19531
  /*! Bundled license information:
19457
19532
 
@@ -8,21 +8,21 @@ import {
8
8
  import {
9
9
  BlindPay,
10
10
  init_client
11
- } from "../../chunk-4DVSRRBP.mjs";
11
+ } from "../../chunk-WH2VNZE7.mjs";
12
12
  import "../../chunk-FG25JHDX.mjs";
13
13
  import "../../chunk-QGNLMN6Z.mjs";
14
14
  import "../../chunk-UC57SCKQ.mjs";
15
15
  import "../../chunk-TBTA7A2P.mjs";
16
16
  import "../../chunk-67XECGMJ.mjs";
17
17
  import "../../chunk-Z6EYX4D3.mjs";
18
- import "../../chunk-5XJJKYXE.mjs";
18
+ import "../../chunk-LEPGLH7Q.mjs";
19
19
  import "../../chunk-RC5NN5UF.mjs";
20
20
  import "../../chunk-W7NJUABI.mjs";
21
- import "../../chunk-OTRFWEEC.mjs";
22
- import "../../chunk-3QQCDR3E.mjs";
21
+ import "../../chunk-VRA5HP7F.mjs";
22
+ import "../../chunk-VBZHAPK7.mjs";
23
23
  import "../../chunk-LRHWT4JU.mjs";
24
- import "../../chunk-U7CKUUO7.mjs";
25
24
  import "../../chunk-CPOSU35L.mjs";
25
+ import "../../chunk-U7CKUUO7.mjs";
26
26
  import "../../chunk-B5T7AQLH.mjs";
27
27
  import {
28
28
  __async,
@@ -126,6 +126,56 @@ var require_payins_quotes_test = __commonJS({
126
126
  globalExpect(data).toEqual(mockedPayinQuote);
127
127
  }));
128
128
  });
129
+ describe("List payin quotes", () => {
130
+ it("should get a payin quote", () => __async(null, null, function* () {
131
+ const mockedPayinQuote = {
132
+ data: [
133
+ {
134
+ id: "qu_000000000000",
135
+ payment_method: "pix",
136
+ token: "USDC",
137
+ request_amount: 1e3,
138
+ cover_fees: true,
139
+ currency_type: "sender",
140
+ expires_at: 1712958191,
141
+ currency: "BRL",
142
+ commercial_quotation: 495,
143
+ blindpay_quotation: 505,
144
+ receiver_amount: 1010,
145
+ sender_amount: 5240,
146
+ partner_fee_amount: 150,
147
+ flat_fee: 50,
148
+ total_fee_amount: 1.53,
149
+ payer_rules: {
150
+ pix_allowed_tax_ids: ["149.476.037-68"]
151
+ },
152
+ blockchain_wallet_id: "bw_000000000000",
153
+ instance_id: "in_000000000000",
154
+ partner_fee_id: "pf_000000000000",
155
+ billing_fee: 100,
156
+ created_at: "2021-01-01T00:00:00Z",
157
+ updated_at: "2021-01-01T00:00:00Z"
158
+ }
159
+ ],
160
+ pagination: {
161
+ has_more: true,
162
+ next_page: "qu_123",
163
+ prev_page: "qu_123"
164
+ }
165
+ };
166
+ fetchMock.mockResponseOnce(JSON.stringify(mockedPayinQuote), {
167
+ headers: { "Content-Type": "application/json" }
168
+ });
169
+ const { data, error } = yield blindpay.payins.quotes.list({
170
+ blockchain_wallet_id: "bw_000000000000",
171
+ payment_method: "pix",
172
+ token: "USDC",
173
+ receiver_id: "re_000000000000"
174
+ });
175
+ globalExpect(error).toBeNull();
176
+ globalExpect(data).toEqual(mockedPayinQuote);
177
+ }));
178
+ });
129
179
  });
130
180
  }
131
181
  });
@@ -18699,10 +18699,10 @@ function getImporter(name) {
18699
18699
  var import_expect_type = __toESM(require_dist(), 1);
18700
18700
 
18701
18701
  // src/client.ts
18702
- var import_node_crypto = require("crypto");
18702
+ var import_svix = require("svix");
18703
18703
 
18704
18704
  // package.json
18705
- var version = "2.4.0";
18705
+ var version = "3.0.0";
18706
18706
 
18707
18707
  // src/internal/blindpay-error.ts
18708
18708
  var BlindPayError = class extends Error {
@@ -18931,6 +18931,10 @@ function createPayinQuotesResource(instanceId, client) {
18931
18931
  },
18932
18932
  get(id) {
18933
18933
  return client.get(`/instances/${instanceId}/payin-quotes/${id}`);
18934
+ },
18935
+ list(params) {
18936
+ const queryParams = params ? `?${new URLSearchParams(params)}` : "";
18937
+ return client.get(`/instances/${instanceId}/payin-quotes${queryParams}`);
18934
18938
  }
18935
18939
  };
18936
18940
  }
@@ -18963,6 +18967,14 @@ function createPayoutsResource(instanceId, client) {
18963
18967
  createEvm(_c) {
18964
18968
  var data = __objRest(_c, []);
18965
18969
  return client.post(`/instances/${instanceId}/payouts/evm`, data);
18970
+ },
18971
+ authorizeSolana(_d) {
18972
+ var data = __objRest(_d, []);
18973
+ return client.post(`/instances/${instanceId}/payouts/solana/authorize`, data);
18974
+ },
18975
+ createSolana(_e) {
18976
+ var data = __objRest(_e, []);
18977
+ return client.post(`/instances/${instanceId}/payouts/solana`, data);
18966
18978
  }
18967
18979
  };
18968
18980
  }
@@ -19055,30 +19067,40 @@ function createTermsOfServiceResource(instanceId, client) {
19055
19067
  // src/resources/virtual-accounts/index.ts
19056
19068
  function createVirtualAccountsResource(instanceId, client) {
19057
19069
  return {
19058
- update(_a3) {
19070
+ list(receiver_id) {
19071
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19072
+ },
19073
+ get({
19074
+ receiver_id,
19075
+ id
19076
+ }) {
19077
+ return client.get(
19078
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts/${id}`
19079
+ );
19080
+ },
19081
+ create(_a3) {
19059
19082
  var _b = _a3, {
19060
19083
  receiver_id
19061
19084
  } = _b, data = __objRest(_b, [
19062
19085
  "receiver_id"
19063
19086
  ]);
19064
- return client.put(
19087
+ return client.post(
19065
19088
  `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19066
19089
  data
19067
19090
  );
19068
19091
  },
19069
- create(_c) {
19092
+ update(_c) {
19070
19093
  var _d = _c, {
19071
- receiver_id
19094
+ receiver_id,
19095
+ id
19072
19096
  } = _d, data = __objRest(_d, [
19073
- "receiver_id"
19097
+ "receiver_id",
19098
+ "id"
19074
19099
  ]);
19075
- return client.post(
19076
- `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19100
+ return client.put(
19101
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts/${id}`,
19077
19102
  data
19078
19103
  );
19079
- },
19080
- get(receiver_id) {
19081
- return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19082
19104
  }
19083
19105
  };
19084
19106
  }
@@ -19336,26 +19358,29 @@ var BlindPay = class {
19336
19358
  });
19337
19359
  }
19338
19360
  /**
19339
- * Verifies the BlindPay webhook signature
19361
+ * Verifies the BlindPay webhook signature using Svix
19340
19362
  *
19341
19363
  * @param params.secret The webhook secret from BlindPay dashboard
19342
- * @param params.id The value of the `svix-id` header
19343
- * @param params.timestamp The value of the `svix-timestamp` header
19344
- * @param params.payload The raw request body
19345
- * @param params.svixSignature The value of the `svix-signature` header
19364
+ * @param params.headers The webhook headers object containing svix-id, svix-timestamp, and svix-signature
19365
+ * @param params.payload The raw request body as a string
19346
19366
  * @returns {boolean} True if the signature is valid, false otherwise
19347
19367
  */
19348
19368
  verifyWebhookSignature({
19349
19369
  secret,
19350
- id,
19351
- timestamp,
19352
- payload,
19353
- svixSignature
19370
+ headers,
19371
+ payload
19354
19372
  }) {
19355
- const signedContent = `${id}.${timestamp}.${payload}`;
19356
- const secretBytes = Buffer.from(secret.split("_")[1], "base64");
19357
- const expectedSignature = (0, import_node_crypto.createHmac)("sha256", secretBytes).update(signedContent).digest("base64");
19358
- return svixSignature.length === expectedSignature.length && (0, import_node_crypto.timingSafeEqual)(Buffer.from(svixSignature), Buffer.from(expectedSignature));
19373
+ try {
19374
+ const webhook = new import_svix.Webhook(secret);
19375
+ webhook.verify(payload, {
19376
+ "svix-id": headers.id,
19377
+ "svix-timestamp": headers.timestamp,
19378
+ "svix-signature": headers.signature
19379
+ });
19380
+ return true;
19381
+ } catch (e) {
19382
+ return false;
19383
+ }
19359
19384
  }
19360
19385
  };
19361
19386
 
@@ -19379,20 +19404,38 @@ describe("Payins", () => {
19379
19404
  tracking_transaction: {
19380
19405
  step: "processing",
19381
19406
  status: "failed",
19382
- transaction_hash: "0x123...890",
19383
- completed_at: "2011-10-05T14:48:00.000Z"
19407
+ external_id: "12345678",
19408
+ completed_at: "2011-10-05T14:48:00.000Z",
19409
+ sender_name: "John Doe Smith",
19410
+ sender_tax_id: "123.456.789-10",
19411
+ sender_bank_code: "00416968",
19412
+ sender_account_number: "1234567890",
19413
+ trace_number: "1234567890",
19414
+ transaction_reference: "1234567890",
19415
+ description: "Payment from John Doe Smith",
19416
+ pse_instruction: {
19417
+ payment_link: "https://pse.example.com/payment/abc123",
19418
+ fid: "fid_abc123",
19419
+ full_name: "Juan P\xE9rez Garc\xEDa",
19420
+ tax_id: "1234567890",
19421
+ document_type: "CC",
19422
+ phone: "+573001234567",
19423
+ email: "juan@example.com",
19424
+ bank_code: "1007"
19425
+ },
19426
+ transfers_instruction: {
19427
+ account: "0000003100012389237485",
19428
+ type: "CVU",
19429
+ tax_id: "20123456783"
19430
+ }
19384
19431
  },
19385
19432
  tracking_payment: {
19386
19433
  step: "on_hold",
19387
19434
  provider_name: "blockchain",
19388
- provider_transaction_id: "tx_123456789",
19389
- provider_status: "confirmed",
19390
- estimated_time_of_arrival: "2011-10-05T15:00:00.000Z",
19391
19435
  completed_at: "2011-10-05T14:48:00.000Z"
19392
19436
  },
19393
19437
  tracking_complete: {
19394
19438
  step: "on_hold",
19395
- status: "completed",
19396
19439
  transaction_hash: "0x123...890",
19397
19440
  completed_at: "2011-10-05T14:48:00.000Z"
19398
19441
  },
@@ -19453,8 +19496,8 @@ describe("Payins", () => {
19453
19496
  ],
19454
19497
  pagination: {
19455
19498
  has_more: true,
19456
- next_page: 3,
19457
- prev_page: 1
19499
+ next_page: "pi_123",
19500
+ prev_page: "pi_123"
19458
19501
  }
19459
19502
  };
19460
19503
  fetchMock.mockResponseOnce(JSON.stringify(mockedPayins), {
@@ -19479,20 +19522,38 @@ describe("Payins", () => {
19479
19522
  tracking_transaction: {
19480
19523
  step: "processing",
19481
19524
  status: "failed",
19482
- transaction_hash: "0x123...890",
19483
- completed_at: "2011-10-05T14:48:00.000Z"
19525
+ external_id: "12345678",
19526
+ completed_at: "2011-10-05T14:48:00.000Z",
19527
+ sender_name: "John Doe Smith",
19528
+ sender_tax_id: "123.456.789-10",
19529
+ sender_bank_code: "00416968",
19530
+ sender_account_number: "1234567890",
19531
+ trace_number: "1234567890",
19532
+ transaction_reference: "1234567890",
19533
+ description: "Payment from John Doe Smith",
19534
+ pse_instruction: {
19535
+ payment_link: "https://pse.example.com/payment/abc123",
19536
+ fid: "fid_abc123",
19537
+ full_name: "Juan P\xE9rez Garc\xEDa",
19538
+ tax_id: "1234567890",
19539
+ document_type: "CC",
19540
+ phone: "+573001234567",
19541
+ email: "juan@example.com",
19542
+ bank_code: "1007"
19543
+ },
19544
+ transfers_instruction: {
19545
+ account: "0000003100012389237485",
19546
+ type: "CVU",
19547
+ tax_id: "20123456783"
19548
+ }
19484
19549
  },
19485
19550
  tracking_payment: {
19486
19551
  step: "on_hold",
19487
19552
  provider_name: "blockchain",
19488
- provider_transaction_id: "tx_123456789",
19489
- provider_status: "confirmed",
19490
- estimated_time_of_arrival: "2011-10-05T15:00:00.000Z",
19491
19553
  completed_at: "2011-10-05T14:48:00.000Z"
19492
19554
  },
19493
19555
  tracking_complete: {
19494
19556
  step: "on_hold",
19495
- status: "completed",
19496
19557
  transaction_hash: "0x123...890",
19497
19558
  completed_at: "2011-10-05T14:48:00.000Z"
19498
19559
  },
@@ -19580,7 +19641,22 @@ describe("Payins", () => {
19580
19641
  sender_account_number: "1234567890",
19581
19642
  trace_number: "1234567890",
19582
19643
  transaction_reference: "1234567890",
19583
- description: "Payment from John Doe Smith"
19644
+ description: "Payment from John Doe Smith",
19645
+ pse_instruction: {
19646
+ payment_link: "https://pse.example.com/payment/abc123",
19647
+ fid: "fid_abc123",
19648
+ full_name: "Juan P\xE9rez Garc\xEDa",
19649
+ tax_id: "1234567890",
19650
+ document_type: "CC",
19651
+ phone: "+573001234567",
19652
+ email: "juan@example.com",
19653
+ bank_code: "1007"
19654
+ },
19655
+ transfers_instruction: {
19656
+ account: "0000003100012389237485",
19657
+ type: "CVU",
19658
+ tax_id: "20123456783"
19659
+ }
19584
19660
  },
19585
19661
  tracking_payment: {
19586
19662
  step: "on_hold",
@@ -19669,20 +19745,38 @@ describe("Payins", () => {
19669
19745
  tracking_transaction: {
19670
19746
  step: "processing",
19671
19747
  status: "failed",
19672
- transaction_hash: "0x123...890",
19673
- completed_at: "2011-10-05T14:48:00.000Z"
19748
+ external_id: "12345678",
19749
+ completed_at: "2011-10-05T14:48:00.000Z",
19750
+ sender_name: "John Doe Smith",
19751
+ sender_tax_id: "123.456.789-10",
19752
+ sender_bank_code: "00416968",
19753
+ sender_account_number: "1234567890",
19754
+ trace_number: "1234567890",
19755
+ transaction_reference: "1234567890",
19756
+ description: "Payment from John Doe Smith",
19757
+ pse_instruction: {
19758
+ payment_link: "https://pse.example.com/payment/abc123",
19759
+ fid: "fid_abc123",
19760
+ full_name: "Juan P\xE9rez Garc\xEDa",
19761
+ tax_id: "1234567890",
19762
+ document_type: "CC",
19763
+ phone: "+573001234567",
19764
+ email: "juan@example.com",
19765
+ bank_code: "1007"
19766
+ },
19767
+ transfers_instruction: {
19768
+ account: "0000003100012389237485",
19769
+ type: "CVU",
19770
+ tax_id: "20123456783"
19771
+ }
19674
19772
  },
19675
19773
  tracking_payment: {
19676
19774
  step: "on_hold",
19677
19775
  provider_name: "blockchain",
19678
- provider_transaction_id: "tx_123456789",
19679
- provider_status: "confirmed",
19680
- estimated_time_of_arrival: "2011-10-05T15:00:00.000Z",
19681
19776
  completed_at: "2011-10-05T14:48:00.000Z"
19682
19777
  },
19683
19778
  tracking_complete: {
19684
19779
  step: "on_hold",
19685
- status: "completed",
19686
19780
  transaction_hash: "0x123...890",
19687
19781
  completed_at: "2011-10-05T14:48:00.000Z"
19688
19782
  },
@@ -19761,23 +19855,41 @@ describe("Payins", () => {
19761
19855
  clabe: "014027000000000008",
19762
19856
  tracking_complete: {
19763
19857
  step: "on_hold",
19764
- status: "completed",
19765
19858
  transaction_hash: "0x123...890",
19766
19859
  completed_at: "2011-10-05T14:48:00.000Z"
19767
19860
  },
19768
19861
  tracking_payment: {
19769
19862
  step: "on_hold",
19770
19863
  provider_name: "blockchain",
19771
- provider_transaction_id: "tx_123456789",
19772
- provider_status: "confirmed",
19773
- estimated_time_of_arrival: "2011-10-05T15:00:00.000Z",
19774
19864
  completed_at: "2011-10-05T14:48:00.000Z"
19775
19865
  },
19776
19866
  tracking_transaction: {
19777
19867
  step: "processing",
19778
19868
  status: "failed",
19779
- transaction_hash: "0x123...890",
19780
- completed_at: "2011-10-05T14:48:00.000Z"
19869
+ external_id: "12345678",
19870
+ completed_at: "2011-10-05T14:48:00.000Z",
19871
+ sender_name: "John Doe Smith",
19872
+ sender_tax_id: "123.456.789-10",
19873
+ sender_bank_code: "00416968",
19874
+ sender_account_number: "1234567890",
19875
+ trace_number: "1234567890",
19876
+ transaction_reference: "1234567890",
19877
+ description: "Payment from John Doe Smith",
19878
+ pse_instruction: {
19879
+ payment_link: "https://pse.example.com/payment/abc123",
19880
+ fid: "fid_abc123",
19881
+ full_name: "Juan P\xE9rez Garc\xEDa",
19882
+ tax_id: "1234567890",
19883
+ document_type: "CC",
19884
+ phone: "+573001234567",
19885
+ email: "juan@example.com",
19886
+ bank_code: "1007"
19887
+ },
19888
+ transfers_instruction: {
19889
+ account: "0000003100012389237485",
19890
+ type: "CVU",
19891
+ tax_id: "20123456783"
19892
+ }
19781
19893
  },
19782
19894
  tracking_partner_fee: {
19783
19895
  step: "on_hold",