connect-sdk-nodejs 5.6.0 → 6.0.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/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 +18 -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 +1 -1
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.0",
|
|
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;
|
|
@@ -1661,6 +1674,9 @@ export interface PaymentProduct863ThirdPartyData {
|
|
|
1661
1674
|
signType?: string | null;
|
|
1662
1675
|
timeStamp?: string | null;
|
|
1663
1676
|
}
|
|
1677
|
+
export interface PaymentProduct866SpecificOutput {
|
|
1678
|
+
walletUsed?: string | null;
|
|
1679
|
+
}
|
|
1664
1680
|
export interface PaymentProductDisplayHints {
|
|
1665
1681
|
displayOrder?: number | null;
|
|
1666
1682
|
label?: string | null;
|
|
@@ -1881,6 +1897,7 @@ export interface RedirectPaymentMethodSpecificOutput extends AbstractPaymentMeth
|
|
|
1881
1897
|
paymentProduct806SpecificOutput?: PaymentProduct806SpecificOutput | null;
|
|
1882
1898
|
paymentProduct836SpecificOutput?: PaymentProduct836SpecificOutput | null;
|
|
1883
1899
|
paymentProduct840SpecificOutput?: PaymentProduct840SpecificOutput | null;
|
|
1900
|
+
paymentProduct866SpecificOutput?: PaymentProduct866SpecificOutput | null;
|
|
1884
1901
|
token?: string | null;
|
|
1885
1902
|
}
|
|
1886
1903
|
export interface RedirectPaymentProduct4101SpecificInput {
|
|
@@ -2271,6 +2288,7 @@ export interface ValueMappingElement {
|
|
|
2271
2288
|
}
|
|
2272
2289
|
export interface WebhooksEvent {
|
|
2273
2290
|
apiVersion?: string | null;
|
|
2291
|
+
capture?: CaptureResponse | null;
|
|
2274
2292
|
created?: string | null;
|
|
2275
2293
|
dispute?: DisputeResponse | null;
|
|
2276
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.0",
|
|
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": {
|