@delopay/sdk 0.235.0 → 0.238.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-FRH5BWGL.js → chunk-H7EC7OQF.js} +62 -1
- package/dist/chunk-H7EC7OQF.js.map +1 -0
- package/dist/index.cjs +61 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +182 -1
- package/dist/index.d.ts +182 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +61 -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 +18 -17
- package/dist/chunk-FRH5BWGL.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -3227,6 +3227,44 @@ var Refunds = class {
|
|
|
3227
3227
|
return this.request("POST", "/refunds/list", { body: params });
|
|
3228
3228
|
}
|
|
3229
3229
|
// --- OLAP extensions (Task 4.3) ---
|
|
3230
|
+
/**
|
|
3231
|
+
* Refund requests buyers raised from the customer portal, newest first.
|
|
3232
|
+
* Limited to the caller's shop when the caller is scoped to one.
|
|
3233
|
+
* `GET /refund-requests`
|
|
3234
|
+
*/
|
|
3235
|
+
async listRequests(params) {
|
|
3236
|
+
return this.request("GET", "/refund-requests", {
|
|
3237
|
+
query: params
|
|
3238
|
+
});
|
|
3239
|
+
}
|
|
3240
|
+
/**
|
|
3241
|
+
* Approve a buyer's refund request with a refund of its payment that has
|
|
3242
|
+
* succeeded, made with `create()` after the buyer asked. Approving records
|
|
3243
|
+
* the decision and moves no money. A refund that is still `pending` or in
|
|
3244
|
+
* `review` is refused: check it again later with `retrieve()` under the same
|
|
3245
|
+
* refund ID and approve once it has succeeded, rather than creating another
|
|
3246
|
+
* refund. `POST /refund-requests/{id}/approve`
|
|
3247
|
+
*
|
|
3248
|
+
* @example
|
|
3249
|
+
* ```typescript
|
|
3250
|
+
* const refund = await delopay.refunds.create({ payment_id: request.payment_id, amount: request.amount });
|
|
3251
|
+
* if (refund.status === 'succeeded') {
|
|
3252
|
+
* await delopay.refunds.approveRequest(request.id, { refund_id: refund.refund_id });
|
|
3253
|
+
* }
|
|
3254
|
+
* // Otherwise keep refund.refund_id, check it with retrieve() and approve once it has succeeded.
|
|
3255
|
+
* ```
|
|
3256
|
+
*/
|
|
3257
|
+
async approveRequest(requestId, params) {
|
|
3258
|
+
return this.request("POST", `/refund-requests/${encodeURIComponent(requestId)}/approve`, {
|
|
3259
|
+
body: params
|
|
3260
|
+
});
|
|
3261
|
+
}
|
|
3262
|
+
/** Decline a buyer's refund request. The buyer sees the reply. `POST /refund-requests/{id}/decline` */
|
|
3263
|
+
async declineRequest(requestId, params) {
|
|
3264
|
+
return this.request("POST", `/refund-requests/${encodeURIComponent(requestId)}/decline`, {
|
|
3265
|
+
body: params
|
|
3266
|
+
});
|
|
3267
|
+
}
|
|
3230
3268
|
/** List refunds (profile-scoped). `POST /refunds/profile/list` */
|
|
3231
3269
|
async listByProfile(params) {
|
|
3232
3270
|
return this.request("POST", "/refunds/profile/list", { body: params });
|
|
@@ -6991,6 +7029,29 @@ var BuyerPortal = class {
|
|
|
6991
7029
|
async getSession(options) {
|
|
6992
7030
|
return this.request("GET", "/buyer-portal/session", { ...options });
|
|
6993
7031
|
}
|
|
7032
|
+
/** The buyer's contact and billing details, and what they may change. */
|
|
7033
|
+
async getProfile(options) {
|
|
7034
|
+
return this.request("GET", "/buyer-portal/profile", { ...options });
|
|
7035
|
+
}
|
|
7036
|
+
/**
|
|
7037
|
+
* Change the buyer's contact and billing details. Fields left out stay as
|
|
7038
|
+
* they are; the merchant decides whether buyers may change them at all.
|
|
7039
|
+
*/
|
|
7040
|
+
async updateProfile(params, options) {
|
|
7041
|
+
return this.request("POST", "/buyer-portal/profile", { body: params, ...options });
|
|
7042
|
+
}
|
|
7043
|
+
/**
|
|
7044
|
+
* Ask the shop for a refund of one of the buyer's purchases, named by its
|
|
7045
|
+
* `id` from `listPurchases()`. Nothing is refunded until the shop approves
|
|
7046
|
+
* the request with a refund.
|
|
7047
|
+
*/
|
|
7048
|
+
async createRefundRequest(purchaseId, params, options) {
|
|
7049
|
+
return this.request(
|
|
7050
|
+
"POST",
|
|
7051
|
+
`/buyer-portal/purchases/${encodeURIComponent(purchaseId)}/refund-requests`,
|
|
7052
|
+
{ body: params, ...options }
|
|
7053
|
+
);
|
|
7054
|
+
}
|
|
6994
7055
|
async listInvoices(params, options) {
|
|
6995
7056
|
return this.request("GET", "/buyer-portal/invoices", {
|
|
6996
7057
|
query: params,
|