@vexpay/node 0.13.0 → 0.15.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.
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ function errorFromResponse(status, body, requestId) {
62
62
  }
63
63
 
64
64
  // src/version.ts
65
- var VERSION = "0.13.0";
65
+ var VERSION = "0.15.0";
66
66
 
67
67
  // src/core.ts
68
68
  var INITIAL_RETRY_DELAY_MS = 500;
@@ -236,6 +236,7 @@ var ROUTES = {
236
236
  Crypto_getBalances: { method: "GET", path: "/v1/crypto/balances" },
237
237
  Crypto_getPayout: { method: "GET", path: "/v1/crypto/payouts/{id}" },
238
238
  Crypto_listNetworks: { method: "GET", path: "/v1/crypto/networks" },
239
+ Crypto_simulateDeposit: { method: "POST", path: "/v1/crypto/deposit-addresses/simulate" },
239
240
  Customers_create: { method: "POST", path: "/v1/customers" },
240
241
  Customers_list: { method: "GET", path: "/v1/customers" },
241
242
  Customers_remove: { method: "DELETE", path: "/v1/customers/{id}" },
@@ -320,6 +321,11 @@ var ROUTES = {
320
321
  TenantPayoutAccount_startVerify: { method: "POST", path: "/v1/tenant/payout-account/verify/start" },
321
322
  TenantPayoutAccount_upsert: { method: "PUT", path: "/v1/tenant/payout-account" },
322
323
  TenantPayoutAccount_upsertPost: { method: "POST", path: "/v1/tenant/payout-account" },
324
+ TestClocks_advance: { method: "POST", path: "/v1/test-clocks/{id}/advance" },
325
+ TestClocks_create: { method: "POST", path: "/v1/test-clocks" },
326
+ TestClocks_list: { method: "GET", path: "/v1/test-clocks" },
327
+ TestClocks_remove: { method: "DELETE", path: "/v1/test-clocks/{id}" },
328
+ TestClocks_retrieve: { method: "GET", path: "/v1/test-clocks/{id}" },
323
329
  Topups_create: { method: "POST", path: "/v1/balance/topups" },
324
330
  Topups_get: { method: "GET", path: "/v1/balance/topups/{id}" },
325
331
  Topups_instant: { method: "POST", path: "/v1/balance/topups/{id}/instant" },
@@ -587,6 +593,33 @@ var PaymentMethods = class extends APIResource {
587
593
  return this.call("PaymentMethods_detach", { path: { id } }, options);
588
594
  }
589
595
  };
596
+ var TestClocks = class extends APIResource {
597
+ /** `frozenTime` is an ISO 8601 time. */
598
+ create(params, options) {
599
+ return this.call("TestClocks_create", { body: params }, options);
600
+ }
601
+ /** Await for one page, or `for await` over every clock (newest first). */
602
+ list(params = {}, options) {
603
+ return new PagePromise(
604
+ (cursor) => this.call("TestClocks_list", { query: { ...params, cursor } }, options),
605
+ params.cursor
606
+ );
607
+ }
608
+ retrieve(id, options) {
609
+ return this.call("TestClocks_retrieve", { path: { id } }, options);
610
+ }
611
+ /** Deletes the clock with its customers, subscriptions, invoices and payment methods. */
612
+ delete(id, options) {
613
+ return this.call("TestClocks_remove", { path: { id } }, options);
614
+ }
615
+ /**
616
+ * Move the clock forward (at most two intervals of its shortest subscription). It returns at
617
+ * once with `status: "advancing"`; poll `retrieve` or wait for `test_clock.ready`.
618
+ */
619
+ advance(id, params, options) {
620
+ return this.call("TestClocks_advance", { path: { id }, body: params }, options);
621
+ }
622
+ };
590
623
 
591
624
  // src/resources/commerce.ts
592
625
  var CheckoutSessions = class extends APIResource {
@@ -764,6 +797,14 @@ var Crypto = class extends APIResource {
764
797
  depositAddresses = new DepositAddresses(this.http);
765
798
  networks = new CryptoNetworks(this.http);
766
799
  payouts = new CryptoPayouts(this.http);
800
+ /**
801
+ * Test mode only: credit a deposit to one of your deposit addresses (`customerRef` + `currency` +
802
+ * `network`, requested before) as if it had arrived on chain. Sends `payment.completed` with
803
+ * `livemode: false`. A Live key gets 403 `test_mode_only`; an unknown address 404.
804
+ */
805
+ simulateDeposit(params, options) {
806
+ return this.call("Crypto_simulateDeposit", { body: params }, options);
807
+ }
767
808
  };
768
809
 
769
810
  // src/resources/merchants.ts
@@ -1009,6 +1050,8 @@ var WEBHOOK_EVENT_NAMES = [
1009
1050
  "payment_method.attached",
1010
1051
  "payment_method.updated",
1011
1052
  "payment_method.detached",
1053
+ "test_clock.advancing",
1054
+ "test_clock.ready",
1012
1055
  "notification.test"
1013
1056
  ];
1014
1057
  var SIGNATURE_HEADER = "VexPay-Signature";
@@ -1089,7 +1132,7 @@ var Webhooks = class {
1089
1132
  };
1090
1133
 
1091
1134
  // src/client.ts
1092
- var DEFAULT_BASE_URL = "https://api.pay.vexwallet.co";
1135
+ var DEFAULT_BASE_URL = "https://api.vexpay.app";
1093
1136
  var VexPay = class {
1094
1137
  /** @internal */
1095
1138
  http;
@@ -1121,6 +1164,8 @@ var VexPay = class {
1121
1164
  setupSessions;
1122
1165
  /** Billing: domiciliación payment methods (bolívar methods your account takes: `payments.methods()`). */
1123
1166
  paymentMethods;
1167
+ /** Billing, test mode only: simulated time for trials, renewals and dunning. */
1168
+ testClocks;
1124
1169
  /** Offline helpers: `constructEvent` verifies deliveries; no API calls. */
1125
1170
  webhooks = new Webhooks();
1126
1171
  constructor(apiKey, options = {}) {
@@ -1161,6 +1206,7 @@ var VexPay = class {
1161
1206
  this.invoices = new Invoices(this.http);
1162
1207
  this.setupSessions = new SetupSessions(this.http);
1163
1208
  this.paymentMethods = new PaymentMethods(this.http);
1209
+ this.testClocks = new TestClocks(this.http);
1164
1210
  }
1165
1211
  };
1166
1212
  export {