@delopay/sdk 0.312.0 → 0.319.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.
@@ -519,9 +519,10 @@ var Billing = class {
519
519
  * @param params - Auto-recharge settings to update.
520
520
  * @returns The updated billing profile.
521
521
  */
522
- async updateAutoRecharge(merchantId, params) {
522
+ async updateAutoRecharge(merchantId, params, options) {
523
523
  return this.request("PATCH", `/billing/${encodeURIComponent(merchantId)}/auto-recharge`, {
524
- body: params
524
+ body: params,
525
+ ...options
525
526
  });
526
527
  }
527
528
  };
@@ -705,12 +706,13 @@ var Connectors = class {
705
706
  *
706
707
  * `POST /account/{accountId}/connectors/{connectorId}`
707
708
  */
708
- async update(accountId, connectorId, params) {
709
+ async update(accountId, connectorId, params, options) {
709
710
  return this.request(
710
711
  "POST",
711
712
  `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}`,
712
713
  {
713
- body: params
714
+ body: params,
715
+ ...options
714
716
  }
715
717
  );
716
718
  }
@@ -1274,8 +1276,11 @@ var Customers = class {
1274
1276
  * @param params - Fields to update (name, email, address, metadata, etc.).
1275
1277
  * @returns The updated customer.
1276
1278
  */
1277
- async update(customerId, params) {
1278
- return this.request("POST", `/customers/${encodeURIComponent(customerId)}`, { body: params });
1279
+ async update(customerId, params, options) {
1280
+ return this.request("POST", `/customers/${encodeURIComponent(customerId)}`, {
1281
+ body: params,
1282
+ ...options
1283
+ });
1279
1284
  }
1280
1285
  /**
1281
1286
  * Delete a customer and all their saved payment methods.
@@ -2131,8 +2136,11 @@ var Fees = class {
2131
2136
  * @param feeId - The fee schedule ID.
2132
2137
  * @param params - Fields to update.
2133
2138
  */
2134
- async update(feeId, params) {
2135
- return this.request("PUT", `/merchant-fees/${encodeURIComponent(feeId)}`, { body: params });
2139
+ async update(feeId, params, options) {
2140
+ return this.request("PUT", `/merchant-fees/${encodeURIComponent(feeId)}`, {
2141
+ body: params,
2142
+ ...options
2143
+ });
2136
2144
  }
2137
2145
  /**
2138
2146
  * Delete a merchant-scoped fee schedule.
@@ -2250,8 +2258,11 @@ var MerchantAccounts = class {
2250
2258
  async retrieve(accountId) {
2251
2259
  return this.request("GET", `/accounts/${encodeURIComponent(accountId)}`);
2252
2260
  }
2253
- async update(accountId, params) {
2254
- return this.request("POST", `/accounts/${encodeURIComponent(accountId)}`, { body: params });
2261
+ async update(accountId, params, options) {
2262
+ return this.request("POST", `/accounts/${encodeURIComponent(accountId)}`, {
2263
+ body: params,
2264
+ ...options
2265
+ });
2255
2266
  }
2256
2267
  async delete(accountId) {
2257
2268
  return this.request("DELETE", `/accounts/${encodeURIComponent(accountId)}`);
@@ -3361,12 +3372,13 @@ var Profiles = class {
3361
3372
  async listByProfile(accountId) {
3362
3373
  return this.request("GET", `/account/${encodeURIComponent(accountId)}/profile`);
3363
3374
  }
3364
- async update(accountId, profileId, params) {
3375
+ async update(accountId, profileId, params, options) {
3365
3376
  return this.request(
3366
3377
  "POST",
3367
3378
  `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}`,
3368
3379
  {
3369
- body: params
3380
+ body: params,
3381
+ ...options
3370
3382
  }
3371
3383
  );
3372
3384
  }
@@ -3471,10 +3483,14 @@ var Projects = class {
3471
3483
  * @param merchantId - Optional merchant scope. See {@link Projects.retrieve}.
3472
3484
  * @returns The updated project.
3473
3485
  */
3474
- async update(projectId, params, merchantId) {
3486
+ async update(projectId, params, merchantId, options) {
3475
3487
  const path = `/projects/${encodeURIComponent(projectId)}`;
3476
- if (merchantId === void 0) return this.request("PUT", path, { body: params });
3477
- return this.request("PUT", path, { body: params, query: { merchant_id: merchantId } });
3488
+ if (merchantId === void 0) return this.request("PUT", path, { body: params, ...options });
3489
+ return this.request("PUT", path, {
3490
+ body: params,
3491
+ query: { merchant_id: merchantId },
3492
+ ...options
3493
+ });
3478
3494
  }
3479
3495
  /**
3480
3496
  * Delete a project.
@@ -3617,8 +3633,11 @@ var Refunds = class {
3617
3633
  * @param params - Fields to update (reason, metadata).
3618
3634
  * @returns The updated refund.
3619
3635
  */
3620
- async update(refundId, params) {
3621
- return this.request("POST", `/refunds/${encodeURIComponent(refundId)}`, { body: params });
3636
+ async update(refundId, params, options) {
3637
+ return this.request("POST", `/refunds/${encodeURIComponent(refundId)}`, {
3638
+ body: params,
3639
+ ...options
3640
+ });
3622
3641
  }
3623
3642
  /**
3624
3643
  * List refunds, optionally filtered by payment, status, or date range.
@@ -3821,8 +3840,11 @@ var Routing = class {
3821
3840
  * @param params - The fields to change (at least one required).
3822
3841
  * @returns The updated routing configuration including the algorithm body.
3823
3842
  */
3824
- async update(algorithmId, params) {
3825
- return this.request("PUT", `/routing/${encodeURIComponent(algorithmId)}`, { body: params });
3843
+ async update(algorithmId, params, options) {
3844
+ return this.request("PUT", `/routing/${encodeURIComponent(algorithmId)}`, {
3845
+ body: params,
3846
+ ...options
3847
+ });
3826
3848
  }
3827
3849
  /**
3828
3850
  * Delete a static routing configuration.
@@ -3999,9 +4021,10 @@ var Routing = class {
3999
4021
  return this.request("GET", `/routing/default/profile/${encodeURIComponent(profileId)}`);
4000
4022
  }
4001
4023
  /** Update default config for a profile. `POST /routing/default/profile/{profileId}` */
4002
- async updateDefaultProfile(profileId, params) {
4024
+ async updateDefaultProfile(profileId, params, options) {
4003
4025
  return this.request("POST", `/routing/default/profile/${encodeURIComponent(profileId)}`, {
4004
- body: params
4026
+ body: params,
4027
+ ...options
4005
4028
  });
4006
4029
  }
4007
4030
  /** List routing configs for profile. `GET /routing/list/profile` */
@@ -4030,28 +4053,28 @@ var RoutingDecisionManager = class {
4030
4053
  this.request = request;
4031
4054
  }
4032
4055
  /** Upsert decision manager config. `PUT /routing/decision` */
4033
- async upsert(params) {
4034
- return this.request("PUT", "/routing/decision", { body: params });
4056
+ async upsert(params, options) {
4057
+ return this.request("PUT", "/routing/decision", { body: params, ...options });
4035
4058
  }
4036
4059
  /** Retrieve decision manager config. `GET /routing/decision` */
4037
4060
  async retrieve() {
4038
4061
  return this.request("GET", "/routing/decision");
4039
4062
  }
4040
4063
  /** Delete decision manager config. `DELETE /routing/decision` */
4041
- async delete() {
4042
- return this.request("DELETE", "/routing/decision");
4064
+ async delete(options) {
4065
+ return this.request("DELETE", "/routing/decision", options);
4043
4066
  }
4044
4067
  /** Upsert surcharge decision config. `PUT /routing/decision/surcharge` */
4045
- async upsertSurcharge(params) {
4046
- return this.request("PUT", "/routing/decision/surcharge", { body: params });
4068
+ async upsertSurcharge(params, options) {
4069
+ return this.request("PUT", "/routing/decision/surcharge", { body: params, ...options });
4047
4070
  }
4048
4071
  /** Retrieve surcharge decision config. `GET /routing/decision/surcharge` */
4049
4072
  async retrieveSurcharge() {
4050
4073
  return this.request("GET", "/routing/decision/surcharge");
4051
4074
  }
4052
4075
  /** Delete surcharge decision config. `DELETE /routing/decision/surcharge` */
4053
- async deleteSurcharge() {
4054
- return this.request("DELETE", "/routing/decision/surcharge");
4076
+ async deleteSurcharge(options) {
4077
+ return this.request("DELETE", "/routing/decision/surcharge", options);
4055
4078
  }
4056
4079
  };
4057
4080
  var SurchargeRules = class {
@@ -4073,8 +4096,8 @@ var SurchargeRules = class {
4073
4096
  * });
4074
4097
  * ```
4075
4098
  */
4076
- async upsert(params) {
4077
- return this.request("PUT", "/routing/surcharge/rules", { body: params });
4099
+ async upsert(params, options) {
4100
+ return this.request("PUT", "/routing/surcharge/rules", { body: params, ...options });
4078
4101
  }
4079
4102
  /**
4080
4103
  * Retrieve the active surcharge program for a scope, or `null` when none is set.
@@ -4095,9 +4118,10 @@ var SurchargeRules = class {
4095
4118
  *
4096
4119
  * @param profileId - Shop scope. Omit for the merchant-wide rule.
4097
4120
  */
4098
- async delete(profileId) {
4121
+ async delete(profileId, options) {
4099
4122
  return this.request("DELETE", "/routing/surcharge/rules", {
4100
- query: { profile_id: profileId }
4123
+ query: { profile_id: profileId },
4124
+ ...options
4101
4125
  });
4102
4126
  }
4103
4127
  };
@@ -4478,6 +4502,34 @@ var Shops = class {
4478
4502
  options
4479
4503
  );
4480
4504
  }
4505
+ /**
4506
+ * Read the Test checkout's appearance, used by payments created with
4507
+ * `test_mode: true`. Until its first save, Test follows Live:
4508
+ * `follows_live` is `true` and `payment_link_config` is Live's.
4509
+ *
4510
+ * `GET /shops/{merchantId}/{shopId}/checkout-branding/test`
4511
+ */
4512
+ async retrieveTestCheckoutBranding(merchantId, shopId, options) {
4513
+ return this.request(
4514
+ "GET",
4515
+ `/shops/${encodeURIComponent(merchantId)}/${encodeURIComponent(shopId)}/checkout-branding/test`,
4516
+ options
4517
+ );
4518
+ }
4519
+ /**
4520
+ * Replace the Test checkout's appearance, exactly as
4521
+ * {@link updateCheckoutBranding} replaces Live's. Live is not touched; a
4522
+ * shop whose Test followed Live has its own Test settings from this save on.
4523
+ *
4524
+ * `POST /shops/{merchantId}/{shopId}/checkout-branding/test`
4525
+ */
4526
+ async updateTestCheckoutBranding(merchantId, shopId, params, options) {
4527
+ return this.request(
4528
+ "POST",
4529
+ `/shops/${encodeURIComponent(merchantId)}/${encodeURIComponent(shopId)}/checkout-branding/test`,
4530
+ { body: params, ...options }
4531
+ );
4532
+ }
4481
4533
  };
4482
4534
 
4483
4535
  // src/resources/stripeConnect.ts
@@ -4633,8 +4685,8 @@ var Users = class {
4633
4685
  async getDetails() {
4634
4686
  return this.request("GET", "/user");
4635
4687
  }
4636
- async update(params) {
4637
- return this.request("POST", "/user/update", { body: params });
4688
+ async update(params, options) {
4689
+ return this.request("POST", "/user/update", { body: params, ...options });
4638
4690
  }
4639
4691
  /**
4640
4692
  * Read a preference owned by the logged-in user. Missing keys return value null.
@@ -5352,8 +5404,11 @@ var Users = class {
5352
5404
  return this.request("GET", `/user/role/${encodeURIComponent(roleId)}`);
5353
5405
  }
5354
5406
  /** Update role by ID. `PUT /user/role/{roleId}` */
5355
- async updateRole(roleId, params) {
5356
- return this.request("PUT", `/user/role/${encodeURIComponent(roleId)}`, { body: params });
5407
+ async updateRole(roleId, params, options) {
5408
+ return this.request("PUT", `/user/role/${encodeURIComponent(roleId)}`, {
5409
+ body: params,
5410
+ ...options
5411
+ });
5357
5412
  }
5358
5413
  /**
5359
5414
  * Delete a custom role. Predefined roles and roles still assigned to
@@ -5930,8 +5985,11 @@ var Analytics = class {
5930
5985
  * clear, and the full `surfaces` list you mean to keep.
5931
5986
  * `PUT /analytics/exclusions/{id}`
5932
5987
  */
5933
- async updateExclusion(id, rule) {
5934
- return this.request("PUT", `/analytics/exclusions/${encodeURIComponent(id)}`, { body: rule });
5988
+ async updateExclusion(id, rule, options) {
5989
+ return this.request("PUT", `/analytics/exclusions/${encodeURIComponent(id)}`, {
5990
+ body: rule,
5991
+ ...options
5992
+ });
5935
5993
  }
5936
5994
  /**
5937
5995
  * Delete a stored exclusion. Returns the rule as it was, so a caller can
@@ -5966,7 +6024,16 @@ var Analytics = class {
5966
6024
  async connectorEventLogs(params) {
5967
6025
  return this.request("GET", "/analytics/connector-event-logs", { query: params });
5968
6026
  }
5969
- /** Get routing event logs. `GET /analytics/routing-event-logs` */
6027
+ /**
6028
+ * Get routing event logs. `GET /analytics/routing-event-logs`
6029
+ *
6030
+ * @deprecated The service answers this only from a ClickHouse analytics
6031
+ * store; with SQL analytics, the default configuration, it answers an
6032
+ * error. To learn why a payment used a connector, read
6033
+ * `payments.routingDecisions(paymentId)`,
6034
+ * the routing decision recorded behind each attempt. This method stays for
6035
+ * compatibility and still sends the same request.
6036
+ */
5970
6037
  async routingEventLogs(params) {
5971
6038
  return this.request("GET", "/analytics/routing-event-logs", { query: params });
5972
6039
  }
@@ -6264,17 +6331,18 @@ var SellToRestrictions = class {
6264
6331
  * The change is recorded in the audit log before it is made.
6265
6332
  * `PUT /sell-to-restrictions/merchant`
6266
6333
  */
6267
- async updateMerchantPolicy(params) {
6268
- return this.request("PUT", "/sell-to-restrictions/merchant", { body: params });
6334
+ async updateMerchantPolicy(params, options) {
6335
+ return this.request("PUT", "/sell-to-restrictions/merchant", { body: params, ...options });
6269
6336
  }
6270
6337
  /**
6271
6338
  * Give one shop its own policy, replacing the merchant-wide policy for that
6272
6339
  * shop. An empty `blocked_countries` lifts every restriction for it.
6273
6340
  * `PUT /sell-to-restrictions/shops/{profile_id}`
6274
6341
  */
6275
- async updateShopOverride(profileId, params) {
6342
+ async updateShopOverride(profileId, params, options) {
6276
6343
  return this.request("PUT", `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`, {
6277
- body: params
6344
+ body: params,
6345
+ ...options
6278
6346
  });
6279
6347
  }
6280
6348
  /**
@@ -6282,8 +6350,12 @@ var SellToRestrictions = class {
6282
6350
  * Removing an override the shop does not have changes nothing.
6283
6351
  * `DELETE /sell-to-restrictions/shops/{profile_id}`
6284
6352
  */
6285
- async deleteShopOverride(profileId) {
6286
- return this.request("DELETE", `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`);
6353
+ async deleteShopOverride(profileId, options) {
6354
+ return this.request(
6355
+ "DELETE",
6356
+ `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`,
6357
+ options
6358
+ );
6287
6359
  }
6288
6360
  /**
6289
6361
  * Which checks each payment path performs, and how this deployment resolves
@@ -7849,10 +7921,11 @@ var ProcessorCosts = class {
7849
7921
  * @param params - The new rate.
7850
7922
  * @param merchantId - The merchant account ID.
7851
7923
  */
7852
- async replace(scheduleId, params, merchantId) {
7924
+ async replace(scheduleId, params, merchantId, options) {
7853
7925
  return this.request("POST", `/processor-costs/${encodeURIComponent(scheduleId)}/replace`, {
7854
7926
  body: params,
7855
- query: { merchant_id: merchantId }
7927
+ query: { merchant_id: merchantId },
7928
+ ...options
7856
7929
  });
7857
7930
  }
7858
7931
  /**
@@ -7877,33 +7950,42 @@ var CheckoutMethods = class {
7877
7950
  }
7878
7951
  /**
7879
7952
  * The shop's layout (stored, or derived from its accounts) and every item
7880
- * it may place. `GET /checkout-methods/{profile_id}`
7953
+ * it may place. Live's by default; `environment: 'test'` reads the Test
7954
+ * checkout's, used by payments with `test_mode: true`, which follows Live's
7955
+ * (`follows_live`) until its first save.
7956
+ * `GET /checkout-methods/{profile_id}` (`/test`)
7881
7957
  */
7882
- async retrieve(merchantId, profileId) {
7883
- return this.request("GET", `/checkout-methods/${encodeURIComponent(profileId)}`, {
7884
- query: { merchant_id: merchantId }
7958
+ async retrieve(merchantId, profileId, params = {}, options) {
7959
+ return this.request("GET", methodsPath(profileId, params.environment), {
7960
+ query: { merchant_id: merchantId },
7961
+ ...options
7885
7962
  });
7886
7963
  }
7887
7964
  /**
7888
7965
  * The same document as {@link retrieve}, on the route that stays open to a
7889
7966
  * reader of the checkout's appearance while the role's payment-data
7890
- * visibility is restricted. `GET /checkout-methods/{profile_id}/preview`
7967
+ * visibility is restricted.
7968
+ * `GET /checkout-methods/{profile_id}/preview` (`/test/preview`)
7891
7969
  */
7892
- async preview(merchantId, profileId) {
7893
- return this.request("GET", `/checkout-methods/${encodeURIComponent(profileId)}/preview`, {
7894
- query: { merchant_id: merchantId }
7970
+ async preview(merchantId, profileId, params = {}, options) {
7971
+ return this.request("GET", `${methodsPath(profileId, params.environment)}/preview`, {
7972
+ query: { merchant_id: merchantId },
7973
+ ...options
7895
7974
  });
7896
7975
  }
7897
7976
  /**
7898
- * Replace the shop's layout. The router refuses an express item that does
7899
- * not draw its own button, more than two rows of two in the express strip,
7900
- * a title without text, or an item no account of the shop offers.
7901
- * `PUT /checkout-methods/{profile_id}`
7977
+ * Replace the layout of one environment. The router refuses an express
7978
+ * item that does not draw its own button, more than two rows of two in the
7979
+ * express strip, a title without text, or an item no account of the shop
7980
+ * offers. Pass `options.headers` with the `If-Match` of the version read to
7981
+ * have a save over a newer change refused.
7982
+ * `PUT /checkout-methods/{profile_id}` (`/test`)
7902
7983
  */
7903
- async update(merchantId, profileId, body) {
7904
- return this.request("PUT", `/checkout-methods/${encodeURIComponent(profileId)}`, {
7984
+ async update(merchantId, profileId, body, params = {}, options) {
7985
+ return this.request("PUT", methodsPath(profileId, params.environment), {
7905
7986
  query: { merchant_id: merchantId },
7906
- body
7987
+ body,
7988
+ ...options
7907
7989
  });
7908
7990
  }
7909
7991
  /**
@@ -7953,14 +8035,59 @@ var CheckoutMethods = class {
7953
8035
  });
7954
8036
  }
7955
8037
  /**
7956
- * Delete the stored layout; the shop is back on the derived one.
7957
- * `DELETE /checkout-methods/{profile_id}`
8038
+ * Delete the stored layout of one environment; Live is back on the derived
8039
+ * layout, Test follows Live again.
8040
+ * `DELETE /checkout-methods/{profile_id}` (`/test`)
7958
8041
  */
7959
- async reset(merchantId, profileId) {
7960
- return this.request("DELETE", `/checkout-methods/${encodeURIComponent(profileId)}`, {
7961
- query: { merchant_id: merchantId }
8042
+ async reset(merchantId, profileId, params = {}, options) {
8043
+ return this.request("DELETE", methodsPath(profileId, params.environment), {
8044
+ query: { merchant_id: merchantId },
8045
+ ...options
7962
8046
  });
7963
8047
  }
8048
+ /**
8049
+ * The methods a payment of the shop can be limited to through
8050
+ * `allowed_payment_method_types`, in the order its checkout places them, for
8051
+ * one environment. Names methods only, never a processor or account.
8052
+ * `GET /checkout-methods/{profile_id}/payment-method-options` (`/test/…`)
8053
+ */
8054
+ async paymentMethodOptions(merchantId, profileId, params = {}, options) {
8055
+ return this.request(
8056
+ "GET",
8057
+ `${methodsPath(profileId, params.environment)}/payment-method-options`,
8058
+ { query: { merchant_id: merchantId }, ...options }
8059
+ );
8060
+ }
8061
+ /**
8062
+ * What the given redirect rules, saved or not, decide for the buyer the
8063
+ * body describes, and how each rule fared. The buyer's options are the
8064
+ * shop's layout after its availability rules and the cap states; nothing is
8065
+ * stored. Live's checkout by default, `environment: 'test'` for the Test
8066
+ * checkout's. Refused with 422 when the rules are malformed or name an
8067
+ * account that is not the shop's, and with 403 when they name one the
8068
+ * caller may not read.
8069
+ * `POST /checkout-methods/{profile_id}/redirect-rules/test` (`/test/…`)
8070
+ */
8071
+ async testRedirectRules(merchantId, profileId, body, params = {}, options) {
8072
+ return this.request(
8073
+ "POST",
8074
+ `${methodsPath(profileId, params.environment)}/redirect-rules/test`,
8075
+ { query: { merchant_id: merchantId }, body, ...options }
8076
+ );
8077
+ }
8078
+ /**
8079
+ * Hide a connector account from the checkout of the named environments, or
8080
+ * show it again. Its items stay in the layout, listed with
8081
+ * `account_enabled: false`; routing and credentials are not changed.
8082
+ * `PUT /checkout-methods/{profile_id}/accounts/{merchant_connector_id}/visibility`
8083
+ */
8084
+ async setAccountVisibility(merchantId, profileId, merchantConnectorId, body, options) {
8085
+ return this.request(
8086
+ "PUT",
8087
+ `/checkout-methods/${encodeURIComponent(profileId)}/accounts/${encodeURIComponent(merchantConnectorId)}/visibility`,
8088
+ { query: { merchant_id: merchantId }, body, ...options }
8089
+ );
8090
+ }
7964
8091
  /**
7965
8092
  * The shop's checkout entries: separate ways into the hosted checkout of
7966
8093
  * one payment (`?entry=<key>`), such as a card form embedded in the shop's
@@ -7999,6 +8126,10 @@ var CheckoutMethods = class {
7999
8126
  });
8000
8127
  }
8001
8128
  };
8129
+ function methodsPath(profileId, environment) {
8130
+ const shop = `/checkout-methods/${encodeURIComponent(profileId)}`;
8131
+ return environment === "test" ? `${shop}/test` : shop;
8132
+ }
8002
8133
  function entriesPath(profileId, environment) {
8003
8134
  const shop = `/checkout-methods/${encodeURIComponent(profileId)}`;
8004
8135
  return environment === "test" ? `${shop}/test/entries` : `${shop}/entries`;
@@ -15728,4 +15859,4 @@ export {
15728
15859
  decodeNativePanes,
15729
15860
  encodeNativePanes
15730
15861
  };
15731
- //# sourceMappingURL=chunk-FRYFAWLF.js.map
15862
+ //# sourceMappingURL=chunk-4QNMF3GL.js.map