connect-sdk-nodejs 5.7.0 → 6.0.1
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/lib/utils/headers.js +1 -1
- package/lib/v1/captures/dispute.d.ts +3 -0
- package/lib/v1/captures/dispute.js +32 -0
- package/lib/v1/captures/dispute.js.map +1 -0
- package/lib/v1/captures/disputes.d.ts +3 -0
- package/lib/v1/captures/disputes.js +20 -0
- package/lib/v1/captures/disputes.js.map +1 -0
- package/lib/v1/captures/index.js +5 -1
- package/lib/v1/captures/index.js.map +1 -1
- package/lib/v1/model/captures/index.d.ts +9 -1
- package/lib/v1/model/domain/index.d.ts +14 -0
- package/lib/v1/model/payments/index.d.ts +4 -1
- package/lib/v1/payments/get.d.ts +3 -2
- package/lib/v1/payments/get.js.map +1 -1
- package/package.json +2 -2
package/lib/utils/headers.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.date = date;
|
|
|
9
9
|
function serverMetaInfo(sdkContext) {
|
|
10
10
|
const info = {
|
|
11
11
|
sdkCreator: "Worldline",
|
|
12
|
-
sdkIdentifier: "NodejsServerSDK/
|
|
12
|
+
sdkIdentifier: "NodejsServerSDK/v6.0.1",
|
|
13
13
|
platformIdentifier: `${process.env["OS"]} Node.js/${process.versions.node}`,
|
|
14
14
|
integrator: sdkContext.getIntegrator()
|
|
15
15
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PaymentContext, SdkContext, SdkResponse } from "../../model";
|
|
2
|
+
import { CreateDisputeRequest, DisputeResponse, ErrorResponse } from "../model/domain";
|
|
3
|
+
export declare function dispute(sdkContext: SdkContext): (merchantId: string, captureId: string, postData: CreateDisputeRequest, paymentContext?: PaymentContext | null) => Promise<SdkResponse<DisputeResponse, ErrorResponse>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dispute = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* This file was auto-generated from the API references found at
|
|
6
|
+
* https://apireference.connect.worldline-solutions.com/
|
|
7
|
+
*/
|
|
8
|
+
const jsonschema_1 = require("jsonschema");
|
|
9
|
+
const communicator_1 = require("../../utils/communicator");
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
11
|
+
const requestSchema = require("../../../schemas/v1/CreateDisputeRequest.json");
|
|
12
|
+
function dispute(sdkContext) {
|
|
13
|
+
return function (merchantId, captureId, postData, paymentContext) {
|
|
14
|
+
// validate postData
|
|
15
|
+
const isValidRequest = (0, jsonschema_1.validate)(postData, requestSchema);
|
|
16
|
+
if (!isValidRequest.valid) {
|
|
17
|
+
const logger = sdkContext.getLogger();
|
|
18
|
+
if (sdkContext.isLoggingEnabled()) {
|
|
19
|
+
logger("error", isValidRequest.errors);
|
|
20
|
+
}
|
|
21
|
+
throw new Error(isValidRequest.errors.toString());
|
|
22
|
+
}
|
|
23
|
+
return (0, communicator_1.json)({
|
|
24
|
+
method: "POST",
|
|
25
|
+
modulePath: `/v1/${merchantId}/captures/${captureId}/dispute`,
|
|
26
|
+
body: postData,
|
|
27
|
+
paymentContext: paymentContext
|
|
28
|
+
}, sdkContext);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
exports.dispute = dispute;
|
|
32
|
+
//# sourceMappingURL=dispute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispute.js","sourceRoot":"","sources":["../../../src/v1/captures/dispute.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2CAAsC;AACtC,2DAAgD;AAIhD,8DAA8D;AAC9D,MAAM,aAAa,GAAG,OAAO,CAAC,+CAA+C,CAAC,CAAC;AAE/E,SAAgB,OAAO,CACrB,UAAsB;IAEtB,OAAO,UAAS,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc;QAC7D,oBAAoB;QACpB,MAAM,cAAc,GAAG,IAAA,qBAAQ,EAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACzD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE;YACzB,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;YACtC,IAAI,UAAU,CAAC,gBAAgB,EAAE,EAAE;gBACjC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;aACxC;YACD,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;SACnD;QACD,OAAO,IAAA,mBAAI,EACT;YACE,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,OAAO,UAAU,aAAa,SAAS,UAAU;YAC7D,IAAI,EAAE,QAAQ;YACd,cAAc,EAAE,cAAc;SAC/B,EACD,UAAU,CAC6C,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC;AAvBD,0BAuBC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PaymentContext, SdkContext, SdkResponse } from "../../model";
|
|
2
|
+
import { DisputesResponse, ErrorResponse } from "../model/domain";
|
|
3
|
+
export declare function disputes(sdkContext: SdkContext): (merchantId: string, captureId: string, paymentContext?: PaymentContext | null) => Promise<SdkResponse<DisputesResponse, ErrorResponse>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.disputes = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* This file was auto-generated from the API references found at
|
|
6
|
+
* https://apireference.connect.worldline-solutions.com/
|
|
7
|
+
*/
|
|
8
|
+
const communicator_1 = require("../../utils/communicator");
|
|
9
|
+
function disputes(sdkContext) {
|
|
10
|
+
return function (merchantId, captureId, paymentContext) {
|
|
11
|
+
return (0, communicator_1.json)({
|
|
12
|
+
method: "GET",
|
|
13
|
+
modulePath: `/v1/${merchantId}/captures/${captureId}/disputes`,
|
|
14
|
+
body: null,
|
|
15
|
+
paymentContext: paymentContext
|
|
16
|
+
}, sdkContext);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
exports.disputes = disputes;
|
|
20
|
+
//# sourceMappingURL=disputes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disputes.js","sourceRoot":"","sources":["../../../src/v1/captures/disputes.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2DAAgD;AAIhD,SAAgB,QAAQ,CACtB,UAAsB;IAEtB,OAAO,UAAS,UAAU,EAAE,SAAS,EAAE,cAAc;QACnD,OAAO,IAAA,mBAAI,EACT;YACE,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,OAAO,UAAU,aAAa,SAAS,WAAW;YAC9D,IAAI,EAAE,IAAI;YACV,cAAc,EAAE,cAAc;SAC/B,EACD,UAAU,CAC8C,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC;AAdD,4BAcC"}
|
package/lib/v1/captures/index.js
CHANGED
|
@@ -7,10 +7,14 @@ exports.newCapturesClient = void 0;
|
|
|
7
7
|
*/
|
|
8
8
|
const get_1 = require("./get");
|
|
9
9
|
const refund_1 = require("./refund");
|
|
10
|
+
const disputes_1 = require("./disputes");
|
|
11
|
+
const dispute_1 = require("./dispute");
|
|
10
12
|
function newCapturesClient(sdkContext) {
|
|
11
13
|
return {
|
|
12
14
|
get: (0, get_1.get)(sdkContext),
|
|
13
|
-
refund: (0, refund_1.refund)(sdkContext)
|
|
15
|
+
refund: (0, refund_1.refund)(sdkContext),
|
|
16
|
+
disputes: (0, disputes_1.disputes)(sdkContext),
|
|
17
|
+
dispute: (0, dispute_1.dispute)(sdkContext)
|
|
14
18
|
};
|
|
15
19
|
}
|
|
16
20
|
exports.newCapturesClient = newCapturesClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/captures/index.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+BAA4B;AAC5B,qCAAkC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/captures/index.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+BAA4B;AAC5B,qCAAkC;AAClC,yCAAsC;AACtC,uCAAoC;AAIpC,SAAgB,iBAAiB,CAAC,UAAsB;IACtD,OAAO;QACL,GAAG,EAAE,IAAA,SAAG,EAAC,UAAU,CAAC;QACpB,MAAM,EAAE,IAAA,eAAM,EAAC,UAAU,CAAC;QAC1B,QAAQ,EAAE,IAAA,mBAAQ,EAAC,UAAU,CAAC;QAC9B,OAAO,EAAE,IAAA,iBAAO,EAAC,UAAU,CAAC;KAC7B,CAAC;AACJ,CAAC;AAPD,8CAOC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PaymentContext, SdkResponse } from "../../../model/types";
|
|
2
|
-
import { CaptureResponse, ErrorResponse, RefundErrorResponse, RefundRequest, RefundResponse } from "../domain";
|
|
2
|
+
import { CaptureResponse, CreateDisputeRequest, DisputeResponse, DisputesResponse, ErrorResponse, RefundErrorResponse, RefundRequest, RefundResponse } from "../domain";
|
|
3
3
|
export interface CapturesClient {
|
|
4
4
|
/**
|
|
5
5
|
* Resource /{merchantId}/captures/{captureId} - <a href="https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/nodejs/captures/get.html">Get capture</a>
|
|
@@ -9,4 +9,12 @@ export interface CapturesClient {
|
|
|
9
9
|
* Resource /{merchantId}/captures/{captureId}/refund - <a href="https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/nodejs/captures/refund.html">Create Refund</a>
|
|
10
10
|
*/
|
|
11
11
|
refund(merchantId: string, captureId: string, postData: RefundRequest, paymentContext?: PaymentContext | null): Promise<SdkResponse<RefundResponse, RefundErrorResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Resource /{merchantId}/captures/{captureId}/disputes - <a href="https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/nodejs/captures/disputes.html">Get disputes</a>
|
|
14
|
+
*/
|
|
15
|
+
disputes(merchantId: string, captureId: string, paymentContext?: PaymentContext | null): Promise<SdkResponse<DisputesResponse, ErrorResponse>>;
|
|
16
|
+
/**
|
|
17
|
+
* Resource /{merchantId}/captures/{captureId}/dispute - <a href="https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/nodejs/captures/dispute.html">Create dispute</a>
|
|
18
|
+
*/
|
|
19
|
+
dispute(merchantId: string, captureId: string, postData: CreateDisputeRequest, paymentContext?: PaymentContext | null): Promise<SdkResponse<DisputeResponse, ErrorResponse>>;
|
|
12
20
|
}
|
|
@@ -835,6 +835,7 @@ export interface DisplayedData {
|
|
|
835
835
|
showData?: KeyValuePair[] | null;
|
|
836
836
|
}
|
|
837
837
|
export interface Dispute {
|
|
838
|
+
captureId?: string | null;
|
|
838
839
|
disputeOutput?: DisputeOutput | null;
|
|
839
840
|
id?: string | null;
|
|
840
841
|
paymentId?: string | null;
|
|
@@ -1569,8 +1570,19 @@ export interface PaymentErrorResponse {
|
|
|
1569
1570
|
errors?: APIError[] | null;
|
|
1570
1571
|
paymentResult?: CreatePaymentResult | null;
|
|
1571
1572
|
}
|
|
1573
|
+
export interface PaymentOperation {
|
|
1574
|
+
amountOfMoney?: AmountOfMoney | null;
|
|
1575
|
+
id?: string | null;
|
|
1576
|
+
status?: string | null;
|
|
1577
|
+
timestamp?: string | null;
|
|
1578
|
+
type?: string | null;
|
|
1579
|
+
}
|
|
1572
1580
|
export interface PaymentOutput extends OrderOutput {
|
|
1581
|
+
amountCaptureRequested?: number | null;
|
|
1582
|
+
amountCaptured?: number | null;
|
|
1573
1583
|
amountPaid?: number | null;
|
|
1584
|
+
amountRefundRequested?: number | null;
|
|
1585
|
+
amountRefunded?: number | null;
|
|
1574
1586
|
amountReversed?: number | null;
|
|
1575
1587
|
bankTransferPaymentMethodSpecificOutput?: BankTransferPaymentMethodSpecificOutput | null;
|
|
1576
1588
|
cardPaymentMethodSpecificOutput?: CardPaymentMethodSpecificOutput | null;
|
|
@@ -1579,6 +1591,7 @@ export interface PaymentOutput extends OrderOutput {
|
|
|
1579
1591
|
eInvoicePaymentMethodSpecificOutput?: EInvoicePaymentMethodSpecificOutput | null;
|
|
1580
1592
|
invoicePaymentMethodSpecificOutput?: InvoicePaymentMethodSpecificOutput | null;
|
|
1581
1593
|
mobilePaymentMethodSpecificOutput?: MobilePaymentMethodSpecificOutput | null;
|
|
1594
|
+
operations?: PaymentOperation[] | null;
|
|
1582
1595
|
paymentMethod?: string | null;
|
|
1583
1596
|
redirectPaymentMethodSpecificOutput?: RedirectPaymentMethodSpecificOutput | null;
|
|
1584
1597
|
reversalReason?: string | null;
|
|
@@ -2275,6 +2288,7 @@ export interface ValueMappingElement {
|
|
|
2275
2288
|
}
|
|
2276
2289
|
export interface WebhooksEvent {
|
|
2277
2290
|
apiVersion?: string | null;
|
|
2291
|
+
capture?: CaptureResponse | null;
|
|
2278
2292
|
created?: string | null;
|
|
2279
2293
|
dispute?: DisputeResponse | null;
|
|
2280
2294
|
id?: string | null;
|
|
@@ -12,7 +12,7 @@ export interface PaymentsClient {
|
|
|
12
12
|
/**
|
|
13
13
|
* Resource /{merchantId}/payments/{paymentId} - <a href="https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/nodejs/payments/get.html">Get payment</a>
|
|
14
14
|
*/
|
|
15
|
-
get(merchantId: string, paymentId: string, paymentContext
|
|
15
|
+
get(merchantId: string, paymentId: string, paymentContext: GetPaymentParams): Promise<SdkResponse<PaymentResponse, ErrorResponse>>;
|
|
16
16
|
/**
|
|
17
17
|
* Resource /{merchantId}/payments/{paymentId}/complete - <a href="https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/nodejs/payments/complete.html">Complete payment</a>
|
|
18
18
|
*/
|
|
@@ -77,3 +77,6 @@ export interface FindPaymentsParams extends PaymentContext {
|
|
|
77
77
|
offset?: number;
|
|
78
78
|
limit?: number;
|
|
79
79
|
}
|
|
80
|
+
export interface GetPaymentParams extends PaymentContext {
|
|
81
|
+
returnOperations?: boolean;
|
|
82
|
+
}
|
package/lib/v1/payments/get.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SdkContext, SdkResponse } from "../../model";
|
|
2
2
|
import { ErrorResponse, PaymentResponse } from "../model/domain";
|
|
3
|
-
|
|
3
|
+
import { GetPaymentParams } from "../model/payments";
|
|
4
|
+
export declare function get(sdkContext: SdkContext): (merchantId: string, paymentId: string, paymentContext: GetPaymentParams) => Promise<SdkResponse<PaymentResponse, ErrorResponse>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/v1/payments/get.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2DAAgD;
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/v1/payments/get.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2DAAgD;AAKhD,SAAgB,GAAG,CAAC,UAAsB;IACxC,OAAO,UAAS,UAAU,EAAE,SAAS,EAAE,cAAc;QACnD,OAAO,IAAA,mBAAI,EACT;YACE,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,OAAO,UAAU,aAAa,SAAS,EAAE;YACrD,IAAI,EAAE,IAAI;YACV,cAAc,EAAE,cAAc;SAC/B,EACD,UAAU,CAC6C,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC;AAZD,kBAYC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "connect-sdk-nodejs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "SDK to communicate with the Worldline Global Collect platform using the Worldline Connect Server API",
|
|
5
5
|
"homepage": "https://github.com/Worldline-Global-Collect/connect-sdk-nodejs#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"dateformat": "^4.6.3",
|
|
34
|
-
"form-data": "^4.0.
|
|
34
|
+
"form-data": "^4.0.5",
|
|
35
35
|
"jsonschema": "^1.4.1",
|
|
36
36
|
"lodash": "^4.17.21",
|
|
37
37
|
"secure-compare": "^3.0.1",
|