@delopay/sdk 0.102.0 → 0.104.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-43FRIBNT.js → chunk-S22IPUCK.js} +248 -5
- package/dist/chunk-S22IPUCK.js.map +1 -0
- package/dist/index.cjs +248 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +899 -27
- package/dist/index.d.ts +899 -27
- package/dist/index.js +3 -1
- package/dist/internal.cjs +248 -4
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +23 -2
- package/dist/internal.d.ts +23 -2
- package/dist/internal.js +3 -1
- package/dist/internal.js.map +1 -1
- package/package.json +17 -18
- package/dist/chunk-43FRIBNT.js.map +0 -1
|
@@ -424,12 +424,37 @@ var Connectors = class {
|
|
|
424
424
|
body: params
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
|
+
/**
|
|
428
|
+
* One connector account.
|
|
429
|
+
*
|
|
430
|
+
* The credential-bearing fields come back `null` here, whatever is stored:
|
|
431
|
+
* `connector_webhook_details`, `connector_wallets_details`,
|
|
432
|
+
* `pm_auth_config` and `additional_merchant_data`. They are dropped rather
|
|
433
|
+
* than masked, because an editor that prefills from this response and
|
|
434
|
+
* PATCHes the field back would otherwise save a mask over a live signing
|
|
435
|
+
* secret. Send those fields only when the operator has typed a new value,
|
|
436
|
+
* and omit them entirely otherwise — an omitted field leaves the stored one
|
|
437
|
+
* alone.
|
|
438
|
+
*
|
|
439
|
+
* This is the retrieve path alone. `create` and `update` echo back what the
|
|
440
|
+
* caller sent, and `clone` returns the *copied* secrets — see that method.
|
|
441
|
+
*
|
|
442
|
+
* `GET /account/{accountId}/connectors/{connectorId}`
|
|
443
|
+
*/
|
|
427
444
|
async retrieve(accountId, connectorId) {
|
|
428
445
|
return this.request(
|
|
429
446
|
"GET",
|
|
430
447
|
`/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}`
|
|
431
448
|
);
|
|
432
449
|
}
|
|
450
|
+
/**
|
|
451
|
+
* The merchant's connector accounts.
|
|
452
|
+
*
|
|
453
|
+
* Never wider than the caller: an API key pinned to one shop lists that
|
|
454
|
+
* shop's connectors only, not every sibling shop's.
|
|
455
|
+
*
|
|
456
|
+
* `GET /account/{accountId}/connectors`
|
|
457
|
+
*/
|
|
433
458
|
async list(accountId) {
|
|
434
459
|
return this.request("GET", `/account/${encodeURIComponent(accountId)}/connectors`);
|
|
435
460
|
}
|
|
@@ -475,6 +500,15 @@ var Connectors = class {
|
|
|
475
500
|
}
|
|
476
501
|
);
|
|
477
502
|
}
|
|
503
|
+
/**
|
|
504
|
+
* Remove a connector account.
|
|
505
|
+
*
|
|
506
|
+
* A shop-scoped role may remove a connector of its own shop — the shop is
|
|
507
|
+
* re-checked server-side — so creating processors and removing them are the
|
|
508
|
+
* same rung of access rather than two.
|
|
509
|
+
*
|
|
510
|
+
* `DELETE /account/{accountId}/connectors/{connectorId}`
|
|
511
|
+
*/
|
|
478
512
|
async delete(accountId, connectorId) {
|
|
479
513
|
return this.request(
|
|
480
514
|
"DELETE",
|
|
@@ -486,9 +520,15 @@ var Connectors = class {
|
|
|
486
520
|
* merchant. `POST /account/{accountId}/connectors/{connectorId}/clone`
|
|
487
521
|
*
|
|
488
522
|
* Credentials are copied server-side, re-encrypted under the same merchant
|
|
489
|
-
* key
|
|
490
|
-
*
|
|
491
|
-
* the
|
|
523
|
+
* key, so the caller never has to *supply* them — `retrieve` returns `null`
|
|
524
|
+
* for the credential fields, which is what makes a client-side copy
|
|
525
|
+
* impossible in the first place.
|
|
526
|
+
*
|
|
527
|
+
* The response, however, is the unredacted connector: `connector_account_details`
|
|
528
|
+
* is masked, but `connector_webhook_details`, `connector_wallets_details`,
|
|
529
|
+
* `pm_auth_config` and `additional_merchant_data` come back with the copied
|
|
530
|
+
* secrets in them — values this caller never sent. Do not log or echo the
|
|
531
|
+
* response; read `merchant_connector_id` and discard the rest.
|
|
492
532
|
*/
|
|
493
533
|
async clone(accountId, connectorId, params) {
|
|
494
534
|
return this.request(
|
|
@@ -1357,6 +1397,13 @@ var Payments = class {
|
|
|
1357
1397
|
* test_mode: process.env.NODE_ENV !== 'production',
|
|
1358
1398
|
* });
|
|
1359
1399
|
* ```
|
|
1400
|
+
*
|
|
1401
|
+
* A payment that pins one connector through `routing` (the `single` form)
|
|
1402
|
+
* is now checked against `test_mode` here rather than at confirm: if that
|
|
1403
|
+
* connector has no credentials for the environment asked for, create fails
|
|
1404
|
+
* instead of handing back a payment whose checkout the buyer cannot
|
|
1405
|
+
* complete. `priority` and `volume_split` name several accounts and are
|
|
1406
|
+
* still resolved at confirm.
|
|
1360
1407
|
*/
|
|
1361
1408
|
async create(params, options) {
|
|
1362
1409
|
return this.request("POST", "/payments", { body: params, ...options });
|
|
@@ -1997,6 +2044,14 @@ var Refunds = class {
|
|
|
1997
2044
|
/**
|
|
1998
2045
|
* Create a refund for a payment.
|
|
1999
2046
|
*
|
|
2047
|
+
* Dashboard-initiated refunds are subject to the caller's operation-limit
|
|
2048
|
+
* rule, resolved against the role the request authenticated with. An
|
|
2049
|
+
* over-limit refund either fails with `DE_01` (the rule blocks) or with
|
|
2050
|
+
* HTTP 409 `DE_06` — the rule requires approval, and `DelopayError.data`
|
|
2051
|
+
* carries `PendingApprovalErrorDetails`. No refund exists in either case;
|
|
2052
|
+
* `DE_06` names one that a second approver can still let through, via
|
|
2053
|
+
* `operationLimits.approve()`.
|
|
2054
|
+
*
|
|
2000
2055
|
* @param params - Refund parameters, including the required `payment_id` and optional amount.
|
|
2001
2056
|
* @returns The created refund.
|
|
2002
2057
|
*
|
|
@@ -2201,6 +2256,55 @@ var Routing = class {
|
|
|
2201
2256
|
async update(algorithmId, params) {
|
|
2202
2257
|
return this.request("PUT", `/routing/${encodeURIComponent(algorithmId)}`, { body: params });
|
|
2203
2258
|
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Every content window a routing configuration has had, oldest first.
|
|
2261
|
+
*
|
|
2262
|
+
* A configuration's rule can be edited in place, so this is what makes "which
|
|
2263
|
+
* rule decided this payment" answerable after the fact. Each entry is the rule
|
|
2264
|
+
* as it stood between `valid_from` and `valid_until`; the windows of one
|
|
2265
|
+
* config abut exactly, with no gap.
|
|
2266
|
+
*
|
|
2267
|
+
* Paging covers the whole timeline including the live window, so a page never
|
|
2268
|
+
* holds more than `limit` entries and the live one — the only entry without a
|
|
2269
|
+
* `valid_until` — comes back on exactly one page. Advance `offset` by `limit`;
|
|
2270
|
+
* a page past the end is empty, and `total_count` says where that end is
|
|
2271
|
+
* without probing for it.
|
|
2272
|
+
*
|
|
2273
|
+
* `GET /routing/{algorithmId}/history`
|
|
2274
|
+
*
|
|
2275
|
+
* @param algorithmId - The routing algorithm to read the history of.
|
|
2276
|
+
* @param params - Optional paging.
|
|
2277
|
+
*/
|
|
2278
|
+
async history(algorithmId, params = {}) {
|
|
2279
|
+
return this.request("GET", `/routing/${encodeURIComponent(algorithmId)}/history`, {
|
|
2280
|
+
query: params
|
|
2281
|
+
});
|
|
2282
|
+
}
|
|
2283
|
+
/**
|
|
2284
|
+
* A shop's lifetime per-connector payment caps, each with how much of it is
|
|
2285
|
+
* already spent.
|
|
2286
|
+
*
|
|
2287
|
+
* `GET /routing/connector-caps/{profileId}`
|
|
2288
|
+
*/
|
|
2289
|
+
async connectorCaps(profileId) {
|
|
2290
|
+
return this.request("GET", `/routing/connector-caps/${encodeURIComponent(profileId)}`);
|
|
2291
|
+
}
|
|
2292
|
+
/**
|
|
2293
|
+
* Replace a shop's per-connector payment caps.
|
|
2294
|
+
*
|
|
2295
|
+
* Whole-set replacement, not a patch: the list sent becomes the complete set
|
|
2296
|
+
* of capped connectors, and an empty list clears them all — which is how
|
|
2297
|
+
* acquirer onboarding finishes, the new account ceasing to be a special case.
|
|
2298
|
+
*
|
|
2299
|
+
* Every account named must belong to this shop; one that does not is refused.
|
|
2300
|
+
*
|
|
2301
|
+
* `PUT /routing/connector-caps/{profileId}`
|
|
2302
|
+
*/
|
|
2303
|
+
async setConnectorCaps(profileId, params) {
|
|
2304
|
+
return this.request("PUT", `/routing/connector-caps/${encodeURIComponent(profileId)}`, {
|
|
2305
|
+
body: params
|
|
2306
|
+
});
|
|
2307
|
+
}
|
|
2204
2308
|
/**
|
|
2205
2309
|
* List all routing algorithms for the current merchant.
|
|
2206
2310
|
*
|
|
@@ -3087,7 +3191,15 @@ var Users = class {
|
|
|
3087
3191
|
async selectAuth(params) {
|
|
3088
3192
|
return this.request("POST", "/user/auth/select", { body: params });
|
|
3089
3193
|
}
|
|
3090
|
-
/**
|
|
3194
|
+
/**
|
|
3195
|
+
* List users in lineage.
|
|
3196
|
+
*
|
|
3197
|
+
* Needs the Users *view* grant now — the response carries colleagues' email
|
|
3198
|
+
* addresses, so a role without it is refused rather than handed a roster.
|
|
3199
|
+
* A shop-scoped role keeps reading its own shop's members.
|
|
3200
|
+
*
|
|
3201
|
+
* `GET /user/employees/list`
|
|
3202
|
+
*/
|
|
3091
3203
|
async listUsersInLineage(params) {
|
|
3092
3204
|
return this.request("GET", "/user/employees/list", {
|
|
3093
3205
|
query: params
|
|
@@ -3796,6 +3908,46 @@ var Settlement = class {
|
|
|
3796
3908
|
...options
|
|
3797
3909
|
});
|
|
3798
3910
|
}
|
|
3911
|
+
/**
|
|
3912
|
+
* What a period's payments cost, and what was left over: gross, the
|
|
3913
|
+
* platform fee, hosting fees, what the rails took, and the margin, with a
|
|
3914
|
+
* per-connector breakdown.
|
|
3915
|
+
*
|
|
3916
|
+
* Send `year` and `month` together to report one UTC calendar month, or
|
|
3917
|
+
* neither for the running month so far.
|
|
3918
|
+
*
|
|
3919
|
+
* **Host-only.** The response is the host's cost base, which a shop owner
|
|
3920
|
+
* must never see, so a profile-scoped caller is refused with a 403 rather
|
|
3921
|
+
* than given a redacted shell. Gate the surface on the caller's scope
|
|
3922
|
+
* instead of calling it and handling the failure.
|
|
3923
|
+
*
|
|
3924
|
+
* Two things not to flatten when rendering the result:
|
|
3925
|
+
* `margin_usd` is absent — not zero — whenever `margin_quality` is
|
|
3926
|
+
* `'unknown'`, and `unlined_captured_attempt_count` (cost definitely
|
|
3927
|
+
* missing) means something different from `unlined_unresolved_attempt_count`
|
|
3928
|
+
* (mostly ordinary abandonment).
|
|
3929
|
+
*
|
|
3930
|
+
* `GET /settlement/cost`
|
|
3931
|
+
*
|
|
3932
|
+
* @example
|
|
3933
|
+
* ```typescript
|
|
3934
|
+
* const cost = await delopay.settlement.cost({ test_mode: false, year: 2026, month: 7 });
|
|
3935
|
+
* if (cost.margin_quality === 'unknown') {
|
|
3936
|
+
* // cost.margin_usd is absent — say so, do not render 0.00
|
|
3937
|
+
* }
|
|
3938
|
+
* ```
|
|
3939
|
+
*/
|
|
3940
|
+
async cost(params, options) {
|
|
3941
|
+
return this.request("GET", "/settlement/cost", {
|
|
3942
|
+
query: {
|
|
3943
|
+
profile_id: params?.profile_id,
|
|
3944
|
+
test_mode: params?.test_mode,
|
|
3945
|
+
year: params?.year,
|
|
3946
|
+
month: params?.month
|
|
3947
|
+
},
|
|
3948
|
+
...options
|
|
3949
|
+
});
|
|
3950
|
+
}
|
|
3799
3951
|
/**
|
|
3800
3952
|
* List generated settlement statements, newest first.
|
|
3801
3953
|
*
|
|
@@ -3838,6 +3990,12 @@ var Settlement = class {
|
|
|
3838
3990
|
/**
|
|
3839
3991
|
* Record payout progress on a statement (`unpaid` / `partial` / `paid`).
|
|
3840
3992
|
*
|
|
3993
|
+
* Subject to the caller's `settlement_payout` operation limit, which can
|
|
3994
|
+
* only be a per-operation ceiling: an over-limit call fails with `DE_01`
|
|
3995
|
+
* and nothing is recorded. There is no approval route out of it — four-eyes
|
|
3996
|
+
* needs an executor that can run the operation once somebody says yes, and
|
|
3997
|
+
* only refunds have one, so a settlement rule can only block.
|
|
3998
|
+
*
|
|
3841
3999
|
* `POST /settlement/statements/{statementId}/payout`
|
|
3842
4000
|
*/
|
|
3843
4001
|
async updateStatementPayout(statementId, params, options) {
|
|
@@ -3938,6 +4096,11 @@ var Settlement = class {
|
|
|
3938
4096
|
* Add a manual adjustment to a statement. Positive `amount_usd` charges
|
|
3939
4097
|
* the shop (reducing their payout); negative credits them.
|
|
3940
4098
|
*
|
|
4099
|
+
* Subject to the caller's `settlement_adjustment` operation limit (amount
|
|
4100
|
+
* dimensions only): an over-limit call fails with `DE_01` and no adjustment
|
|
4101
|
+
* is added. A settlement rule can only block — approval is refund-only, for
|
|
4102
|
+
* the reason given on `updateStatementPayout()`.
|
|
4103
|
+
*
|
|
3941
4104
|
* `POST /settlement/statements/{statementId}/adjustments`
|
|
3942
4105
|
*/
|
|
3943
4106
|
async createStatementAdjustment(statementId, params, options) {
|
|
@@ -4011,6 +4174,84 @@ var OperationLimits = class {
|
|
|
4011
4174
|
async updateSettings(params, options) {
|
|
4012
4175
|
return this.request("PUT", "/operation-limits/settings", { body: params, ...options });
|
|
4013
4176
|
}
|
|
4177
|
+
/**
|
|
4178
|
+
* The approvals inbox: over-limit operations waiting on a second person.
|
|
4179
|
+
*
|
|
4180
|
+
* Both filters default rather than widen. With no `status` the list holds
|
|
4181
|
+
* **pending requests only** — approved, rejected and expired ones are
|
|
4182
|
+
* reachable only by asking for that status, so a history view must pass one
|
|
4183
|
+
* per status. With no `operation` it lists **refunds only**; the list is one
|
|
4184
|
+
* operation at a time. `limit` defaults to 100 and is clamped to 1–500.
|
|
4185
|
+
*
|
|
4186
|
+
* Requests past their `expires_at` are expired before the list is read, so
|
|
4187
|
+
* nothing here is shown as actionable when it is not.
|
|
4188
|
+
*
|
|
4189
|
+
* `GET /operation-limits/approvals`
|
|
4190
|
+
*/
|
|
4191
|
+
async listApprovals(params, options) {
|
|
4192
|
+
return this.request("GET", "/operation-limits/approvals", {
|
|
4193
|
+
query: {
|
|
4194
|
+
operation: params?.operation,
|
|
4195
|
+
status: params?.status,
|
|
4196
|
+
limit: params?.limit
|
|
4197
|
+
},
|
|
4198
|
+
...options
|
|
4199
|
+
});
|
|
4200
|
+
}
|
|
4201
|
+
/**
|
|
4202
|
+
* Approve a parked operation and execute it.
|
|
4203
|
+
*
|
|
4204
|
+
* Refused for the user who requested it, and for an approver whose own
|
|
4205
|
+
* limit would not have covered the operation — the permission is necessary
|
|
4206
|
+
* and not sufficient.
|
|
4207
|
+
*
|
|
4208
|
+
* Approval and execution are two facts. A request that was approved but
|
|
4209
|
+
* whose operation then failed comes back `approved` with `execution_error`
|
|
4210
|
+
* set and no `result_entity_id`; that is a real outcome, not a partial read.
|
|
4211
|
+
*
|
|
4212
|
+
* `POST /operation-limits/approvals/{id}/approve`
|
|
4213
|
+
*/
|
|
4214
|
+
async approve(id, params = {}, options) {
|
|
4215
|
+
return this.request("POST", `/operation-limits/approvals/${encodeURIComponent(id)}/approve`, {
|
|
4216
|
+
body: params,
|
|
4217
|
+
...options
|
|
4218
|
+
});
|
|
4219
|
+
}
|
|
4220
|
+
/**
|
|
4221
|
+
* Reject a parked operation. Nothing is executed and the request is closed.
|
|
4222
|
+
*
|
|
4223
|
+
* `POST /operation-limits/approvals/{id}/reject`
|
|
4224
|
+
*/
|
|
4225
|
+
async reject(id, params = {}, options) {
|
|
4226
|
+
return this.request("POST", `/operation-limits/approvals/${encodeURIComponent(id)}/reject`, {
|
|
4227
|
+
body: params,
|
|
4228
|
+
...options
|
|
4229
|
+
});
|
|
4230
|
+
}
|
|
4231
|
+
};
|
|
4232
|
+
|
|
4233
|
+
// src/resources/risk.ts
|
|
4234
|
+
var Risk = class {
|
|
4235
|
+
constructor(request) {
|
|
4236
|
+
this.request = request;
|
|
4237
|
+
}
|
|
4238
|
+
/**
|
|
4239
|
+
* Every shop's stored risk for the caller's merchant, with the worst band
|
|
4240
|
+
* across them.
|
|
4241
|
+
*
|
|
4242
|
+
* `GET /risk`
|
|
4243
|
+
*/
|
|
4244
|
+
async retrieve(options) {
|
|
4245
|
+
return this.request("GET", "/risk", options);
|
|
4246
|
+
}
|
|
4247
|
+
/**
|
|
4248
|
+
* One shop's stored risk index per connector.
|
|
4249
|
+
*
|
|
4250
|
+
* `GET /risk/shops/{profileId}`
|
|
4251
|
+
*/
|
|
4252
|
+
async retrieveShop(profileId, options) {
|
|
4253
|
+
return this.request("GET", `/risk/shops/${encodeURIComponent(profileId)}`, options);
|
|
4254
|
+
}
|
|
4014
4255
|
};
|
|
4015
4256
|
|
|
4016
4257
|
// src/client.ts
|
|
@@ -4142,6 +4383,7 @@ var Delopay = class {
|
|
|
4142
4383
|
this.threeDsRules = new ThreeDsRules(request);
|
|
4143
4384
|
this.settlement = new Settlement(request);
|
|
4144
4385
|
this.operationLimits = new OperationLimits(request);
|
|
4386
|
+
this.risk = new Risk(request);
|
|
4145
4387
|
this.subscriptions = new Subscriptions(request);
|
|
4146
4388
|
this.files = new Files(request);
|
|
4147
4389
|
this.export = new Export(request);
|
|
@@ -6163,6 +6405,7 @@ export {
|
|
|
6163
6405
|
Subscriptions,
|
|
6164
6406
|
Settlement,
|
|
6165
6407
|
OperationLimits,
|
|
6408
|
+
Risk,
|
|
6166
6409
|
Delopay,
|
|
6167
6410
|
leaf,
|
|
6168
6411
|
allOf,
|
|
@@ -6237,4 +6480,4 @@ export {
|
|
|
6237
6480
|
focusedCheckoutUrl,
|
|
6238
6481
|
CHECKOUT_EVENT_KINDS
|
|
6239
6482
|
};
|
|
6240
|
-
//# sourceMappingURL=chunk-
|
|
6483
|
+
//# sourceMappingURL=chunk-S22IPUCK.js.map
|