@delopay/sdk 0.267.0 → 0.270.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-C7D3FUJ2.js → chunk-HEDL3UHE.js} +94 -10
- package/dist/chunk-HEDL3UHE.js.map +1 -0
- package/dist/index.cjs +94 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +239 -39
- package/dist/index.d.ts +239 -39
- package/dist/index.js +3 -1
- package/dist/internal.cjs +96 -9
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +8 -3
- package/dist/internal.d.ts +8 -3
- package/dist/internal.js +5 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-C7D3FUJ2.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -114,6 +114,7 @@ import {
|
|
|
114
114
|
SellToRestrictions,
|
|
115
115
|
Settings,
|
|
116
116
|
Settlement,
|
|
117
|
+
ShopLabels,
|
|
117
118
|
Subscriptions,
|
|
118
119
|
UNKNOWN_SECTION_ORDER,
|
|
119
120
|
WCAG_AA_TEXT,
|
|
@@ -251,7 +252,7 @@ import {
|
|
|
251
252
|
visibleCustomFields,
|
|
252
253
|
whopAccentSwatch,
|
|
253
254
|
whopCardElement
|
|
254
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-HEDL3UHE.js";
|
|
255
256
|
export {
|
|
256
257
|
AIRWALLEX_AUTOFILL_TREATMENTS,
|
|
257
258
|
AIRWALLEX_CARD_LAYOUTS,
|
|
@@ -368,6 +369,7 @@ export {
|
|
|
368
369
|
SellToRestrictions,
|
|
369
370
|
Settings,
|
|
370
371
|
Settlement,
|
|
372
|
+
ShopLabels,
|
|
371
373
|
Subscriptions,
|
|
372
374
|
UNKNOWN_SECTION_ORDER,
|
|
373
375
|
WCAG_AA_TEXT,
|
package/dist/internal.cjs
CHANGED
|
@@ -151,6 +151,7 @@ __export(internal_exports, {
|
|
|
151
151
|
SellToRestrictions: () => SellToRestrictions,
|
|
152
152
|
Settings: () => Settings,
|
|
153
153
|
Settlement: () => Settlement,
|
|
154
|
+
ShopLabels: () => ShopLabels,
|
|
154
155
|
Subscriptions: () => Subscriptions,
|
|
155
156
|
UNKNOWN_SECTION_ORDER: () => UNKNOWN_SECTION_ORDER,
|
|
156
157
|
WCAG_AA_TEXT: () => WCAG_AA_TEXT,
|
|
@@ -2933,6 +2934,35 @@ var Payments = class {
|
|
|
2933
2934
|
body: params
|
|
2934
2935
|
});
|
|
2935
2936
|
}
|
|
2937
|
+
/**
|
|
2938
|
+
* Abort a payment nobody has paid. The payment becomes `aborted`: its hosted
|
|
2939
|
+
* checkout stops taking payments, a confirm is refused, and it can no longer
|
|
2940
|
+
* be reactivated. Every processor object a buyer could still pay is closed
|
|
2941
|
+
* where the processor allows it, and a `payment_aborted` webhook is sent.
|
|
2942
|
+
*
|
|
2943
|
+
* A success the processor confirms later still moves the payment to
|
|
2944
|
+
* `succeeded`, so the order can be fulfilled or refunded. Aborting an
|
|
2945
|
+
* aborted payment returns it unchanged. A payment that took money, holds an
|
|
2946
|
+
* authorisation or awaits a merchant decision is refused with `IR_16`
|
|
2947
|
+
* (HTTP 400).
|
|
2948
|
+
*
|
|
2949
|
+
* `POST /payments/{paymentId}/abort`
|
|
2950
|
+
*
|
|
2951
|
+
* @param paymentId - The payment intent ID to abort.
|
|
2952
|
+
* @param params - Optional `reason`, at most 255 characters, stored as the
|
|
2953
|
+
* attempt's cancellation reason (`merchant_aborted` when absent).
|
|
2954
|
+
* @returns The payment, with status `aborted`.
|
|
2955
|
+
*
|
|
2956
|
+
* @example
|
|
2957
|
+
* ```typescript
|
|
2958
|
+
* const payment = await delopay.payments.abort('pay_123', { reason: 'order_cancelled' });
|
|
2959
|
+
* ```
|
|
2960
|
+
*/
|
|
2961
|
+
async abort(paymentId, params) {
|
|
2962
|
+
return this.request("POST", `/payments/${encodeURIComponent(paymentId)}/abort`, {
|
|
2963
|
+
body: params ?? {}
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2936
2966
|
/**
|
|
2937
2967
|
* List payment intents, optionally filtered by customer or date range.
|
|
2938
2968
|
*
|
|
@@ -5942,6 +5972,63 @@ var BuyerBlocklist = class {
|
|
|
5942
5972
|
}
|
|
5943
5973
|
};
|
|
5944
5974
|
|
|
5975
|
+
// src/resources/shopLabels.ts
|
|
5976
|
+
var labelsPath = (merchantId) => `/account/${encodeURIComponent(merchantId)}/business-profile/labels`;
|
|
5977
|
+
var ShopLabels = class {
|
|
5978
|
+
constructor(request) {
|
|
5979
|
+
this.request = request;
|
|
5980
|
+
}
|
|
5981
|
+
/**
|
|
5982
|
+
* Every label of the merchant, ordered by name, each with the ids of the
|
|
5983
|
+
* shops that carry it. A shop with several labels appears under each of
|
|
5984
|
+
* them; a shop with none appears under no label. A caller limited to one
|
|
5985
|
+
* shop sees every label but only its own shop in `profile_ids`.
|
|
5986
|
+
* `GET /account/{merchantId}/business-profile/labels`
|
|
5987
|
+
*/
|
|
5988
|
+
async list(merchantId) {
|
|
5989
|
+
return this.request("GET", labelsPath(merchantId));
|
|
5990
|
+
}
|
|
5991
|
+
/**
|
|
5992
|
+
* Create a label. The name is trimmed and inner whitespace collapsed; a
|
|
5993
|
+
* name that differs from an existing label only in letter case is refused
|
|
5994
|
+
* (`IR_38`), so one category is never spelled two ways. A merchant holds at
|
|
5995
|
+
* most 200 labels.
|
|
5996
|
+
* `POST /account/{merchantId}/business-profile/labels`
|
|
5997
|
+
*/
|
|
5998
|
+
async create(merchantId, params) {
|
|
5999
|
+
return this.request("POST", labelsPath(merchantId), { body: params });
|
|
6000
|
+
}
|
|
6001
|
+
/**
|
|
6002
|
+
* Rename a label on every shop that carries it.
|
|
6003
|
+
* `PATCH /account/{merchantId}/business-profile/labels/{labelId}`
|
|
6004
|
+
*/
|
|
6005
|
+
async update(merchantId, labelId, params) {
|
|
6006
|
+
return this.request("PATCH", `${labelsPath(merchantId)}/${encodeURIComponent(labelId)}`, {
|
|
6007
|
+
body: params
|
|
6008
|
+
});
|
|
6009
|
+
}
|
|
6010
|
+
/**
|
|
6011
|
+
* Delete a label and remove it from every shop. The shops are unchanged.
|
|
6012
|
+
* `DELETE /account/{merchantId}/business-profile/labels/{labelId}`
|
|
6013
|
+
*/
|
|
6014
|
+
async delete(merchantId, labelId) {
|
|
6015
|
+
return this.request("DELETE", `${labelsPath(merchantId)}/${encodeURIComponent(labelId)}`);
|
|
6016
|
+
}
|
|
6017
|
+
/**
|
|
6018
|
+
* Replace the labels of one shop: `label_ids` is the complete set
|
|
6019
|
+
* afterwards, so a label left out is removed from the shop and an empty
|
|
6020
|
+
* list removes them all. At most 20 per shop.
|
|
6021
|
+
* `PUT /account/{merchantId}/business-profile/{profileId}/labels`
|
|
6022
|
+
*/
|
|
6023
|
+
async setForShop(merchantId, profileId, params) {
|
|
6024
|
+
return this.request(
|
|
6025
|
+
"PUT",
|
|
6026
|
+
`/account/${encodeURIComponent(merchantId)}/business-profile/${encodeURIComponent(profileId)}/labels`,
|
|
6027
|
+
{ body: params }
|
|
6028
|
+
);
|
|
6029
|
+
}
|
|
6030
|
+
};
|
|
6031
|
+
|
|
5945
6032
|
// src/resources/buyerConversations.ts
|
|
5946
6033
|
var BuyerConversations = class {
|
|
5947
6034
|
constructor(request) {
|
|
@@ -9144,6 +9231,7 @@ var Delopay = class {
|
|
|
9144
9231
|
this.availabilityOverrides = new AvailabilityOverrides(request);
|
|
9145
9232
|
this.sellToRestrictions = new SellToRestrictions(request);
|
|
9146
9233
|
this.buyerBlocklist = new BuyerBlocklist(request);
|
|
9234
|
+
this.shopLabels = new ShopLabels(request);
|
|
9147
9235
|
this.buyerConversations = new BuyerConversations(request);
|
|
9148
9236
|
this.buyerEvidence = new BuyerEvidenceReviews(request);
|
|
9149
9237
|
this.checkoutRecovery = new CheckoutRecovery(request);
|
|
@@ -12931,15 +13019,11 @@ var CheckoutSession = class {
|
|
|
12931
13019
|
});
|
|
12932
13020
|
}
|
|
12933
13021
|
/**
|
|
12934
|
-
* The PayPal order for the payment
|
|
12935
|
-
*
|
|
12936
|
-
* was confirmed through that pane
|
|
12937
|
-
*
|
|
12938
|
-
*
|
|
12939
|
-
* `amount` and `currency` are what e-Payouts charges for it. Repeated calls
|
|
12940
|
-
* answer the same order, so a cancelled PayPal popup is retried with the same
|
|
12941
|
-
* code. When `captured` is `true` a capture was already reported: create no
|
|
12942
|
-
* order and wait for the payment's status instead.
|
|
13022
|
+
* The PayPal order e-Payouts created for the payment, for the PayPal SDK's
|
|
13023
|
+
* `createOrder` on the PayPal Express or Pay with card pane, after the payment
|
|
13024
|
+
* was confirmed through that pane. Return `order_id` from `createOrder` and
|
|
13025
|
+
* send the buyer to `approve_url` once PayPal approved it; without an order,
|
|
13026
|
+
* or when PayPal's button cannot be drawn, send the buyer to `redirect_url`.
|
|
12943
13027
|
*
|
|
12944
13028
|
* `POST /payment-link/{merchantId}/{paymentId}/epayouts/paypal-order`
|
|
12945
13029
|
*/
|
|
@@ -14834,6 +14918,7 @@ function transactionListQuery(params) {
|
|
|
14834
14918
|
merchant_connector_ids,
|
|
14835
14919
|
connector_settlement_statuses,
|
|
14836
14920
|
routing_approaches,
|
|
14921
|
+
failure_substatuses,
|
|
14837
14922
|
product_ids,
|
|
14838
14923
|
...query
|
|
14839
14924
|
} = params;
|
|
@@ -14847,6 +14932,7 @@ function transactionListQuery(params) {
|
|
|
14847
14932
|
...merchant_connector_ids?.length ? { merchant_connector_ids: merchant_connector_ids.join(",") } : {},
|
|
14848
14933
|
...connector_settlement_statuses?.length ? { connector_settlement_statuses: connector_settlement_statuses.join(",") } : {},
|
|
14849
14934
|
...routing_approaches?.length ? { routing_approaches: routing_approaches.join(",") } : {},
|
|
14935
|
+
...failure_substatuses?.length ? { failure_substatuses: failure_substatuses.join(",") } : {},
|
|
14850
14936
|
...product_ids?.length ? { product_ids: product_ids.join(",") } : {}
|
|
14851
14937
|
};
|
|
14852
14938
|
}
|
|
@@ -15778,6 +15864,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
15778
15864
|
SellToRestrictions,
|
|
15779
15865
|
Settings,
|
|
15780
15866
|
Settlement,
|
|
15867
|
+
ShopLabels,
|
|
15781
15868
|
Subscriptions,
|
|
15782
15869
|
UNKNOWN_SECTION_ORDER,
|
|
15783
15870
|
WCAG_AA_TEXT,
|