mirror of
https://github.com/jlengrand/adyen-node-api-library.git
synced 2026-03-10 08:01:20 +00:00
removed applicationInfo from modification requests + updated isCI parameter for modification tests
This commit is contained in:
@@ -171,6 +171,7 @@ let modification: Modification;
|
||||
let scope: nock.Scope;
|
||||
const paymentPspReference = "863620292981235A";
|
||||
const invalidPaymentPspReference = "invalid_psp_reference";
|
||||
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
|
||||
|
||||
beforeEach((): void => {
|
||||
if (!nock.isActive()) {
|
||||
@@ -186,7 +187,7 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("Modification", (): void => {
|
||||
test.each([false, true])("should perform an amount update request, isMock: %p", async (isMock): Promise<void> => {
|
||||
test.each([isCI, true])("should perform an amount update request, isMock: %p", async (isMock): Promise<void> => {
|
||||
!isMock && nock.restore();
|
||||
const request = createAmountUpdateRequest();
|
||||
scope.post(`/payments/${paymentPspReference}/amountUpdates`)
|
||||
@@ -215,7 +216,7 @@ describe("Modification", (): void => {
|
||||
}
|
||||
});
|
||||
|
||||
test.each([false, true])("should perform a cancels request, isMock: %p", async (isMock): Promise<void> => {
|
||||
test.each([isCI, true])("should perform a cancels request, isMock: %p", async (isMock): Promise<void> => {
|
||||
!isMock && nock.restore();
|
||||
const request = createCancelsRequest();
|
||||
scope.post(`/payments/${paymentPspReference}/cancels`)
|
||||
@@ -242,7 +243,7 @@ describe("Modification", (): void => {
|
||||
}
|
||||
});
|
||||
|
||||
test.each([false, true])("should perform a standalone cancels request, isMock: %p", async (isMock): Promise<void> => {
|
||||
test.each([isCI, true])("should perform a standalone cancels request, isMock: %p", async (isMock): Promise<void> => {
|
||||
!isMock && nock.restore();
|
||||
const request = createStandaloneCancelsRequest();
|
||||
scope.post("/cancels")
|
||||
@@ -270,7 +271,7 @@ describe("Modification", (): void => {
|
||||
}
|
||||
});
|
||||
|
||||
test.each([false, true])("should perform a captures request, isMock: %p", async (isMock): Promise<void> => {
|
||||
test.each([isCI, true])("should perform a captures request, isMock: %p", async (isMock): Promise<void> => {
|
||||
!isMock && nock.restore();
|
||||
const request = createCapturesRequest();
|
||||
scope.post(`/payments/${paymentPspReference}/captures`)
|
||||
@@ -297,7 +298,7 @@ describe("Modification", (): void => {
|
||||
}
|
||||
});
|
||||
|
||||
test.each([false, true])("should perform a refunds request, isMock: %p", async (isMock): Promise<void> => {
|
||||
test.each([isCI, true])("should perform a refunds request, isMock: %p", async (isMock): Promise<void> => {
|
||||
!isMock && nock.restore();
|
||||
const request = createRefundsRequest();
|
||||
scope.post(`/payments/${paymentPspReference}/refunds`)
|
||||
@@ -324,7 +325,7 @@ describe("Modification", (): void => {
|
||||
}
|
||||
});
|
||||
|
||||
test.each([false, true])("should perform a reversals request, isMock: %p", async (isMock): Promise<void> => {
|
||||
test.each([isCI, true])("should perform a reversals request, isMock: %p", async (isMock): Promise<void> => {
|
||||
!isMock && nock.restore();
|
||||
const request = createReversalsRequest();
|
||||
scope.post(`/payments/${paymentPspReference}/reversals`)
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
import Client from "../client";
|
||||
import getJsonResponse from "../helpers/getJsonResponse";
|
||||
import Service from "../service";
|
||||
import setApplicationInfo from "../helpers/setApplicationInfo";
|
||||
import { ApplicationInfo } from "../typings/applicationInfo";
|
||||
import { IRequest } from "../typings/requestOptions";
|
||||
import AmountUpdates from "./resource/modification/amountUpdates";
|
||||
@@ -56,7 +55,7 @@ class Modification extends Service {
|
||||
const amountUpdates = new AmountUpdates(this, paymentPspReference);
|
||||
return getJsonResponse<CreatePaymentAmountUpdateRequest, PaymentAmountUpdateResource>(
|
||||
amountUpdates,
|
||||
setApplicationInfo(amountUpdatesRequest),
|
||||
amountUpdatesRequest,
|
||||
requestOptions
|
||||
);
|
||||
}
|
||||
@@ -68,7 +67,7 @@ class Modification extends Service {
|
||||
const cancelsStandalone = new CancelsStandalone(this);
|
||||
return getJsonResponse<CreateStandalonePaymentCancelRequest, StandalonePaymentCancelResource>(
|
||||
cancelsStandalone,
|
||||
setApplicationInfo(cancelsStandaloneRequest),
|
||||
cancelsStandaloneRequest,
|
||||
requestOptions
|
||||
);
|
||||
}
|
||||
@@ -81,7 +80,7 @@ class Modification extends Service {
|
||||
const cancels = new Cancels(this, paymentPspReference);
|
||||
return getJsonResponse<CreatePaymentCancelRequest, PaymentCancelResource>(
|
||||
cancels,
|
||||
setApplicationInfo(cancelsRequest),
|
||||
cancelsRequest,
|
||||
requestOptions
|
||||
);
|
||||
}
|
||||
@@ -94,7 +93,7 @@ class Modification extends Service {
|
||||
const captures = new Captures(this, paymentPspReference);
|
||||
return getJsonResponse<CreatePaymentCaptureRequest, PaymentCaptureResource>(
|
||||
captures,
|
||||
setApplicationInfo(capturesRequest),
|
||||
capturesRequest,
|
||||
requestOptions
|
||||
);
|
||||
}
|
||||
@@ -107,7 +106,7 @@ class Modification extends Service {
|
||||
const refunds = new Refunds(this, paymentPspReference);
|
||||
return getJsonResponse<CreatePaymentRefundRequest, PaymentRefundResource>(
|
||||
refunds,
|
||||
setApplicationInfo(refundsRequest),
|
||||
refundsRequest,
|
||||
requestOptions
|
||||
);
|
||||
}
|
||||
@@ -120,7 +119,7 @@ class Modification extends Service {
|
||||
const refunds = new Reversals(this, paymentPspReference);
|
||||
return getJsonResponse<CreatePaymentReversalRequest, PaymentReversalResource>(
|
||||
refunds,
|
||||
setApplicationInfo(reversalsRequest),
|
||||
reversalsRequest,
|
||||
requestOptions
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user