@delopay/sdk 0.211.0 → 0.213.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
@@ -36,6 +36,7 @@ import {
36
36
  CUSTOM_FIELD_VALUELESS_OPERATORS,
37
37
  Cards,
38
38
  CheckoutMethods,
39
+ CheckoutRecovery,
39
40
  CheckoutSession,
40
41
  CostRules,
41
42
  DEFAULT_BADGES,
@@ -218,7 +219,7 @@ import {
218
219
  validatePanes,
219
220
  verticalGapValue,
220
221
  visibleCustomFields
221
- } from "./chunk-2OYT52HK.js";
222
+ } from "./chunk-BL5Y5CSM.js";
222
223
  export {
223
224
  AIRWALLEX_AUTOFILL_TREATMENTS,
224
225
  AIRWALLEX_CARD_LAYOUTS,
@@ -257,6 +258,7 @@ export {
257
258
  CUSTOM_FIELD_VALUELESS_OPERATORS,
258
259
  Cards,
259
260
  CheckoutMethods,
261
+ CheckoutRecovery,
260
262
  CheckoutSession,
261
263
  CostRules,
262
264
  DEFAULT_BADGES,
package/dist/internal.cjs CHANGED
@@ -62,6 +62,7 @@ __export(internal_exports, {
62
62
  CardIssuers: () => CardIssuers,
63
63
  Cards: () => Cards,
64
64
  CheckoutMethods: () => CheckoutMethods,
65
+ CheckoutRecovery: () => CheckoutRecovery,
65
66
  CheckoutSession: () => CheckoutSession,
66
67
  Configs: () => Configs,
67
68
  ConnectorRestrictionRules: () => ConnectorRestrictionRules,
@@ -5285,6 +5286,94 @@ var SellToRestrictions = class {
5285
5286
  }
5286
5287
  };
5287
5288
 
5289
+ // src/resources/checkoutRecovery.ts
5290
+ var CheckoutRecovery = class {
5291
+ constructor(request) {
5292
+ this.request = request;
5293
+ }
5294
+ /**
5295
+ * A checkout's recovery: whether and when the rule reminds it, every reason
5296
+ * it does not, every message about it, and where its link goes. Any payment
5297
+ * of the checkout may be named.
5298
+ * `GET /checkout-recovery/payments/{payment_id}`
5299
+ */
5300
+ async retrieve(paymentId) {
5301
+ return this.request("GET", `/checkout-recovery/payments/${encodeURIComponent(paymentId)}`);
5302
+ }
5303
+ /**
5304
+ * No automatic reminder about this checkout from now on.
5305
+ * `POST /checkout-recovery/payments/{payment_id}/stop`
5306
+ */
5307
+ async stop(paymentId) {
5308
+ return this.request(
5309
+ "POST",
5310
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/stop`
5311
+ );
5312
+ }
5313
+ /**
5314
+ * Undo `stop`.
5315
+ * `POST /checkout-recovery/payments/{payment_id}/resume`
5316
+ */
5317
+ async resume(paymentId) {
5318
+ return this.request(
5319
+ "POST",
5320
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/resume`
5321
+ );
5322
+ }
5323
+ /**
5324
+ * A message by hand as it would be sent now: recipient, sender, text, link
5325
+ * and destination, and why it would be refused. Nothing is sent.
5326
+ * `POST /checkout-recovery/payments/{payment_id}/email/preview`
5327
+ */
5328
+ async previewEmail(paymentId, params) {
5329
+ return this.request(
5330
+ "POST",
5331
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email/preview`,
5332
+ { body: params }
5333
+ );
5334
+ }
5335
+ /**
5336
+ * Send a message by hand, once per `idempotency_key`, composed again from
5337
+ * the checkout as it is now. Refused when the checkout was paid or is being
5338
+ * paid, was cancelled, the buyer unsubscribed, or no payment method could
5339
+ * pay it.
5340
+ * `POST /checkout-recovery/payments/{payment_id}/email`
5341
+ */
5342
+ async sendEmail(paymentId, params) {
5343
+ return this.request(
5344
+ "POST",
5345
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email`,
5346
+ { body: params, bodyIdempotencyKey: params.idempotency_key ?? null }
5347
+ );
5348
+ }
5349
+ /**
5350
+ * Messages to buyers, newest first.
5351
+ * `GET /checkout-recovery/reminders`
5352
+ */
5353
+ async listReminders(params) {
5354
+ if (params) {
5355
+ return this.request("GET", "/checkout-recovery/reminders", { query: { ...params } });
5356
+ }
5357
+ return this.request("GET", "/checkout-recovery/reminders");
5358
+ }
5359
+ /**
5360
+ * The shop's recent checkouts judged under a rule (the stored one, or the
5361
+ * one given) as if switched on, with every reason. Nothing is sent.
5362
+ * `POST /checkout-recovery/candidates`
5363
+ */
5364
+ async previewCandidates(params = {}) {
5365
+ return this.request("POST", "/checkout-recovery/candidates", { body: params });
5366
+ }
5367
+ /**
5368
+ * A reminder with sample values, to the signed-in user's own address.
5369
+ * Dashboard sessions only.
5370
+ * `POST /checkout-recovery/test-email`
5371
+ */
5372
+ async sendTestEmail(params) {
5373
+ return this.request("POST", "/checkout-recovery/test-email", { body: params });
5374
+ }
5375
+ };
5376
+
5288
5377
  // src/resources/costRules.ts
5289
5378
  var CostRules = class {
5290
5379
  constructor(request) {
@@ -6039,6 +6128,36 @@ var Invoices = class {
6039
6128
  ...options
6040
6129
  });
6041
6130
  }
6131
+ /**
6132
+ * Mail an issued invoice to the buyer address it carries, its PDF attached,
6133
+ * in the document's language. Each call is a new message (the next
6134
+ * `revision`) and resolves with what became of it: `sent`, or `failed` with
6135
+ * `error_code`. Refused (`IR_16`) with `not_an_invoice` (a credit note),
6136
+ * `not_issued`, `no_buyer_email`, `send_in_progress` (an earlier message is
6137
+ * queued or being sent) and `send_limit_reached` (5 sends by hand in 24
6138
+ * hours). Shops with the `email.invoice_auto_send` setting mail every
6139
+ * invoice they issue without this call.
6140
+ *
6141
+ * The merchant's daily sending limit is **not** a refusal: the call answers
6142
+ * with the message `failed` and `error_code: 'merchant_limit_reached'`.
6143
+ * Check `status` on the result, not only that the call succeeded.
6144
+ * `POST /invoices/{invoice_id}/email`
6145
+ */
6146
+ async sendEmail(invoiceId, options) {
6147
+ return this.request("POST", `/invoices/${encodeURIComponent(invoiceId)}/email`, {
6148
+ ...options
6149
+ });
6150
+ }
6151
+ /**
6152
+ * Every message about a document to its buyer, automatic and by hand,
6153
+ * newest first, with its delivery status. The recipient is masked.
6154
+ * `GET /invoices/{invoice_id}/emails`
6155
+ */
6156
+ async listEmails(invoiceId, options) {
6157
+ return this.request("GET", `/invoices/${encodeURIComponent(invoiceId)}/emails`, {
6158
+ ...options
6159
+ });
6160
+ }
6042
6161
  };
6043
6162
 
6044
6163
  // src/resources/invoiceSettings.ts
@@ -7717,6 +7836,7 @@ var Delopay = class {
7717
7836
  this.regions = new Regions(request);
7718
7837
  this.availabilityOverrides = new AvailabilityOverrides(request);
7719
7838
  this.sellToRestrictions = new SellToRestrictions(request);
7839
+ this.checkoutRecovery = new CheckoutRecovery(request);
7720
7840
  this.costRules = new CostRules(request);
7721
7841
  this.externalRecords = new ExternalRecords(request);
7722
7842
  this.products = new Products(request);
@@ -11814,6 +11934,29 @@ var AdminPortal = class {
11814
11934
  `/admin-portal/transactions/${encodeURIComponent(paymentId)}/status-history`
11815
11935
  );
11816
11936
  }
11937
+ /**
11938
+ * The invoices and credit notes issued for a transaction of ANY merchant,
11939
+ * each its own row, newest first. At most 100 per page.
11940
+ * `GET /admin-portal/transactions/{paymentId}/invoices`
11941
+ */
11942
+ async getTransactionInvoices(paymentId, params) {
11943
+ return this.request(
11944
+ "GET",
11945
+ `/admin-portal/transactions/${encodeURIComponent(paymentId)}/invoices`,
11946
+ { query: params === void 0 ? void 0 : { ...params } }
11947
+ );
11948
+ }
11949
+ /**
11950
+ * One invoice of ANY merchant as a PDF: the stored copy of an issued
11951
+ * document, a live render of a draft, the snapshot under a VOIDED banner for
11952
+ * a voided one.
11953
+ * `GET /admin-portal/invoices/{invoiceId}/pdf`
11954
+ */
11955
+ async downloadInvoicePdf(invoiceId) {
11956
+ return this.request("GET", `/admin-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {
11957
+ responseType: "blob"
11958
+ });
11959
+ }
11817
11960
  /**
11818
11961
  * Refunds for a single transaction of ANY merchant.
11819
11962
  */
@@ -13100,6 +13243,7 @@ var DelopayInternal = class extends Delopay {
13100
13243
  CardIssuers,
13101
13244
  Cards,
13102
13245
  CheckoutMethods,
13246
+ CheckoutRecovery,
13103
13247
  CheckoutSession,
13104
13248
  Configs,
13105
13249
  ConnectorRestrictionRules,