@delopay/sdk 0.358.0 → 0.361.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-E7CYYHZ3.js → chunk-P2Q4GXEB.js} +81 -2
- package/dist/chunk-P2Q4GXEB.js.map +1 -0
- package/dist/{index-CTJ7wd4n.d.cts → index-BbyUEY-4.d.cts} +270 -4
- package/dist/{index-CTJ7wd4n.d.ts → index-BbyUEY-4.d.ts} +270 -4
- package/dist/index.cjs +80 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/internal.cjs +100 -1
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +18 -3
- package/dist/internal.d.ts +18 -3
- package/dist/internal.js +24 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-E7CYYHZ3.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -61,6 +61,7 @@ __export(index_exports, {
|
|
|
61
61
|
CUSTOM_FIELD_OPERATORS_BY_SOURCE: () => CUSTOM_FIELD_OPERATORS_BY_SOURCE,
|
|
62
62
|
CUSTOM_FIELD_VALUELESS_OPERATORS: () => CUSTOM_FIELD_VALUELESS_OPERATORS,
|
|
63
63
|
Cards: () => Cards,
|
|
64
|
+
ChargebackPrevention: () => ChargebackPrevention,
|
|
64
65
|
CheckoutMethods: () => CheckoutMethods,
|
|
65
66
|
CheckoutRecovery: () => CheckoutRecovery,
|
|
66
67
|
CheckoutSession: () => CheckoutSession,
|
|
@@ -2281,6 +2282,77 @@ var Disputes = class {
|
|
|
2281
2282
|
}
|
|
2282
2283
|
};
|
|
2283
2284
|
|
|
2285
|
+
// src/resources/chargebackPrevention.ts
|
|
2286
|
+
function preventionCaseQuery(params) {
|
|
2287
|
+
if (!params) return void 0;
|
|
2288
|
+
const { provider, source, status, outcome, match_status, ...query } = params;
|
|
2289
|
+
return {
|
|
2290
|
+
...query,
|
|
2291
|
+
...provider?.length ? { provider: provider.join(",") } : {},
|
|
2292
|
+
...source?.length ? { source: source.join(",") } : {},
|
|
2293
|
+
...status?.length ? { status: status.join(",") } : {},
|
|
2294
|
+
...outcome?.length ? { outcome: outcome.join(",") } : {},
|
|
2295
|
+
...match_status?.length ? { match_status: match_status.join(",") } : {}
|
|
2296
|
+
};
|
|
2297
|
+
}
|
|
2298
|
+
var ChargebackPrevention = class {
|
|
2299
|
+
constructor(request) {
|
|
2300
|
+
this.request = request;
|
|
2301
|
+
}
|
|
2302
|
+
/** The merchant's connections, with their business accounts and sync health. */
|
|
2303
|
+
async listConnections() {
|
|
2304
|
+
return this.request("GET", "/chargeback-prevention/connections");
|
|
2305
|
+
}
|
|
2306
|
+
/**
|
|
2307
|
+
* Connect a provider account. DeloPay checks the key with the provider,
|
|
2308
|
+
* registers its webhooks there and starts reading alerts. Dashboard session
|
|
2309
|
+
* only.
|
|
2310
|
+
*/
|
|
2311
|
+
async connect(params) {
|
|
2312
|
+
return this.request("POST", "/chargeback-prevention/connections", { body: params });
|
|
2313
|
+
}
|
|
2314
|
+
/** Replace a connection's key; reconnects one whose key was refused. */
|
|
2315
|
+
async replaceKey(connectionId, params) {
|
|
2316
|
+
return this.request(
|
|
2317
|
+
"PUT",
|
|
2318
|
+
`/chargeback-prevention/connections/${encodeURIComponent(connectionId)}/key`,
|
|
2319
|
+
{ body: params }
|
|
2320
|
+
);
|
|
2321
|
+
}
|
|
2322
|
+
/** Stop reading a connection. Its cases are kept. */
|
|
2323
|
+
async disconnect(connectionId) {
|
|
2324
|
+
return this.request(
|
|
2325
|
+
"DELETE",
|
|
2326
|
+
`/chargeback-prevention/connections/${encodeURIComponent(connectionId)}`
|
|
2327
|
+
);
|
|
2328
|
+
}
|
|
2329
|
+
/** Read the connection's alerts again as soon as the provider allows. */
|
|
2330
|
+
async syncNow(connectionId) {
|
|
2331
|
+
return this.request(
|
|
2332
|
+
"POST",
|
|
2333
|
+
`/chargeback-prevention/connections/${encodeURIComponent(connectionId)}/sync`
|
|
2334
|
+
);
|
|
2335
|
+
}
|
|
2336
|
+
/** Set the shops a provider business account sells through; its cases are matched again. */
|
|
2337
|
+
async mapAccount(connectionId, providerAccountId, params) {
|
|
2338
|
+
return this.request(
|
|
2339
|
+
"PUT",
|
|
2340
|
+
`/chargeback-prevention/connections/${encodeURIComponent(connectionId)}/accounts/${encodeURIComponent(providerAccountId)}`,
|
|
2341
|
+
{ body: params }
|
|
2342
|
+
);
|
|
2343
|
+
}
|
|
2344
|
+
/** Cases with what DeloPay's records say happened to each payment. */
|
|
2345
|
+
async listCases(params) {
|
|
2346
|
+
return this.request("GET", "/chargeback-prevention/cases", {
|
|
2347
|
+
query: preventionCaseQuery(params)
|
|
2348
|
+
});
|
|
2349
|
+
}
|
|
2350
|
+
/** One case with its references and observed history. */
|
|
2351
|
+
async retrieveCase(caseId) {
|
|
2352
|
+
return this.request("GET", `/chargeback-prevention/cases/${encodeURIComponent(caseId)}`);
|
|
2353
|
+
}
|
|
2354
|
+
};
|
|
2355
|
+
|
|
2284
2356
|
// src/resources/paypalDisputes.ts
|
|
2285
2357
|
var PaypalDisputes = class {
|
|
2286
2358
|
constructor(request) {
|
|
@@ -4520,7 +4592,12 @@ var Routing = class {
|
|
|
4520
4592
|
async getDefaultForProfile(profileId) {
|
|
4521
4593
|
return this.request("GET", `/routing/default/profile/${encodeURIComponent(profileId)}`);
|
|
4522
4594
|
}
|
|
4523
|
-
/**
|
|
4595
|
+
/**
|
|
4596
|
+
* Update default config for a profile. `POST /routing/default/profile/{profileId}`
|
|
4597
|
+
*
|
|
4598
|
+
* Send the list alone to keep the shop's fallback mode, or `{ connectors, mode, splits }` to set
|
|
4599
|
+
* it. A `volume_split` whose shares do not total 100 is refused.
|
|
4600
|
+
*/
|
|
4524
4601
|
async updateDefaultProfile(profileId, params, options) {
|
|
4525
4602
|
return this.request("POST", `/routing/default/profile/${encodeURIComponent(profileId)}`, {
|
|
4526
4603
|
body: params,
|
|
@@ -11134,6 +11211,7 @@ var Delopay = class {
|
|
|
11134
11211
|
this.paymentLinks = new PaymentLinks(request);
|
|
11135
11212
|
this.mandates = new Mandates(request);
|
|
11136
11213
|
this.disputes = new Disputes(request);
|
|
11214
|
+
this.chargebackPrevention = new ChargebackPrevention(request);
|
|
11137
11215
|
this.paypalDisputes = new PaypalDisputes(request);
|
|
11138
11216
|
this.whopResolutionCases = new WhopResolutionCases(request);
|
|
11139
11217
|
this.payouts = new Payouts(request);
|
|
@@ -16954,6 +17032,7 @@ var encodeNativePanes = encodePanes;
|
|
|
16954
17032
|
CUSTOM_FIELD_OPERATORS_BY_SOURCE,
|
|
16955
17033
|
CUSTOM_FIELD_VALUELESS_OPERATORS,
|
|
16956
17034
|
Cards,
|
|
17035
|
+
ChargebackPrevention,
|
|
16957
17036
|
CheckoutMethods,
|
|
16958
17037
|
CheckoutRecovery,
|
|
16959
17038
|
CheckoutSession,
|