@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/{chunk-2OYT52HK.js → chunk-BL5Y5CSM.js} +121 -1
- package/dist/chunk-BL5Y5CSM.js.map +1 -0
- package/dist/index.cjs +121 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +458 -6
- package/dist/index.d.ts +458 -6
- package/dist/index.js +3 -1
- package/dist/internal.cjs +144 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +16 -3
- package/dist/internal.d.ts +16 -3
- package/dist/internal.js +26 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2OYT52HK.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -57,6 +57,7 @@ __export(index_exports, {
|
|
|
57
57
|
CUSTOM_FIELD_VALUELESS_OPERATORS: () => CUSTOM_FIELD_VALUELESS_OPERATORS,
|
|
58
58
|
Cards: () => Cards,
|
|
59
59
|
CheckoutMethods: () => CheckoutMethods,
|
|
60
|
+
CheckoutRecovery: () => CheckoutRecovery,
|
|
60
61
|
CheckoutSession: () => CheckoutSession,
|
|
61
62
|
CostRules: () => CostRules,
|
|
62
63
|
DEFAULT_BADGES: () => DEFAULT_BADGES,
|
|
@@ -5270,6 +5271,94 @@ var SellToRestrictions = class {
|
|
|
5270
5271
|
}
|
|
5271
5272
|
};
|
|
5272
5273
|
|
|
5274
|
+
// src/resources/checkoutRecovery.ts
|
|
5275
|
+
var CheckoutRecovery = class {
|
|
5276
|
+
constructor(request) {
|
|
5277
|
+
this.request = request;
|
|
5278
|
+
}
|
|
5279
|
+
/**
|
|
5280
|
+
* A checkout's recovery: whether and when the rule reminds it, every reason
|
|
5281
|
+
* it does not, every message about it, and where its link goes. Any payment
|
|
5282
|
+
* of the checkout may be named.
|
|
5283
|
+
* `GET /checkout-recovery/payments/{payment_id}`
|
|
5284
|
+
*/
|
|
5285
|
+
async retrieve(paymentId) {
|
|
5286
|
+
return this.request("GET", `/checkout-recovery/payments/${encodeURIComponent(paymentId)}`);
|
|
5287
|
+
}
|
|
5288
|
+
/**
|
|
5289
|
+
* No automatic reminder about this checkout from now on.
|
|
5290
|
+
* `POST /checkout-recovery/payments/{payment_id}/stop`
|
|
5291
|
+
*/
|
|
5292
|
+
async stop(paymentId) {
|
|
5293
|
+
return this.request(
|
|
5294
|
+
"POST",
|
|
5295
|
+
`/checkout-recovery/payments/${encodeURIComponent(paymentId)}/stop`
|
|
5296
|
+
);
|
|
5297
|
+
}
|
|
5298
|
+
/**
|
|
5299
|
+
* Undo `stop`.
|
|
5300
|
+
* `POST /checkout-recovery/payments/{payment_id}/resume`
|
|
5301
|
+
*/
|
|
5302
|
+
async resume(paymentId) {
|
|
5303
|
+
return this.request(
|
|
5304
|
+
"POST",
|
|
5305
|
+
`/checkout-recovery/payments/${encodeURIComponent(paymentId)}/resume`
|
|
5306
|
+
);
|
|
5307
|
+
}
|
|
5308
|
+
/**
|
|
5309
|
+
* A message by hand as it would be sent now: recipient, sender, text, link
|
|
5310
|
+
* and destination, and why it would be refused. Nothing is sent.
|
|
5311
|
+
* `POST /checkout-recovery/payments/{payment_id}/email/preview`
|
|
5312
|
+
*/
|
|
5313
|
+
async previewEmail(paymentId, params) {
|
|
5314
|
+
return this.request(
|
|
5315
|
+
"POST",
|
|
5316
|
+
`/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email/preview`,
|
|
5317
|
+
{ body: params }
|
|
5318
|
+
);
|
|
5319
|
+
}
|
|
5320
|
+
/**
|
|
5321
|
+
* Send a message by hand, once per `idempotency_key`, composed again from
|
|
5322
|
+
* the checkout as it is now. Refused when the checkout was paid or is being
|
|
5323
|
+
* paid, was cancelled, the buyer unsubscribed, or no payment method could
|
|
5324
|
+
* pay it.
|
|
5325
|
+
* `POST /checkout-recovery/payments/{payment_id}/email`
|
|
5326
|
+
*/
|
|
5327
|
+
async sendEmail(paymentId, params) {
|
|
5328
|
+
return this.request(
|
|
5329
|
+
"POST",
|
|
5330
|
+
`/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email`,
|
|
5331
|
+
{ body: params, bodyIdempotencyKey: params.idempotency_key ?? null }
|
|
5332
|
+
);
|
|
5333
|
+
}
|
|
5334
|
+
/**
|
|
5335
|
+
* Messages to buyers, newest first.
|
|
5336
|
+
* `GET /checkout-recovery/reminders`
|
|
5337
|
+
*/
|
|
5338
|
+
async listReminders(params) {
|
|
5339
|
+
if (params) {
|
|
5340
|
+
return this.request("GET", "/checkout-recovery/reminders", { query: { ...params } });
|
|
5341
|
+
}
|
|
5342
|
+
return this.request("GET", "/checkout-recovery/reminders");
|
|
5343
|
+
}
|
|
5344
|
+
/**
|
|
5345
|
+
* The shop's recent checkouts judged under a rule (the stored one, or the
|
|
5346
|
+
* one given) as if switched on, with every reason. Nothing is sent.
|
|
5347
|
+
* `POST /checkout-recovery/candidates`
|
|
5348
|
+
*/
|
|
5349
|
+
async previewCandidates(params = {}) {
|
|
5350
|
+
return this.request("POST", "/checkout-recovery/candidates", { body: params });
|
|
5351
|
+
}
|
|
5352
|
+
/**
|
|
5353
|
+
* A reminder with sample values, to the signed-in user's own address.
|
|
5354
|
+
* Dashboard sessions only.
|
|
5355
|
+
* `POST /checkout-recovery/test-email`
|
|
5356
|
+
*/
|
|
5357
|
+
async sendTestEmail(params) {
|
|
5358
|
+
return this.request("POST", "/checkout-recovery/test-email", { body: params });
|
|
5359
|
+
}
|
|
5360
|
+
};
|
|
5361
|
+
|
|
5273
5362
|
// src/resources/costRules.ts
|
|
5274
5363
|
var CostRules = class {
|
|
5275
5364
|
constructor(request) {
|
|
@@ -6024,6 +6113,36 @@ var Invoices = class {
|
|
|
6024
6113
|
...options
|
|
6025
6114
|
});
|
|
6026
6115
|
}
|
|
6116
|
+
/**
|
|
6117
|
+
* Mail an issued invoice to the buyer address it carries, its PDF attached,
|
|
6118
|
+
* in the document's language. Each call is a new message (the next
|
|
6119
|
+
* `revision`) and resolves with what became of it: `sent`, or `failed` with
|
|
6120
|
+
* `error_code`. Refused (`IR_16`) with `not_an_invoice` (a credit note),
|
|
6121
|
+
* `not_issued`, `no_buyer_email`, `send_in_progress` (an earlier message is
|
|
6122
|
+
* queued or being sent) and `send_limit_reached` (5 sends by hand in 24
|
|
6123
|
+
* hours). Shops with the `email.invoice_auto_send` setting mail every
|
|
6124
|
+
* invoice they issue without this call.
|
|
6125
|
+
*
|
|
6126
|
+
* The merchant's daily sending limit is **not** a refusal: the call answers
|
|
6127
|
+
* with the message `failed` and `error_code: 'merchant_limit_reached'`.
|
|
6128
|
+
* Check `status` on the result, not only that the call succeeded.
|
|
6129
|
+
* `POST /invoices/{invoice_id}/email`
|
|
6130
|
+
*/
|
|
6131
|
+
async sendEmail(invoiceId, options) {
|
|
6132
|
+
return this.request("POST", `/invoices/${encodeURIComponent(invoiceId)}/email`, {
|
|
6133
|
+
...options
|
|
6134
|
+
});
|
|
6135
|
+
}
|
|
6136
|
+
/**
|
|
6137
|
+
* Every message about a document to its buyer, automatic and by hand,
|
|
6138
|
+
* newest first, with its delivery status. The recipient is masked.
|
|
6139
|
+
* `GET /invoices/{invoice_id}/emails`
|
|
6140
|
+
*/
|
|
6141
|
+
async listEmails(invoiceId, options) {
|
|
6142
|
+
return this.request("GET", `/invoices/${encodeURIComponent(invoiceId)}/emails`, {
|
|
6143
|
+
...options
|
|
6144
|
+
});
|
|
6145
|
+
}
|
|
6027
6146
|
};
|
|
6028
6147
|
|
|
6029
6148
|
// src/resources/invoiceSettings.ts
|
|
@@ -7702,6 +7821,7 @@ var Delopay = class {
|
|
|
7702
7821
|
this.regions = new Regions(request);
|
|
7703
7822
|
this.availabilityOverrides = new AvailabilityOverrides(request);
|
|
7704
7823
|
this.sellToRestrictions = new SellToRestrictions(request);
|
|
7824
|
+
this.checkoutRecovery = new CheckoutRecovery(request);
|
|
7705
7825
|
this.costRules = new CostRules(request);
|
|
7706
7826
|
this.externalRecords = new ExternalRecords(request);
|
|
7707
7827
|
this.products = new Products(request);
|
|
@@ -11722,6 +11842,7 @@ var encodeNativePanes = encodePanes;
|
|
|
11722
11842
|
CUSTOM_FIELD_VALUELESS_OPERATORS,
|
|
11723
11843
|
Cards,
|
|
11724
11844
|
CheckoutMethods,
|
|
11845
|
+
CheckoutRecovery,
|
|
11725
11846
|
CheckoutSession,
|
|
11726
11847
|
CostRules,
|
|
11727
11848
|
DEFAULT_BADGES,
|