@delopay/sdk 0.150.0 → 0.152.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-NM2EROEY.js → chunk-ZLD3ZEMZ.js} +62 -6
- package/dist/chunk-ZLD3ZEMZ.js.map +1 -0
- package/dist/index.cjs +62 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +208 -9
- package/dist/index.d.ts +208 -9
- package/dist/index.js +3 -1
- package/dist/internal.cjs +62 -5
- 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 +3 -1
- package/dist/internal.js.map +1 -1
- package/package.json +17 -18
- package/dist/chunk-NM2EROEY.js.map +0 -1
|
@@ -952,6 +952,16 @@ var Disputes = class {
|
|
|
952
952
|
async retrieve(disputeId) {
|
|
953
953
|
return this.request("GET", `/disputes/${encodeURIComponent(disputeId)}`);
|
|
954
954
|
}
|
|
955
|
+
/** Read declared links and provider-reported refund references. Empty means unknown. */
|
|
956
|
+
async listRefundAssociations(disputeId) {
|
|
957
|
+
return this.request("GET", `/disputes/${encodeURIComponent(disputeId)}/refund-associations`);
|
|
958
|
+
}
|
|
959
|
+
/** Declare or clear an allocation against a successful refund of this payment. */
|
|
960
|
+
async setRefundAssociation(disputeId, params) {
|
|
961
|
+
return this.request("PUT", `/disputes/${encodeURIComponent(disputeId)}/refund-associations`, {
|
|
962
|
+
body: params
|
|
963
|
+
});
|
|
964
|
+
}
|
|
955
965
|
/**
|
|
956
966
|
* List disputes, optionally filtered by status, stage, or date range.
|
|
957
967
|
*
|
|
@@ -4288,6 +4298,43 @@ var AvailabilityOverrides = class {
|
|
|
4288
4298
|
}
|
|
4289
4299
|
};
|
|
4290
4300
|
|
|
4301
|
+
// src/resources/checkoutMethods.ts
|
|
4302
|
+
var CheckoutMethods = class {
|
|
4303
|
+
constructor(request) {
|
|
4304
|
+
this.request = request;
|
|
4305
|
+
}
|
|
4306
|
+
/**
|
|
4307
|
+
* The shop's layout (stored, or derived from its accounts) and every item
|
|
4308
|
+
* it may place. `GET /checkout-methods/{profile_id}`
|
|
4309
|
+
*/
|
|
4310
|
+
async retrieve(merchantId, profileId) {
|
|
4311
|
+
return this.request("GET", `/checkout-methods/${encodeURIComponent(profileId)}`, {
|
|
4312
|
+
query: { merchant_id: merchantId }
|
|
4313
|
+
});
|
|
4314
|
+
}
|
|
4315
|
+
/**
|
|
4316
|
+
* Replace the shop's layout. The router refuses an express item that does
|
|
4317
|
+
* not draw its own button, more than two rows of two in the express strip,
|
|
4318
|
+
* a title without text, or an item no account of the shop offers.
|
|
4319
|
+
* `PUT /checkout-methods/{profile_id}`
|
|
4320
|
+
*/
|
|
4321
|
+
async update(merchantId, profileId, body) {
|
|
4322
|
+
return this.request("PUT", `/checkout-methods/${encodeURIComponent(profileId)}`, {
|
|
4323
|
+
query: { merchant_id: merchantId },
|
|
4324
|
+
body
|
|
4325
|
+
});
|
|
4326
|
+
}
|
|
4327
|
+
/**
|
|
4328
|
+
* Delete the stored layout; the shop is back on the derived one.
|
|
4329
|
+
* `DELETE /checkout-methods/{profile_id}`
|
|
4330
|
+
*/
|
|
4331
|
+
async reset(merchantId, profileId) {
|
|
4332
|
+
return this.request("DELETE", `/checkout-methods/${encodeURIComponent(profileId)}`, {
|
|
4333
|
+
query: { merchant_id: merchantId }
|
|
4334
|
+
});
|
|
4335
|
+
}
|
|
4336
|
+
};
|
|
4337
|
+
|
|
4291
4338
|
// src/resources/subscriptions.ts
|
|
4292
4339
|
var Subscriptions = class {
|
|
4293
4340
|
constructor(request) {
|
|
@@ -5170,6 +5217,7 @@ var Delopay = class {
|
|
|
5170
5217
|
this.forex = new Forex(request);
|
|
5171
5218
|
this.regions = new Regions(request);
|
|
5172
5219
|
this.availabilityOverrides = new AvailabilityOverrides(request);
|
|
5220
|
+
this.checkoutMethods = new CheckoutMethods(request);
|
|
5173
5221
|
this.analytics = new Analytics(request);
|
|
5174
5222
|
this.analyticsDashboard = new AnalyticsDashboard(request);
|
|
5175
5223
|
this.featureMatrix = new FeatureMatrix(request);
|
|
@@ -7566,19 +7614,23 @@ var CheckoutSession = class {
|
|
|
7566
7614
|
* discriminated union owned by the consuming checkout, which keeps its
|
|
7567
7615
|
* own types and runtime gates — hence the loose return type.
|
|
7568
7616
|
*
|
|
7569
|
-
* `theme`
|
|
7570
|
-
*
|
|
7617
|
+
* `theme` (a named checkout variant) and `country` are the route's declared
|
|
7618
|
+
* query parameters. `country` is a manual override of the buyer country the
|
|
7619
|
+
* router otherwise resolves from the client IP — it decides which payment
|
|
7620
|
+
* methods the layout shows — as an ISO 3166-1 alpha-2 code, sent uppercased
|
|
7621
|
+
* and omitted when empty. `locale` travels as `Accept-Language` — the only
|
|
7571
7622
|
* channel the backend's locale resolution reads; a `?locale=` query is
|
|
7572
7623
|
* silently ignored by this route.
|
|
7573
7624
|
*
|
|
7574
7625
|
* `GET /payment-link/data/{merchantId}/{paymentId}`
|
|
7575
7626
|
*/
|
|
7576
7627
|
async fetchCheckoutData(params, options) {
|
|
7628
|
+
const country = params?.country?.trim().toUpperCase();
|
|
7577
7629
|
return this.client.request(
|
|
7578
7630
|
"GET",
|
|
7579
7631
|
`/payment-link/data/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,
|
|
7580
7632
|
{
|
|
7581
|
-
query: { theme: params?.theme },
|
|
7633
|
+
query: { theme: params?.theme, country: country || void 0 },
|
|
7582
7634
|
...options,
|
|
7583
7635
|
headers: {
|
|
7584
7636
|
...params?.locale ? {
|
|
@@ -7886,6 +7938,9 @@ var CheckoutSession = class {
|
|
|
7886
7938
|
|
|
7887
7939
|
// src/panes.ts
|
|
7888
7940
|
var PANE_VISIBILITIES = ["always", "embedded_only", "external_only"];
|
|
7941
|
+
function parseOpenTarget(raw) {
|
|
7942
|
+
return raw === "popup" || raw === "same_page" ? raw : "tab";
|
|
7943
|
+
}
|
|
7889
7944
|
function parseVisibility(raw) {
|
|
7890
7945
|
return PANE_VISIBILITIES.find((value) => value === raw) ?? "always";
|
|
7891
7946
|
}
|
|
@@ -8177,7 +8232,7 @@ function decodePanes(raw) {
|
|
|
8177
8232
|
// Anything unrecognised degrades to `always` rather than dropping the row.
|
|
8178
8233
|
visibility: parseVisibility(entry["visibility"]),
|
|
8179
8234
|
// Same tolerance: an unknown value degrades to the default `tab`.
|
|
8180
|
-
openIn: entry["open_in"]
|
|
8235
|
+
openIn: parseOpenTarget(entry["open_in"]),
|
|
8181
8236
|
nativeElement: parseNativeElement(entry["native_element"]),
|
|
8182
8237
|
preset: str(entry["preset"]),
|
|
8183
8238
|
style: str(entry["style"])
|
|
@@ -8232,7 +8287,7 @@ function encodePanes(panes) {
|
|
|
8232
8287
|
// never went through `decodePanes`. A decoded pane always holds a valid
|
|
8233
8288
|
// value, so this is a no-op on the round-trip path.
|
|
8234
8289
|
visibility: parseVisibility(pane.visibility),
|
|
8235
|
-
open_in: pane.openIn
|
|
8290
|
+
open_in: parseOpenTarget(pane.openIn),
|
|
8236
8291
|
// Omitted at the default: `everywhere` is what the router decodes an
|
|
8237
8292
|
// absent key to, so leaving it out changes nothing — and keeps a blob
|
|
8238
8293
|
// stored before the field existed byte-identical on re-encode, which
|
|
@@ -8301,6 +8356,7 @@ export {
|
|
|
8301
8356
|
Forex,
|
|
8302
8357
|
Regions,
|
|
8303
8358
|
AvailabilityOverrides,
|
|
8359
|
+
CheckoutMethods,
|
|
8304
8360
|
Subscriptions,
|
|
8305
8361
|
Audit,
|
|
8306
8362
|
Settlement,
|
|
@@ -8457,4 +8513,4 @@ export {
|
|
|
8457
8513
|
decodeNativePanes,
|
|
8458
8514
|
encodeNativePanes
|
|
8459
8515
|
};
|
|
8460
|
-
//# sourceMappingURL=chunk-
|
|
8516
|
+
//# sourceMappingURL=chunk-ZLD3ZEMZ.js.map
|