@delopay/sdk 0.42.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-HIKVDY3V.js → chunk-235UFV7Z.js} +49 -1
- package/dist/chunk-235UFV7Z.js.map +1 -0
- package/dist/index.cjs +48 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -1
- package/dist/index.d.ts +101 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +48 -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-HIKVDY3V.js.map +0 -1
|
@@ -1613,6 +1613,7 @@ var Routing = class {
|
|
|
1613
1613
|
constructor(request) {
|
|
1614
1614
|
this.request = request;
|
|
1615
1615
|
this.decision = new RoutingDecisionManager(request);
|
|
1616
|
+
this.surchargeRules = new SurchargeRules(request);
|
|
1616
1617
|
}
|
|
1617
1618
|
/**
|
|
1618
1619
|
* Create a new routing algorithm.
|
|
@@ -1755,6 +1756,53 @@ var RoutingDecisionManager = class {
|
|
|
1755
1756
|
return this.request("DELETE", "/routing/decision/surcharge");
|
|
1756
1757
|
}
|
|
1757
1758
|
};
|
|
1759
|
+
var SurchargeRules = class {
|
|
1760
|
+
constructor(request) {
|
|
1761
|
+
this.request = request;
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* Create or replace the surcharge program for a scope.
|
|
1765
|
+
*
|
|
1766
|
+
* `PUT /routing/surcharge/rules`
|
|
1767
|
+
*
|
|
1768
|
+
* @example
|
|
1769
|
+
* ```typescript
|
|
1770
|
+
* await delopay.routing.surchargeRules.upsert({
|
|
1771
|
+
* surcharges: [
|
|
1772
|
+
* { payment_method: 'crypto', surcharge: { rate: { percent: 1.0 } } },
|
|
1773
|
+
* { payment_method: 'card', surcharge: { fixed: { amount: 35 } } },
|
|
1774
|
+
* ],
|
|
1775
|
+
* });
|
|
1776
|
+
* ```
|
|
1777
|
+
*/
|
|
1778
|
+
async upsert(params) {
|
|
1779
|
+
return this.request("PUT", "/routing/surcharge/rules", { body: params });
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* Retrieve the active surcharge program for a scope, or `null` when none is set.
|
|
1783
|
+
*
|
|
1784
|
+
* `GET /routing/surcharge/rules?profile_id={profileId}`
|
|
1785
|
+
*
|
|
1786
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
1787
|
+
*/
|
|
1788
|
+
async retrieve(profileId) {
|
|
1789
|
+
return this.request("GET", "/routing/surcharge/rules", {
|
|
1790
|
+
query: { profile_id: profileId }
|
|
1791
|
+
});
|
|
1792
|
+
}
|
|
1793
|
+
/**
|
|
1794
|
+
* Deactivate the active surcharge program for a scope.
|
|
1795
|
+
*
|
|
1796
|
+
* `DELETE /routing/surcharge/rules?profile_id={profileId}`
|
|
1797
|
+
*
|
|
1798
|
+
* @param profileId - Shop scope. Omit for the merchant-wide rule.
|
|
1799
|
+
*/
|
|
1800
|
+
async delete(profileId) {
|
|
1801
|
+
return this.request("DELETE", "/routing/surcharge/rules", {
|
|
1802
|
+
query: { profile_id: profileId }
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
};
|
|
1758
1806
|
|
|
1759
1807
|
// src/resources/search.ts
|
|
1760
1808
|
var Search = class {
|
|
@@ -3808,4 +3856,4 @@ export {
|
|
|
3808
3856
|
applyBrandingVariables,
|
|
3809
3857
|
shadowFor
|
|
3810
3858
|
};
|
|
3811
|
-
//# sourceMappingURL=chunk-
|
|
3859
|
+
//# sourceMappingURL=chunk-235UFV7Z.js.map
|