@delopay/sdk 0.265.0 → 0.267.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-SW4N2WY4.js → chunk-C7D3FUJ2.js} +225 -1
- package/dist/chunk-C7D3FUJ2.js.map +1 -0
- package/dist/index.cjs +225 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +481 -1
- package/dist/index.d.ts +481 -1
- package/dist/index.js +3 -1
- package/dist/internal.cjs +301 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +44 -3
- package/dist/internal.d.ts +44 -3
- package/dist/internal.js +79 -1
- package/dist/internal.js.map +1 -1
- package/package.json +18 -17
- package/dist/chunk-SW4N2WY4.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
BUILTIN_PAYMENT_ICON_KEYS: () => BUILTIN_PAYMENT_ICON_KEYS,
|
|
45
45
|
BuyerBlocklist: () => BuyerBlocklist,
|
|
46
46
|
BuyerConversations: () => BuyerConversations,
|
|
47
|
+
BuyerEvidenceReviews: () => BuyerEvidenceReviews,
|
|
47
48
|
CARD_FIELD_CHROMES: () => CARD_FIELD_CHROMES,
|
|
48
49
|
CARD_FIELD_FONT_SIZES: () => CARD_FIELD_FONT_SIZES,
|
|
49
50
|
CARD_FIELD_WEIGHTS: () => CARD_FIELD_WEIGHTS,
|
|
@@ -1918,6 +1919,23 @@ var Disputes = class {
|
|
|
1918
1919
|
async accept(disputeId) {
|
|
1919
1920
|
return this.request("POST", `/disputes/accept/${encodeURIComponent(disputeId)}`);
|
|
1920
1921
|
}
|
|
1922
|
+
/**
|
|
1923
|
+
* Correct the exchange rate of a dispute the processor reported in another
|
|
1924
|
+
* currency, or record its final settled amount. Until it is settled, the
|
|
1925
|
+
* reserved amount is an estimate and no other dispute on the same payment
|
|
1926
|
+
* attempt can take a new reservation. Signed-in users with the
|
|
1927
|
+
* external-record permission only.
|
|
1928
|
+
*
|
|
1929
|
+
* @param disputeId - The dispute to reconcile.
|
|
1930
|
+
* @param request - `correct_rate` with the processor's rate, or `settle`
|
|
1931
|
+
* with the final amount and a reason.
|
|
1932
|
+
* @returns The updated dispute.
|
|
1933
|
+
*/
|
|
1934
|
+
async reconcile(disputeId, request) {
|
|
1935
|
+
return this.request("POST", `/disputes/${encodeURIComponent(disputeId)}/reconcile`, {
|
|
1936
|
+
body: request
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1921
1939
|
/**
|
|
1922
1940
|
* Submit evidence to challenge a dispute.
|
|
1923
1941
|
*
|
|
@@ -5975,6 +5993,60 @@ var BuyerConversations = class {
|
|
|
5975
5993
|
}
|
|
5976
5994
|
};
|
|
5977
5995
|
|
|
5996
|
+
// src/resources/buyerEvidenceReviews.ts
|
|
5997
|
+
var BuyerEvidenceReviews = class {
|
|
5998
|
+
constructor(request) {
|
|
5999
|
+
this.request = request;
|
|
6000
|
+
}
|
|
6001
|
+
/**
|
|
6002
|
+
* The shop's cases with buyer evidence, the nearest target first.
|
|
6003
|
+
* `merchant_id` and `reviewer` are ignored here. `GET /buyer-evidence`
|
|
6004
|
+
*/
|
|
6005
|
+
async list(params) {
|
|
6006
|
+
return this.request("GET", "/buyer-evidence", {
|
|
6007
|
+
query: params
|
|
6008
|
+
});
|
|
6009
|
+
}
|
|
6010
|
+
/** One case's evidence with its history and files. `GET /buyer-evidence/{id}` */
|
|
6011
|
+
async retrieve(evidenceId) {
|
|
6012
|
+
return this.request("GET", `/buyer-evidence/${encodeURIComponent(evidenceId)}`);
|
|
6013
|
+
}
|
|
6014
|
+
/** Download a file of a case's evidence. */
|
|
6015
|
+
async downloadFile(evidenceId, fileId) {
|
|
6016
|
+
return this.request(
|
|
6017
|
+
"GET",
|
|
6018
|
+
`/buyer-evidence/${encodeURIComponent(evidenceId)}/files/${encodeURIComponent(fileId)}`,
|
|
6019
|
+
{ responseType: "blob" }
|
|
6020
|
+
);
|
|
6021
|
+
}
|
|
6022
|
+
/** Ask the buyer for more, by a cut-off. Refused once a result closed the review. */
|
|
6023
|
+
async requestInformation(evidenceId, params) {
|
|
6024
|
+
return this.request(
|
|
6025
|
+
"POST",
|
|
6026
|
+
`/buyer-evidence/${encodeURIComponent(evidenceId)}/information-requests`,
|
|
6027
|
+
{ body: params }
|
|
6028
|
+
);
|
|
6029
|
+
}
|
|
6030
|
+
/** An answer the buyer sees. */
|
|
6031
|
+
async reply(evidenceId, params) {
|
|
6032
|
+
return this.request("POST", `/buyer-evidence/${encodeURIComponent(evidenceId)}/replies`, {
|
|
6033
|
+
body: params
|
|
6034
|
+
});
|
|
6035
|
+
}
|
|
6036
|
+
/** Record the result, which closes the review. */
|
|
6037
|
+
async review(evidenceId, params) {
|
|
6038
|
+
return this.request("POST", `/buyer-evidence/${encodeURIComponent(evidenceId)}/reviews`, {
|
|
6039
|
+
body: params
|
|
6040
|
+
});
|
|
6041
|
+
}
|
|
6042
|
+
/** A note the shop's team and DeloPay read, never the buyer. */
|
|
6043
|
+
async note(evidenceId, params) {
|
|
6044
|
+
return this.request("POST", `/buyer-evidence/${encodeURIComponent(evidenceId)}/notes`, {
|
|
6045
|
+
body: params
|
|
6046
|
+
});
|
|
6047
|
+
}
|
|
6048
|
+
};
|
|
6049
|
+
|
|
5978
6050
|
// src/resources/checkoutRecovery.ts
|
|
5979
6051
|
var CheckoutRecovery = class {
|
|
5980
6052
|
constructor(request) {
|
|
@@ -7592,6 +7664,17 @@ var BuyerAccount = class {
|
|
|
7592
7664
|
async getSession(options) {
|
|
7593
7665
|
return this.request("GET", "/buyer-account/session", { ...options });
|
|
7594
7666
|
}
|
|
7667
|
+
/**
|
|
7668
|
+
* What the buyer is mailed about: a reply from a shop's team they have not
|
|
7669
|
+
* read, and news in their refund requests and disputes.
|
|
7670
|
+
*/
|
|
7671
|
+
async noticeSettings(options) {
|
|
7672
|
+
return this.request("GET", "/buyer-account/notice-settings", { ...options });
|
|
7673
|
+
}
|
|
7674
|
+
/** Turn either mail on or off for the buyer, at every shop. */
|
|
7675
|
+
async setNoticeSettings(params, options) {
|
|
7676
|
+
return this.request("PUT", "/buyer-account/notice-settings", { body: params, ...options });
|
|
7677
|
+
}
|
|
7595
7678
|
/** End the current session. */
|
|
7596
7679
|
async signOut(options) {
|
|
7597
7680
|
return this.request("DELETE", "/buyer-account/session", { ...options });
|
|
@@ -7726,6 +7809,78 @@ var BuyerAccount = class {
|
|
|
7726
7809
|
...options
|
|
7727
7810
|
});
|
|
7728
7811
|
}
|
|
7812
|
+
/**
|
|
7813
|
+
* A case's evidence: what may be handed in and by when, the files saved
|
|
7814
|
+
* and handed in, and what the reviewer said. Opened on the first read
|
|
7815
|
+
* while the case still waits.
|
|
7816
|
+
* The case is one of a confirmed record's, named by the `record` its
|
|
7817
|
+
* purchases carry and the case id the case list shows.
|
|
7818
|
+
*/
|
|
7819
|
+
async caseEvidence(record, caseId, options) {
|
|
7820
|
+
return this.request(
|
|
7821
|
+
"GET",
|
|
7822
|
+
`/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence`,
|
|
7823
|
+
{ ...options }
|
|
7824
|
+
);
|
|
7825
|
+
}
|
|
7826
|
+
/**
|
|
7827
|
+
* Upload a file for a case. It is saved, not handed in, until a
|
|
7828
|
+
* submission takes it. Uploading again with the same `clientUploadId`
|
|
7829
|
+
* returns the file the first upload stored, also after the cut-off.
|
|
7830
|
+
*/
|
|
7831
|
+
async uploadEvidenceFile(record, caseId, file, clientUploadId, options) {
|
|
7832
|
+
const { fileName, ...extras } = options ?? {};
|
|
7833
|
+
const form = new FormData();
|
|
7834
|
+
form.append("client_upload_id", clientUploadId);
|
|
7835
|
+
if (fileName === void 0) form.append("file", file);
|
|
7836
|
+
else form.append("file", file, fileName);
|
|
7837
|
+
return this.request(
|
|
7838
|
+
"POST",
|
|
7839
|
+
`/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files`,
|
|
7840
|
+
{ body: form, ...extras }
|
|
7841
|
+
);
|
|
7842
|
+
}
|
|
7843
|
+
/** Download a file of the case's evidence. */
|
|
7844
|
+
async downloadEvidenceFile(record, caseId, fileId, options) {
|
|
7845
|
+
return this.request(
|
|
7846
|
+
"GET",
|
|
7847
|
+
`/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
|
|
7848
|
+
{
|
|
7849
|
+
responseType: "blob",
|
|
7850
|
+
...options
|
|
7851
|
+
}
|
|
7852
|
+
);
|
|
7853
|
+
}
|
|
7854
|
+
/** Remove a saved file. A file a submission took stays. */
|
|
7855
|
+
async removeEvidenceFile(record, caseId, fileId, options) {
|
|
7856
|
+
return this.request(
|
|
7857
|
+
"DELETE",
|
|
7858
|
+
`/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
|
|
7859
|
+
{
|
|
7860
|
+
...options
|
|
7861
|
+
}
|
|
7862
|
+
);
|
|
7863
|
+
}
|
|
7864
|
+
/**
|
|
7865
|
+
* Hand in an explanation, saved files or both, while the buyer's window
|
|
7866
|
+
* is open. Sending again with the same `client_submission_id` returns the
|
|
7867
|
+
* submission the first send stored.
|
|
7868
|
+
*/
|
|
7869
|
+
async submitEvidence(record, caseId, params, options) {
|
|
7870
|
+
return this.request(
|
|
7871
|
+
"POST",
|
|
7872
|
+
`/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/submissions`,
|
|
7873
|
+
{ body: params, ...options }
|
|
7874
|
+
);
|
|
7875
|
+
}
|
|
7876
|
+
/** Ask for more time, once until the cut-off is next set. */
|
|
7877
|
+
async requestEvidenceExtension(record, caseId, params, options) {
|
|
7878
|
+
return this.request(
|
|
7879
|
+
"POST",
|
|
7880
|
+
`/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,
|
|
7881
|
+
{ body: params, ...options }
|
|
7882
|
+
);
|
|
7883
|
+
}
|
|
7729
7884
|
};
|
|
7730
7885
|
|
|
7731
7886
|
// src/resources/buyerPortal.ts
|
|
@@ -7744,6 +7899,74 @@ var BuyerPortal = class {
|
|
|
7744
7899
|
async listCases(options) {
|
|
7745
7900
|
return this.request("GET", "/buyer-portal/cases", { ...options });
|
|
7746
7901
|
}
|
|
7902
|
+
/**
|
|
7903
|
+
* A case's evidence: what may be handed in and by when, the files saved
|
|
7904
|
+
* and handed in, and what the reviewer said. Opened on the first read
|
|
7905
|
+
* while the case still waits.
|
|
7906
|
+
*/
|
|
7907
|
+
async caseEvidence(caseId, options) {
|
|
7908
|
+
return this.request("GET", `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence`, {
|
|
7909
|
+
...options
|
|
7910
|
+
});
|
|
7911
|
+
}
|
|
7912
|
+
/**
|
|
7913
|
+
* Upload a file for a case. It is saved, not handed in, until a
|
|
7914
|
+
* submission takes it. Uploading again with the same `clientUploadId`
|
|
7915
|
+
* returns the file the first upload stored, also after the cut-off.
|
|
7916
|
+
*/
|
|
7917
|
+
async uploadEvidenceFile(caseId, file, clientUploadId, options) {
|
|
7918
|
+
const { fileName, ...extras } = options ?? {};
|
|
7919
|
+
const form = new FormData();
|
|
7920
|
+
form.append("client_upload_id", clientUploadId);
|
|
7921
|
+
if (fileName === void 0) form.append("file", file);
|
|
7922
|
+
else form.append("file", file, fileName);
|
|
7923
|
+
return this.request(
|
|
7924
|
+
"POST",
|
|
7925
|
+
`/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files`,
|
|
7926
|
+
{ body: form, ...extras }
|
|
7927
|
+
);
|
|
7928
|
+
}
|
|
7929
|
+
/** Download a file of the case's evidence. */
|
|
7930
|
+
async downloadEvidenceFile(caseId, fileId, options) {
|
|
7931
|
+
return this.request(
|
|
7932
|
+
"GET",
|
|
7933
|
+
`/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
|
|
7934
|
+
{
|
|
7935
|
+
responseType: "blob",
|
|
7936
|
+
...options
|
|
7937
|
+
}
|
|
7938
|
+
);
|
|
7939
|
+
}
|
|
7940
|
+
/** Remove a saved file. A file a submission took stays. */
|
|
7941
|
+
async removeEvidenceFile(caseId, fileId, options) {
|
|
7942
|
+
return this.request(
|
|
7943
|
+
"DELETE",
|
|
7944
|
+
`/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
|
|
7945
|
+
{
|
|
7946
|
+
...options
|
|
7947
|
+
}
|
|
7948
|
+
);
|
|
7949
|
+
}
|
|
7950
|
+
/**
|
|
7951
|
+
* Hand in an explanation, saved files or both, while the buyer's window
|
|
7952
|
+
* is open. Sending again with the same `client_submission_id` returns the
|
|
7953
|
+
* submission the first send stored.
|
|
7954
|
+
*/
|
|
7955
|
+
async submitEvidence(caseId, params, options) {
|
|
7956
|
+
return this.request(
|
|
7957
|
+
"POST",
|
|
7958
|
+
`/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/submissions`,
|
|
7959
|
+
{ body: params, ...options }
|
|
7960
|
+
);
|
|
7961
|
+
}
|
|
7962
|
+
/** Ask for more time, once until the cut-off is next set. */
|
|
7963
|
+
async requestEvidenceExtension(caseId, params, options) {
|
|
7964
|
+
return this.request(
|
|
7965
|
+
"POST",
|
|
7966
|
+
`/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,
|
|
7967
|
+
{ body: params, ...options }
|
|
7968
|
+
);
|
|
7969
|
+
}
|
|
7747
7970
|
/**
|
|
7748
7971
|
* The buyer's conversations with the shop, the latest message first. A
|
|
7749
7972
|
* portal link for the whole merchant lists one per shop and mode.
|
|
@@ -8906,6 +9129,7 @@ var Delopay = class {
|
|
|
8906
9129
|
this.sellToRestrictions = new SellToRestrictions(request);
|
|
8907
9130
|
this.buyerBlocklist = new BuyerBlocklist(request);
|
|
8908
9131
|
this.buyerConversations = new BuyerConversations(request);
|
|
9132
|
+
this.buyerEvidence = new BuyerEvidenceReviews(request);
|
|
8909
9133
|
this.checkoutRecovery = new CheckoutRecovery(request);
|
|
8910
9134
|
this.costRules = new CostRules(request);
|
|
8911
9135
|
this.externalRecords = new ExternalRecords(request);
|
|
@@ -13726,6 +13950,7 @@ var encodeNativePanes = encodePanes;
|
|
|
13726
13950
|
BUILTIN_PAYMENT_ICON_KEYS,
|
|
13727
13951
|
BuyerBlocklist,
|
|
13728
13952
|
BuyerConversations,
|
|
13953
|
+
BuyerEvidenceReviews,
|
|
13729
13954
|
CARD_FIELD_CHROMES,
|
|
13730
13955
|
CARD_FIELD_FONT_SIZES,
|
|
13731
13956
|
CARD_FIELD_WEIGHTS,
|