@delopay/sdk 0.41.0 → 0.43.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-DMNCVY25.js → chunk-235UFV7Z.js} +61 -1
- package/dist/chunk-235UFV7Z.js.map +1 -0
- package/dist/index.cjs +60 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +113 -1
- package/dist/index.d.ts +113 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +60 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DMNCVY25.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1682,6 +1682,7 @@ var Routing = class {
|
|
|
1682
1682
|
constructor(request) {
|
|
1683
1683
|
this.request = request;
|
|
1684
1684
|
this.decision = new RoutingDecisionManager(request);
|
|
1685
|
+
this.surchargeRules = new SurchargeRules(request);
|
|
1685
1686
|
}
|
|
1686
1687
|
/**
|
|
1687
1688
|
* Create a new routing algorithm.
|
|
@@ -1743,6 +1744,18 @@ var Routing = class {
|
|
|
1743
1744
|
async list() {
|
|
1744
1745
|
return this.request("GET", "/routing");
|
|
1745
1746
|
}
|
|
1747
|
+
/**
|
|
1748
|
+
* Connector names denied at routing for a shop (explicit denies plus
|
|
1749
|
+
* whitelist-implied exclusions). Read-only; surfaced in the routing builder.
|
|
1750
|
+
*
|
|
1751
|
+
* `GET /routing/connector-restrictions/{profileId}`
|
|
1752
|
+
*/
|
|
1753
|
+
async connectorRestrictions(profileId) {
|
|
1754
|
+
return this.request(
|
|
1755
|
+
"GET",
|
|
1756
|
+
`/routing/connector-restrictions/${encodeURIComponent(profileId)}`
|
|
1757
|
+
);
|
|
1758
|
+
}
|
|
1746
1759
|
// --- Advanced operations (Task 3.4) ---
|
|
1747
1760
|
/** Get active routing config. `GET /routing/active` */
|
|
1748
1761
|
async getActive() {
|
|
@@ -1812,6 +1825,53 @@ var RoutingDecisionManager = class {
|
|
|
1812
1825
|
return this.request("DELETE", "/routing/decision/surcharge");
|
|
1813
1826
|
}
|
|
1814
1827
|
};
|
|
1828
|
+
var SurchargeRules = class {
|
|
1829
|
+
constructor(request) {
|
|
1830
|
+
this.request = request;
|
|
1831
|
+
}
|
|
1832
|
+
/**
|
|
1833
|
+
* Create or replace the surcharge program for a scope.
|
|
1834
|
+
*
|
|
1835
|
+
* `PUT /routing/surcharge/rules`
|
|
1836
|
+
*
|
|
1837
|
+
* @example
|
|
1838
|
+
* ```typescript
|
|
1839
|
+
* await delopay.routing.surchargeRules.upsert({
|
|
1840
|
+
* surcharges: [
|
|
1841
|
+
* { payment_method: 'crypto', surcharge: { rate: { percent: 1.0 } } },
|
|
1842
|
+
* { payment_method: 'card', surcharge: { fixed: { amount: 35 } } },
|
|
1843
|
+
* ],
|
|
1844
|
+
* });
|
|
1845
|
+
* ```
|
|
1846
|
+
*/
|
|
1847
|
+
async upsert(params) {
|
|
1848
|
+
return this.request("PUT", "/routing/surcharge/rules", { body: params });
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Retrieve the active surcharge program for a scope, or `null` when none is set.
|
|
1852
|
+
*
|
|
1853
|
+
* `GET /routing/surcharge/rules?profile_id={profileId}`
|
|
1854
|
+
*
|
|
1855
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
1856
|
+
*/
|
|
1857
|
+
async retrieve(profileId) {
|
|
1858
|
+
return this.request("GET", "/routing/surcharge/rules", {
|
|
1859
|
+
query: { profile_id: profileId }
|
|
1860
|
+
});
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Deactivate the active surcharge program for a scope.
|
|
1864
|
+
*
|
|
1865
|
+
* `DELETE /routing/surcharge/rules?profile_id={profileId}`
|
|
1866
|
+
*
|
|
1867
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
1868
|
+
*/
|
|
1869
|
+
async delete(profileId) {
|
|
1870
|
+
return this.request("DELETE", "/routing/surcharge/rules", {
|
|
1871
|
+
query: { profile_id: profileId }
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
};
|
|
1815
1875
|
|
|
1816
1876
|
// src/resources/search.ts
|
|
1817
1877
|
var Search = class {
|