@delopay/sdk 0.309.0 → 0.318.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-FRYFAWLF.js → chunk-4QNMF3GL.js} +200 -69
- package/dist/chunk-4QNMF3GL.js.map +1 -0
- package/dist/{index-Bao1891v.d.cts → index-BDkbJukm.d.cts} +665 -44
- package/dist/{index-Bao1891v.d.ts → index-BDkbJukm.d.ts} +665 -44
- package/dist/index.cjs +199 -68
- 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 +1 -1
- package/dist/internal.cjs +276 -74
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +282 -8
- package/dist/internal.d.ts +282 -8
- package/dist/internal.js +78 -7
- package/dist/internal.js.map +1 -1
- package/package.json +17 -18
- package/dist/chunk-FRYFAWLF.js.map +0 -1
package/dist/internal.cjs
CHANGED
|
@@ -825,9 +825,10 @@ var Billing = class {
|
|
|
825
825
|
* @param params - Auto-recharge settings to update.
|
|
826
826
|
* @returns The updated billing profile.
|
|
827
827
|
*/
|
|
828
|
-
async updateAutoRecharge(merchantId, params) {
|
|
828
|
+
async updateAutoRecharge(merchantId, params, options) {
|
|
829
829
|
return this.request("PATCH", `/billing/${encodeURIComponent(merchantId)}/auto-recharge`, {
|
|
830
|
-
body: params
|
|
830
|
+
body: params,
|
|
831
|
+
...options
|
|
831
832
|
});
|
|
832
833
|
}
|
|
833
834
|
};
|
|
@@ -1011,12 +1012,13 @@ var Connectors = class {
|
|
|
1011
1012
|
*
|
|
1012
1013
|
* `POST /account/{accountId}/connectors/{connectorId}`
|
|
1013
1014
|
*/
|
|
1014
|
-
async update(accountId, connectorId, params) {
|
|
1015
|
+
async update(accountId, connectorId, params, options) {
|
|
1015
1016
|
return this.request(
|
|
1016
1017
|
"POST",
|
|
1017
1018
|
`/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}`,
|
|
1018
1019
|
{
|
|
1019
|
-
body: params
|
|
1020
|
+
body: params,
|
|
1021
|
+
...options
|
|
1020
1022
|
}
|
|
1021
1023
|
);
|
|
1022
1024
|
}
|
|
@@ -1580,8 +1582,11 @@ var Customers = class {
|
|
|
1580
1582
|
* @param params - Fields to update (name, email, address, metadata, etc.).
|
|
1581
1583
|
* @returns The updated customer.
|
|
1582
1584
|
*/
|
|
1583
|
-
async update(customerId, params) {
|
|
1584
|
-
return this.request("POST", `/customers/${encodeURIComponent(customerId)}`, {
|
|
1585
|
+
async update(customerId, params, options) {
|
|
1586
|
+
return this.request("POST", `/customers/${encodeURIComponent(customerId)}`, {
|
|
1587
|
+
body: params,
|
|
1588
|
+
...options
|
|
1589
|
+
});
|
|
1585
1590
|
}
|
|
1586
1591
|
/**
|
|
1587
1592
|
* Delete a customer and all their saved payment methods.
|
|
@@ -2437,8 +2442,11 @@ var Fees = class {
|
|
|
2437
2442
|
* @param feeId - The fee schedule ID.
|
|
2438
2443
|
* @param params - Fields to update.
|
|
2439
2444
|
*/
|
|
2440
|
-
async update(feeId, params) {
|
|
2441
|
-
return this.request("PUT", `/merchant-fees/${encodeURIComponent(feeId)}`, {
|
|
2445
|
+
async update(feeId, params, options) {
|
|
2446
|
+
return this.request("PUT", `/merchant-fees/${encodeURIComponent(feeId)}`, {
|
|
2447
|
+
body: params,
|
|
2448
|
+
...options
|
|
2449
|
+
});
|
|
2442
2450
|
}
|
|
2443
2451
|
/**
|
|
2444
2452
|
* Delete a merchant-scoped fee schedule.
|
|
@@ -2556,8 +2564,11 @@ var MerchantAccounts = class {
|
|
|
2556
2564
|
async retrieve(accountId) {
|
|
2557
2565
|
return this.request("GET", `/accounts/${encodeURIComponent(accountId)}`);
|
|
2558
2566
|
}
|
|
2559
|
-
async update(accountId, params) {
|
|
2560
|
-
return this.request("POST", `/accounts/${encodeURIComponent(accountId)}`, {
|
|
2567
|
+
async update(accountId, params, options) {
|
|
2568
|
+
return this.request("POST", `/accounts/${encodeURIComponent(accountId)}`, {
|
|
2569
|
+
body: params,
|
|
2570
|
+
...options
|
|
2571
|
+
});
|
|
2561
2572
|
}
|
|
2562
2573
|
async delete(accountId) {
|
|
2563
2574
|
return this.request("DELETE", `/accounts/${encodeURIComponent(accountId)}`);
|
|
@@ -3667,12 +3678,13 @@ var Profiles = class {
|
|
|
3667
3678
|
async listByProfile(accountId) {
|
|
3668
3679
|
return this.request("GET", `/account/${encodeURIComponent(accountId)}/profile`);
|
|
3669
3680
|
}
|
|
3670
|
-
async update(accountId, profileId, params) {
|
|
3681
|
+
async update(accountId, profileId, params, options) {
|
|
3671
3682
|
return this.request(
|
|
3672
3683
|
"POST",
|
|
3673
3684
|
`/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}`,
|
|
3674
3685
|
{
|
|
3675
|
-
body: params
|
|
3686
|
+
body: params,
|
|
3687
|
+
...options
|
|
3676
3688
|
}
|
|
3677
3689
|
);
|
|
3678
3690
|
}
|
|
@@ -3777,10 +3789,14 @@ var Projects = class {
|
|
|
3777
3789
|
* @param merchantId - Optional merchant scope. See {@link Projects.retrieve}.
|
|
3778
3790
|
* @returns The updated project.
|
|
3779
3791
|
*/
|
|
3780
|
-
async update(projectId, params, merchantId) {
|
|
3792
|
+
async update(projectId, params, merchantId, options) {
|
|
3781
3793
|
const path = `/projects/${encodeURIComponent(projectId)}`;
|
|
3782
|
-
if (merchantId === void 0) return this.request("PUT", path, { body: params });
|
|
3783
|
-
return this.request("PUT", path, {
|
|
3794
|
+
if (merchantId === void 0) return this.request("PUT", path, { body: params, ...options });
|
|
3795
|
+
return this.request("PUT", path, {
|
|
3796
|
+
body: params,
|
|
3797
|
+
query: { merchant_id: merchantId },
|
|
3798
|
+
...options
|
|
3799
|
+
});
|
|
3784
3800
|
}
|
|
3785
3801
|
/**
|
|
3786
3802
|
* Delete a project.
|
|
@@ -3923,8 +3939,11 @@ var Refunds = class {
|
|
|
3923
3939
|
* @param params - Fields to update (reason, metadata).
|
|
3924
3940
|
* @returns The updated refund.
|
|
3925
3941
|
*/
|
|
3926
|
-
async update(refundId, params) {
|
|
3927
|
-
return this.request("POST", `/refunds/${encodeURIComponent(refundId)}`, {
|
|
3942
|
+
async update(refundId, params, options) {
|
|
3943
|
+
return this.request("POST", `/refunds/${encodeURIComponent(refundId)}`, {
|
|
3944
|
+
body: params,
|
|
3945
|
+
...options
|
|
3946
|
+
});
|
|
3928
3947
|
}
|
|
3929
3948
|
/**
|
|
3930
3949
|
* List refunds, optionally filtered by payment, status, or date range.
|
|
@@ -4127,8 +4146,11 @@ var Routing = class {
|
|
|
4127
4146
|
* @param params - The fields to change (at least one required).
|
|
4128
4147
|
* @returns The updated routing configuration including the algorithm body.
|
|
4129
4148
|
*/
|
|
4130
|
-
async update(algorithmId, params) {
|
|
4131
|
-
return this.request("PUT", `/routing/${encodeURIComponent(algorithmId)}`, {
|
|
4149
|
+
async update(algorithmId, params, options) {
|
|
4150
|
+
return this.request("PUT", `/routing/${encodeURIComponent(algorithmId)}`, {
|
|
4151
|
+
body: params,
|
|
4152
|
+
...options
|
|
4153
|
+
});
|
|
4132
4154
|
}
|
|
4133
4155
|
/**
|
|
4134
4156
|
* Delete a static routing configuration.
|
|
@@ -4305,9 +4327,10 @@ var Routing = class {
|
|
|
4305
4327
|
return this.request("GET", `/routing/default/profile/${encodeURIComponent(profileId)}`);
|
|
4306
4328
|
}
|
|
4307
4329
|
/** Update default config for a profile. `POST /routing/default/profile/{profileId}` */
|
|
4308
|
-
async updateDefaultProfile(profileId, params) {
|
|
4330
|
+
async updateDefaultProfile(profileId, params, options) {
|
|
4309
4331
|
return this.request("POST", `/routing/default/profile/${encodeURIComponent(profileId)}`, {
|
|
4310
|
-
body: params
|
|
4332
|
+
body: params,
|
|
4333
|
+
...options
|
|
4311
4334
|
});
|
|
4312
4335
|
}
|
|
4313
4336
|
/** List routing configs for profile. `GET /routing/list/profile` */
|
|
@@ -4336,28 +4359,28 @@ var RoutingDecisionManager = class {
|
|
|
4336
4359
|
this.request = request;
|
|
4337
4360
|
}
|
|
4338
4361
|
/** Upsert decision manager config. `PUT /routing/decision` */
|
|
4339
|
-
async upsert(params) {
|
|
4340
|
-
return this.request("PUT", "/routing/decision", { body: params });
|
|
4362
|
+
async upsert(params, options) {
|
|
4363
|
+
return this.request("PUT", "/routing/decision", { body: params, ...options });
|
|
4341
4364
|
}
|
|
4342
4365
|
/** Retrieve decision manager config. `GET /routing/decision` */
|
|
4343
4366
|
async retrieve() {
|
|
4344
4367
|
return this.request("GET", "/routing/decision");
|
|
4345
4368
|
}
|
|
4346
4369
|
/** Delete decision manager config. `DELETE /routing/decision` */
|
|
4347
|
-
async delete() {
|
|
4348
|
-
return this.request("DELETE", "/routing/decision");
|
|
4370
|
+
async delete(options) {
|
|
4371
|
+
return this.request("DELETE", "/routing/decision", options);
|
|
4349
4372
|
}
|
|
4350
4373
|
/** Upsert surcharge decision config. `PUT /routing/decision/surcharge` */
|
|
4351
|
-
async upsertSurcharge(params) {
|
|
4352
|
-
return this.request("PUT", "/routing/decision/surcharge", { body: params });
|
|
4374
|
+
async upsertSurcharge(params, options) {
|
|
4375
|
+
return this.request("PUT", "/routing/decision/surcharge", { body: params, ...options });
|
|
4353
4376
|
}
|
|
4354
4377
|
/** Retrieve surcharge decision config. `GET /routing/decision/surcharge` */
|
|
4355
4378
|
async retrieveSurcharge() {
|
|
4356
4379
|
return this.request("GET", "/routing/decision/surcharge");
|
|
4357
4380
|
}
|
|
4358
4381
|
/** Delete surcharge decision config. `DELETE /routing/decision/surcharge` */
|
|
4359
|
-
async deleteSurcharge() {
|
|
4360
|
-
return this.request("DELETE", "/routing/decision/surcharge");
|
|
4382
|
+
async deleteSurcharge(options) {
|
|
4383
|
+
return this.request("DELETE", "/routing/decision/surcharge", options);
|
|
4361
4384
|
}
|
|
4362
4385
|
};
|
|
4363
4386
|
var SurchargeRules = class {
|
|
@@ -4379,8 +4402,8 @@ var SurchargeRules = class {
|
|
|
4379
4402
|
* });
|
|
4380
4403
|
* ```
|
|
4381
4404
|
*/
|
|
4382
|
-
async upsert(params) {
|
|
4383
|
-
return this.request("PUT", "/routing/surcharge/rules", { body: params });
|
|
4405
|
+
async upsert(params, options) {
|
|
4406
|
+
return this.request("PUT", "/routing/surcharge/rules", { body: params, ...options });
|
|
4384
4407
|
}
|
|
4385
4408
|
/**
|
|
4386
4409
|
* Retrieve the active surcharge program for a scope, or `null` when none is set.
|
|
@@ -4401,9 +4424,10 @@ var SurchargeRules = class {
|
|
|
4401
4424
|
*
|
|
4402
4425
|
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
4403
4426
|
*/
|
|
4404
|
-
async delete(profileId) {
|
|
4427
|
+
async delete(profileId, options) {
|
|
4405
4428
|
return this.request("DELETE", "/routing/surcharge/rules", {
|
|
4406
|
-
query: { profile_id: profileId }
|
|
4429
|
+
query: { profile_id: profileId },
|
|
4430
|
+
...options
|
|
4407
4431
|
});
|
|
4408
4432
|
}
|
|
4409
4433
|
};
|
|
@@ -4784,6 +4808,34 @@ var Shops = class {
|
|
|
4784
4808
|
options
|
|
4785
4809
|
);
|
|
4786
4810
|
}
|
|
4811
|
+
/**
|
|
4812
|
+
* Read the Test checkout's appearance, used by payments created with
|
|
4813
|
+
* `test_mode: true`. Until its first save, Test follows Live:
|
|
4814
|
+
* `follows_live` is `true` and `payment_link_config` is Live's.
|
|
4815
|
+
*
|
|
4816
|
+
* `GET /shops/{merchantId}/{shopId}/checkout-branding/test`
|
|
4817
|
+
*/
|
|
4818
|
+
async retrieveTestCheckoutBranding(merchantId, shopId, options) {
|
|
4819
|
+
return this.request(
|
|
4820
|
+
"GET",
|
|
4821
|
+
`/shops/${encodeURIComponent(merchantId)}/${encodeURIComponent(shopId)}/checkout-branding/test`,
|
|
4822
|
+
options
|
|
4823
|
+
);
|
|
4824
|
+
}
|
|
4825
|
+
/**
|
|
4826
|
+
* Replace the Test checkout's appearance, exactly as
|
|
4827
|
+
* {@link updateCheckoutBranding} replaces Live's. Live is not touched; a
|
|
4828
|
+
* shop whose Test followed Live has its own Test settings from this save on.
|
|
4829
|
+
*
|
|
4830
|
+
* `POST /shops/{merchantId}/{shopId}/checkout-branding/test`
|
|
4831
|
+
*/
|
|
4832
|
+
async updateTestCheckoutBranding(merchantId, shopId, params, options) {
|
|
4833
|
+
return this.request(
|
|
4834
|
+
"POST",
|
|
4835
|
+
`/shops/${encodeURIComponent(merchantId)}/${encodeURIComponent(shopId)}/checkout-branding/test`,
|
|
4836
|
+
{ body: params, ...options }
|
|
4837
|
+
);
|
|
4838
|
+
}
|
|
4787
4839
|
};
|
|
4788
4840
|
|
|
4789
4841
|
// src/resources/stripeConnect.ts
|
|
@@ -4939,8 +4991,8 @@ var Users = class {
|
|
|
4939
4991
|
async getDetails() {
|
|
4940
4992
|
return this.request("GET", "/user");
|
|
4941
4993
|
}
|
|
4942
|
-
async update(params) {
|
|
4943
|
-
return this.request("POST", "/user/update", { body: params });
|
|
4994
|
+
async update(params, options) {
|
|
4995
|
+
return this.request("POST", "/user/update", { body: params, ...options });
|
|
4944
4996
|
}
|
|
4945
4997
|
/**
|
|
4946
4998
|
* Read a preference owned by the logged-in user. Missing keys return value null.
|
|
@@ -5658,8 +5710,11 @@ var Users = class {
|
|
|
5658
5710
|
return this.request("GET", `/user/role/${encodeURIComponent(roleId)}`);
|
|
5659
5711
|
}
|
|
5660
5712
|
/** Update role by ID. `PUT /user/role/{roleId}` */
|
|
5661
|
-
async updateRole(roleId, params) {
|
|
5662
|
-
return this.request("PUT", `/user/role/${encodeURIComponent(roleId)}`, {
|
|
5713
|
+
async updateRole(roleId, params, options) {
|
|
5714
|
+
return this.request("PUT", `/user/role/${encodeURIComponent(roleId)}`, {
|
|
5715
|
+
body: params,
|
|
5716
|
+
...options
|
|
5717
|
+
});
|
|
5663
5718
|
}
|
|
5664
5719
|
/**
|
|
5665
5720
|
* Delete a custom role. Predefined roles and roles still assigned to
|
|
@@ -6236,8 +6291,11 @@ var Analytics = class {
|
|
|
6236
6291
|
* clear, and the full `surfaces` list you mean to keep.
|
|
6237
6292
|
* `PUT /analytics/exclusions/{id}`
|
|
6238
6293
|
*/
|
|
6239
|
-
async updateExclusion(id, rule) {
|
|
6240
|
-
return this.request("PUT", `/analytics/exclusions/${encodeURIComponent(id)}`, {
|
|
6294
|
+
async updateExclusion(id, rule, options) {
|
|
6295
|
+
return this.request("PUT", `/analytics/exclusions/${encodeURIComponent(id)}`, {
|
|
6296
|
+
body: rule,
|
|
6297
|
+
...options
|
|
6298
|
+
});
|
|
6241
6299
|
}
|
|
6242
6300
|
/**
|
|
6243
6301
|
* Delete a stored exclusion. Returns the rule as it was, so a caller can
|
|
@@ -6272,7 +6330,16 @@ var Analytics = class {
|
|
|
6272
6330
|
async connectorEventLogs(params) {
|
|
6273
6331
|
return this.request("GET", "/analytics/connector-event-logs", { query: params });
|
|
6274
6332
|
}
|
|
6275
|
-
/**
|
|
6333
|
+
/**
|
|
6334
|
+
* Get routing event logs. `GET /analytics/routing-event-logs`
|
|
6335
|
+
*
|
|
6336
|
+
* @deprecated The service answers this only from a ClickHouse analytics
|
|
6337
|
+
* store; with SQL analytics, the default configuration, it answers an
|
|
6338
|
+
* error. To learn why a payment used a connector, read
|
|
6339
|
+
* `payments.routingDecisions(paymentId)`,
|
|
6340
|
+
* the routing decision recorded behind each attempt. This method stays for
|
|
6341
|
+
* compatibility and still sends the same request.
|
|
6342
|
+
*/
|
|
6276
6343
|
async routingEventLogs(params) {
|
|
6277
6344
|
return this.request("GET", "/analytics/routing-event-logs", { query: params });
|
|
6278
6345
|
}
|
|
@@ -6570,17 +6637,18 @@ var SellToRestrictions = class {
|
|
|
6570
6637
|
* The change is recorded in the audit log before it is made.
|
|
6571
6638
|
* `PUT /sell-to-restrictions/merchant`
|
|
6572
6639
|
*/
|
|
6573
|
-
async updateMerchantPolicy(params) {
|
|
6574
|
-
return this.request("PUT", "/sell-to-restrictions/merchant", { body: params });
|
|
6640
|
+
async updateMerchantPolicy(params, options) {
|
|
6641
|
+
return this.request("PUT", "/sell-to-restrictions/merchant", { body: params, ...options });
|
|
6575
6642
|
}
|
|
6576
6643
|
/**
|
|
6577
6644
|
* Give one shop its own policy, replacing the merchant-wide policy for that
|
|
6578
6645
|
* shop. An empty `blocked_countries` lifts every restriction for it.
|
|
6579
6646
|
* `PUT /sell-to-restrictions/shops/{profile_id}`
|
|
6580
6647
|
*/
|
|
6581
|
-
async updateShopOverride(profileId, params) {
|
|
6648
|
+
async updateShopOverride(profileId, params, options) {
|
|
6582
6649
|
return this.request("PUT", `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`, {
|
|
6583
|
-
body: params
|
|
6650
|
+
body: params,
|
|
6651
|
+
...options
|
|
6584
6652
|
});
|
|
6585
6653
|
}
|
|
6586
6654
|
/**
|
|
@@ -6588,8 +6656,12 @@ var SellToRestrictions = class {
|
|
|
6588
6656
|
* Removing an override the shop does not have changes nothing.
|
|
6589
6657
|
* `DELETE /sell-to-restrictions/shops/{profile_id}`
|
|
6590
6658
|
*/
|
|
6591
|
-
async deleteShopOverride(profileId) {
|
|
6592
|
-
return this.request(
|
|
6659
|
+
async deleteShopOverride(profileId, options) {
|
|
6660
|
+
return this.request(
|
|
6661
|
+
"DELETE",
|
|
6662
|
+
`/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`,
|
|
6663
|
+
options
|
|
6664
|
+
);
|
|
6593
6665
|
}
|
|
6594
6666
|
/**
|
|
6595
6667
|
* Which checks each payment path performs, and how this deployment resolves
|
|
@@ -8155,10 +8227,11 @@ var ProcessorCosts = class {
|
|
|
8155
8227
|
* @param params - The new rate.
|
|
8156
8228
|
* @param merchantId - The merchant account ID.
|
|
8157
8229
|
*/
|
|
8158
|
-
async replace(scheduleId, params, merchantId) {
|
|
8230
|
+
async replace(scheduleId, params, merchantId, options) {
|
|
8159
8231
|
return this.request("POST", `/processor-costs/${encodeURIComponent(scheduleId)}/replace`, {
|
|
8160
8232
|
body: params,
|
|
8161
|
-
query: { merchant_id: merchantId }
|
|
8233
|
+
query: { merchant_id: merchantId },
|
|
8234
|
+
...options
|
|
8162
8235
|
});
|
|
8163
8236
|
}
|
|
8164
8237
|
/**
|
|
@@ -8183,33 +8256,42 @@ var CheckoutMethods = class {
|
|
|
8183
8256
|
}
|
|
8184
8257
|
/**
|
|
8185
8258
|
* The shop's layout (stored, or derived from its accounts) and every item
|
|
8186
|
-
* it may place. `
|
|
8259
|
+
* it may place. Live's by default; `environment: 'test'` reads the Test
|
|
8260
|
+
* checkout's, used by payments with `test_mode: true`, which follows Live's
|
|
8261
|
+
* (`follows_live`) until its first save.
|
|
8262
|
+
* `GET /checkout-methods/{profile_id}` (`/test`)
|
|
8187
8263
|
*/
|
|
8188
|
-
async retrieve(merchantId, profileId) {
|
|
8189
|
-
return this.request("GET",
|
|
8190
|
-
query: { merchant_id: merchantId }
|
|
8264
|
+
async retrieve(merchantId, profileId, params = {}, options) {
|
|
8265
|
+
return this.request("GET", methodsPath(profileId, params.environment), {
|
|
8266
|
+
query: { merchant_id: merchantId },
|
|
8267
|
+
...options
|
|
8191
8268
|
});
|
|
8192
8269
|
}
|
|
8193
8270
|
/**
|
|
8194
8271
|
* The same document as {@link retrieve}, on the route that stays open to a
|
|
8195
8272
|
* reader of the checkout's appearance while the role's payment-data
|
|
8196
|
-
* visibility is restricted.
|
|
8273
|
+
* visibility is restricted.
|
|
8274
|
+
* `GET /checkout-methods/{profile_id}/preview` (`/test/preview`)
|
|
8197
8275
|
*/
|
|
8198
|
-
async preview(merchantId, profileId) {
|
|
8199
|
-
return this.request("GET",
|
|
8200
|
-
query: { merchant_id: merchantId }
|
|
8276
|
+
async preview(merchantId, profileId, params = {}, options) {
|
|
8277
|
+
return this.request("GET", `${methodsPath(profileId, params.environment)}/preview`, {
|
|
8278
|
+
query: { merchant_id: merchantId },
|
|
8279
|
+
...options
|
|
8201
8280
|
});
|
|
8202
8281
|
}
|
|
8203
8282
|
/**
|
|
8204
|
-
* Replace the
|
|
8205
|
-
* not draw its own button, more than two rows of two in the
|
|
8206
|
-
* a title without text, or an item no account of the shop
|
|
8207
|
-
* `
|
|
8283
|
+
* Replace the layout of one environment. The router refuses an express
|
|
8284
|
+
* item that does not draw its own button, more than two rows of two in the
|
|
8285
|
+
* express strip, a title without text, or an item no account of the shop
|
|
8286
|
+
* offers. Pass `options.headers` with the `If-Match` of the version read to
|
|
8287
|
+
* have a save over a newer change refused.
|
|
8288
|
+
* `PUT /checkout-methods/{profile_id}` (`/test`)
|
|
8208
8289
|
*/
|
|
8209
|
-
async update(merchantId, profileId, body) {
|
|
8210
|
-
return this.request("PUT",
|
|
8290
|
+
async update(merchantId, profileId, body, params = {}, options) {
|
|
8291
|
+
return this.request("PUT", methodsPath(profileId, params.environment), {
|
|
8211
8292
|
query: { merchant_id: merchantId },
|
|
8212
|
-
body
|
|
8293
|
+
body,
|
|
8294
|
+
...options
|
|
8213
8295
|
});
|
|
8214
8296
|
}
|
|
8215
8297
|
/**
|
|
@@ -8259,14 +8341,59 @@ var CheckoutMethods = class {
|
|
|
8259
8341
|
});
|
|
8260
8342
|
}
|
|
8261
8343
|
/**
|
|
8262
|
-
* Delete the stored layout;
|
|
8263
|
-
*
|
|
8344
|
+
* Delete the stored layout of one environment; Live is back on the derived
|
|
8345
|
+
* layout, Test follows Live again.
|
|
8346
|
+
* `DELETE /checkout-methods/{profile_id}` (`/test`)
|
|
8264
8347
|
*/
|
|
8265
|
-
async reset(merchantId, profileId) {
|
|
8266
|
-
return this.request("DELETE",
|
|
8267
|
-
query: { merchant_id: merchantId }
|
|
8348
|
+
async reset(merchantId, profileId, params = {}, options) {
|
|
8349
|
+
return this.request("DELETE", methodsPath(profileId, params.environment), {
|
|
8350
|
+
query: { merchant_id: merchantId },
|
|
8351
|
+
...options
|
|
8268
8352
|
});
|
|
8269
8353
|
}
|
|
8354
|
+
/**
|
|
8355
|
+
* The methods a payment of the shop can be limited to through
|
|
8356
|
+
* `allowed_payment_method_types`, in the order its checkout places them, for
|
|
8357
|
+
* one environment. Names methods only, never a processor or account.
|
|
8358
|
+
* `GET /checkout-methods/{profile_id}/payment-method-options` (`/test/…`)
|
|
8359
|
+
*/
|
|
8360
|
+
async paymentMethodOptions(merchantId, profileId, params = {}, options) {
|
|
8361
|
+
return this.request(
|
|
8362
|
+
"GET",
|
|
8363
|
+
`${methodsPath(profileId, params.environment)}/payment-method-options`,
|
|
8364
|
+
{ query: { merchant_id: merchantId }, ...options }
|
|
8365
|
+
);
|
|
8366
|
+
}
|
|
8367
|
+
/**
|
|
8368
|
+
* What the given redirect rules, saved or not, decide for the buyer the
|
|
8369
|
+
* body describes, and how each rule fared. The buyer's options are the
|
|
8370
|
+
* shop's layout after its availability rules and the cap states; nothing is
|
|
8371
|
+
* stored. Live's checkout by default, `environment: 'test'` for the Test
|
|
8372
|
+
* checkout's. Refused with 422 when the rules are malformed or name an
|
|
8373
|
+
* account that is not the shop's, and with 403 when they name one the
|
|
8374
|
+
* caller may not read.
|
|
8375
|
+
* `POST /checkout-methods/{profile_id}/redirect-rules/test` (`/test/…`)
|
|
8376
|
+
*/
|
|
8377
|
+
async testRedirectRules(merchantId, profileId, body, params = {}, options) {
|
|
8378
|
+
return this.request(
|
|
8379
|
+
"POST",
|
|
8380
|
+
`${methodsPath(profileId, params.environment)}/redirect-rules/test`,
|
|
8381
|
+
{ query: { merchant_id: merchantId }, body, ...options }
|
|
8382
|
+
);
|
|
8383
|
+
}
|
|
8384
|
+
/**
|
|
8385
|
+
* Hide a connector account from the checkout of the named environments, or
|
|
8386
|
+
* show it again. Its items stay in the layout, listed with
|
|
8387
|
+
* `account_enabled: false`; routing and credentials are not changed.
|
|
8388
|
+
* `PUT /checkout-methods/{profile_id}/accounts/{merchant_connector_id}/visibility`
|
|
8389
|
+
*/
|
|
8390
|
+
async setAccountVisibility(merchantId, profileId, merchantConnectorId, body, options) {
|
|
8391
|
+
return this.request(
|
|
8392
|
+
"PUT",
|
|
8393
|
+
`/checkout-methods/${encodeURIComponent(profileId)}/accounts/${encodeURIComponent(merchantConnectorId)}/visibility`,
|
|
8394
|
+
{ query: { merchant_id: merchantId }, body, ...options }
|
|
8395
|
+
);
|
|
8396
|
+
}
|
|
8270
8397
|
/**
|
|
8271
8398
|
* The shop's checkout entries: separate ways into the hosted checkout of
|
|
8272
8399
|
* one payment (`?entry=<key>`), such as a card form embedded in the shop's
|
|
@@ -8305,6 +8432,10 @@ var CheckoutMethods = class {
|
|
|
8305
8432
|
});
|
|
8306
8433
|
}
|
|
8307
8434
|
};
|
|
8435
|
+
function methodsPath(profileId, environment) {
|
|
8436
|
+
const shop = `/checkout-methods/${encodeURIComponent(profileId)}`;
|
|
8437
|
+
return environment === "test" ? `${shop}/test` : shop;
|
|
8438
|
+
}
|
|
8308
8439
|
function entriesPath(profileId, environment) {
|
|
8309
8440
|
const shop = `/checkout-methods/${encodeURIComponent(profileId)}`;
|
|
8310
8441
|
return environment === "test" ? `${shop}/test/entries` : `${shop}/entries`;
|
|
@@ -16307,12 +16438,13 @@ var AdminPortal = class {
|
|
|
16307
16438
|
return this.request("POST", "/admin-portal/analytics/exclusions/copy", { body });
|
|
16308
16439
|
}
|
|
16309
16440
|
/**
|
|
16310
|
-
* Shop comparison
|
|
16311
|
-
*
|
|
16312
|
-
*
|
|
16313
|
-
* `
|
|
16441
|
+
* Shop comparison: one series per shop over one window, with whole-window
|
|
16442
|
+
* and previous-window totals. With `merchant_id`, that merchant's shops;
|
|
16443
|
+
* without it, the top `limit` (default 50) shops of every merchant by
|
|
16444
|
+
* successful volume, the rest summed into `others`. Same contract as the
|
|
16445
|
+
* merchant surface's `analytics.shops`. `GET /admin-portal/analytics/shops`
|
|
16314
16446
|
*/
|
|
16315
|
-
async analyticsShops(params) {
|
|
16447
|
+
async analyticsShops(params = {}) {
|
|
16316
16448
|
const query = params;
|
|
16317
16449
|
return this.request("GET", "/admin-portal/analytics/shops", {
|
|
16318
16450
|
query
|
|
@@ -16558,11 +16690,13 @@ var AdminPortal = class {
|
|
|
16558
16690
|
*
|
|
16559
16691
|
* Server validates each origin: full origin (scheme + host[:port]),
|
|
16560
16692
|
* no path/query/fragment, no wildcards.
|
|
16693
|
+
*
|
|
16694
|
+
* `POST /admin-portal/accounts/{merchantId}/business-profile/{profileId}/iframe-origins`
|
|
16561
16695
|
*/
|
|
16562
16696
|
async updateShopIframeOrigins(merchantId, profileId, origins) {
|
|
16563
16697
|
return this.request(
|
|
16564
16698
|
"POST",
|
|
16565
|
-
`/admin-portal/accounts/${encodeURIComponent(merchantId)}/
|
|
16699
|
+
`/admin-portal/accounts/${encodeURIComponent(merchantId)}/business-profile/${encodeURIComponent(profileId)}/iframe-origins`,
|
|
16566
16700
|
{ body: { iframe_allowed_origins: origins } }
|
|
16567
16701
|
);
|
|
16568
16702
|
}
|
|
@@ -16959,6 +17093,74 @@ var AdminPortal = class {
|
|
|
16959
17093
|
async getRiskBackfill(jobId) {
|
|
16960
17094
|
return this.request("GET", `/admin-portal/risk-engine/backfill/${encodeURIComponent(jobId)}`);
|
|
16961
17095
|
}
|
|
17096
|
+
/**
|
|
17097
|
+
* Where a merchant stands in the risk policy (`merchant_risk.policy`): the
|
|
17098
|
+
* policy in force, the stage, the conditions of the last evaluation with
|
|
17099
|
+
* their evidence, pending and past actions, exemptions and stage changes.
|
|
17100
|
+
*
|
|
17101
|
+
* `GET /admin-portal/accounts/{merchant_id}/risk/stage`
|
|
17102
|
+
*/
|
|
17103
|
+
async getMerchantRiskStage(merchantId) {
|
|
17104
|
+
return this.request("GET", `${adminAccount(merchantId)}/risk/stage`);
|
|
17105
|
+
}
|
|
17106
|
+
/**
|
|
17107
|
+
* Evaluate a merchant against its risk policy now, as the scoring pass
|
|
17108
|
+
* does, and answer where it stands afterwards. Needs `AccountManage`.
|
|
17109
|
+
*
|
|
17110
|
+
* `POST /admin-portal/accounts/{merchant_id}/risk/stage/evaluate`
|
|
17111
|
+
*/
|
|
17112
|
+
async evaluateMerchantRiskStage(merchantId) {
|
|
17113
|
+
return this.request("POST", `${adminAccount(merchantId)}/risk/stage/evaluate`, { body: {} });
|
|
17114
|
+
}
|
|
17115
|
+
/**
|
|
17116
|
+
* Apply a pending action that waits for an operator. An action already
|
|
17117
|
+
* decided, suppressed or expired is refused with `DE_19` (HTTP 409).
|
|
17118
|
+
*
|
|
17119
|
+
* `POST /admin-portal/accounts/{merchant_id}/risk/actions/{action_id}/confirm`
|
|
17120
|
+
*/
|
|
17121
|
+
async confirmMerchantRiskAction(merchantId, actionId, params = {}) {
|
|
17122
|
+
return this.request(
|
|
17123
|
+
"POST",
|
|
17124
|
+
`${adminAccount(merchantId)}/risk/actions/${encodeURIComponent(actionId)}/confirm`,
|
|
17125
|
+
{ body: params }
|
|
17126
|
+
);
|
|
17127
|
+
}
|
|
17128
|
+
/**
|
|
17129
|
+
* Dismiss a pending action with a reason; it never applies. An action
|
|
17130
|
+
* already decided is refused with `DE_19` (HTTP 409).
|
|
17131
|
+
*
|
|
17132
|
+
* `POST /admin-portal/accounts/{merchant_id}/risk/actions/{action_id}/dismiss`
|
|
17133
|
+
*/
|
|
17134
|
+
async dismissMerchantRiskAction(merchantId, actionId, params) {
|
|
17135
|
+
return this.request(
|
|
17136
|
+
"POST",
|
|
17137
|
+
`${adminAccount(merchantId)}/risk/actions/${encodeURIComponent(actionId)}/dismiss`,
|
|
17138
|
+
{ body: params }
|
|
17139
|
+
);
|
|
17140
|
+
}
|
|
17141
|
+
/**
|
|
17142
|
+
* Exempt a merchant from one action for one risk dimension, until
|
|
17143
|
+
* `expires_at` or for good. An exempted action is recorded as `suppressed`
|
|
17144
|
+
* with the exemption's id; the stage itself is still entered.
|
|
17145
|
+
*
|
|
17146
|
+
* `POST /admin-portal/accounts/{merchant_id}/risk/exemptions`
|
|
17147
|
+
*/
|
|
17148
|
+
async createMerchantRiskExemption(merchantId, params) {
|
|
17149
|
+
return this.request("POST", `${adminAccount(merchantId)}/risk/exemptions`, { body: params });
|
|
17150
|
+
}
|
|
17151
|
+
/**
|
|
17152
|
+
* End an exemption now, with a reason. It no longer suppresses anything
|
|
17153
|
+
* from the next evaluation on.
|
|
17154
|
+
*
|
|
17155
|
+
* `POST /admin-portal/accounts/{merchant_id}/risk/exemptions/{exemption_id}/revoke`
|
|
17156
|
+
*/
|
|
17157
|
+
async revokeMerchantRiskExemption(merchantId, exemptionId, params) {
|
|
17158
|
+
return this.request(
|
|
17159
|
+
"POST",
|
|
17160
|
+
`${adminAccount(merchantId)}/risk/exemptions/${encodeURIComponent(exemptionId)}/revoke`,
|
|
17161
|
+
{ body: params }
|
|
17162
|
+
);
|
|
17163
|
+
}
|
|
16962
17164
|
};
|
|
16963
17165
|
function transactionListQuery(params) {
|
|
16964
17166
|
if (!params) return void 0;
|