Skip to content

Commit

Permalink
Update all services (#1080)
Browse files Browse the repository at this point in the history
* false[adyen-sdk-automation] automated change

* removed tests for removed classes in service update

---------

Co-authored-by: Djoyke Reijans <[email protected]>
  • Loading branch information
AdyenAutomationBot and DjoykeAbyah authored Nov 5, 2024
1 parent ca50b28 commit 12d7af8
Show file tree
Hide file tree
Showing 42 changed files with 3,033 additions and 4,474 deletions.
7 changes: 0 additions & 7 deletions Adyen.IntegrationTest/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,6 @@ public Model.Checkout.PaymentRequest CreatePaymentRequestIDealCheckout()
return paymentsRequest;
}

protected Model.Checkout.PaymentSetupRequest CreatePaymentSessionRequest()
{
return new Model.Checkout.PaymentSetupRequest(merchantAccount: ClientConstants.MerchantAccount, reference: "MerchantReference", shopperLocale: "nl_NL",
channel: Model.Checkout.PaymentSetupRequest.ChannelEnum.Web, sdkVersion: "1.3.0",
amount: new Model.Checkout.Amount("EUR", 1200), returnUrl: @"https://www.yourshop.com/checkout/result", countryCode: "NL",shopperReference:"ShopperIdAlex");
}

protected Model.Payment.Card CreateTestCard()
{
return new Model.Payment.Card(number: "4111111111111111", expiryMonth: "03", expiryYear: "2030", cvc: "737",
Expand Down
11 changes: 1 addition & 10 deletions Adyen.IntegrationTest/CheckoutTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class CheckoutTest : BaseTest
private RecurringService _recurring;
private ModificationsService _modifications;
private PaymentLinksService _paymentLinksService;
private ClassicCheckoutSDKService _classicCheckoutSdkService;
private PaymentsService _paymentsService;
private static readonly string MerchantAccount = ClientConstants.MerchantAccount;

Expand All @@ -29,7 +28,7 @@ public void Init()
_recurring = new RecurringService(_client);
_modifications = new ModificationsService(_client);
_paymentLinksService = new PaymentLinksService(_client);
_classicCheckoutSdkService = new ClassicCheckoutSDKService(_client);
// _classicCheckoutSdkService = new ClassicCheckoutSDKService(_client);
_paymentsService = new PaymentsService(_client);
}

Expand Down Expand Up @@ -113,14 +112,6 @@ public void PaymentWithIdealTest()
Assert.AreEqual(paymentResponse.ResultCode, PaymentResponse.ResultCodeEnum.RedirectShopper);
}

[TestMethod]
public void PaymentSessionTest()
{
var paymentSessionRequest = CreatePaymentSessionRequest();
var paymentSessionResponse = _classicCheckoutSdkService.PaymentSession(paymentSessionRequest);
Assert.IsNotNull(paymentSessionResponse.PaymentSession);
}

[TestMethod]
public void PaymentLinksSuccessTest()
{
Expand Down
21 changes: 0 additions & 21 deletions Adyen.Test/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,27 +193,6 @@ protected Amount.PaymentMethodsRequest CreatePaymentMethodRequest(string merchan
return new Amount.PaymentMethodsRequest(merchantAccount: merchantAccount);
}

/// <summary>
/// Checkout paymentsessionRequest
/// </summary>
/// <returns></returns>
protected Amount.PaymentSetupRequest CreatePaymentSetupRequest()
{
return new Amount.PaymentSetupRequest(merchantAccount: "MerchantAccount", reference: "MerchantReference",
amount: new Model.Checkout.Amount("EUR", 1200), returnUrl: @"https://your-company.com/...", countryCode: "NL",
channel: Amount.PaymentSetupRequest.ChannelEnum.Web, sdkVersion: "1.3.0", captureDelayHours:0);
}

/// <summary>
/// Checkout paymentResultRequest
/// </summary>
/// <returns></returns>
protected Amount.PaymentVerificationRequest CreatePaymentVerificationRequest()
{
var payload = @"Ab0oCC2/wy96FiEMLvoI8RfayxEmZHQZcw...riRbNBzP3pQscLYBHN/MfZkgfGHdqy7JfQoQbRUmA==";
return new Amount.PaymentVerificationRequest(payload: payload);
}

#endregion

/// <summary>
Expand Down
107 changes: 0 additions & 107 deletions Adyen.Test/CheckoutTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,6 @@ public void Payments3DS2Test()
Assert.IsNotNull(paymentResponse.Action.GetCheckoutThreeDS2Action().PaymentData);
}

/// <summary>
/// Test 3ds success flow for
/// POST /payments/result
/// </summary>
[TestMethod]
public void PaymentsAuthorise3ds2ResultSuccessTest()
{
var paymentResultRequest = CreatePaymentVerificationRequest();
var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/threedsecure2/authorise3ds2-success.json");
var checkout = new ClassicCheckoutSDKService(client);
var paymentResultResponse = checkout.VerifyPaymentResult(paymentResultRequest);
Assert.IsNotNull(paymentResultResponse.AdditionalData);
Assert.AreEqual(paymentResultResponse.AdditionalData["cvcResult"], "1 Matches");
Assert.AreEqual(paymentResultResponse.MerchantReference, "your_merchantReference");
Assert.AreEqual(paymentResultResponse.ResultCode, PaymentVerificationResponse.ResultCodeEnum.Authorised);
}

/// <summary>
/// Test error flow for
/// POST /payments
Expand Down Expand Up @@ -402,96 +385,6 @@ public void PaymentMethodsWithoutBrandsTest()
Assert.AreEqual(paymentMethodsResponse.PaymentMethods.Count, 50);
}


/// <summary>
/// Test success flow for
/// POST /paymentSession
/// </summary>
[TestMethod]
public void PaymentSessionSuccessTest()
{
var paymentSessionRequest = CreatePaymentSetupRequest();
var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentsession-success.json");
var checkout = new ClassicCheckoutSDKService(client);
var paymentSessionResponse = checkout.PaymentSession(paymentSessionRequest);
Assert.IsNotNull(paymentSessionResponse.PaymentSession);
}

/// <summary>
/// Test success flow for async
/// POST /paymentSession
/// </summary>
[TestMethod]
public async Task PaymentSessionAsyncSuccessTest()
{
var paymentSetupRequest = CreatePaymentSetupRequest();
var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentsession-success.json");
var checkout = new ClassicCheckoutSDKService(client);
var paymentSetupResponse = await checkout.PaymentSessionAsync(paymentSetupRequest);
Assert.IsNotNull(paymentSetupResponse.PaymentSession);
}

/// <summary>
/// Test success flow for
/// POST /paymentSession
/// </summary>
[TestMethod]
public void PaymentSessionErrorTest()
{
var paymentSetupRequest = CreatePaymentSetupRequest();
var client =
CreateMockTestClientApiKeyBasedRequestAsync(
"mocks/checkout/paymentsession-error-invalid-data-422.json");
var checkout = new ClassicCheckoutSDKService(client);
var paymentSetupResponse = checkout.PaymentSession(paymentSetupRequest);
Assert.IsNull(paymentSetupResponse.PaymentSession);
}

/// <summary>
/// Test success flow for
/// POST /payments/result
/// </summary>
[TestMethod]
public void PaymentsResultSuccessTest()
{
var paymentResultRequest = CreatePaymentVerificationRequest();
var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentsresult-success.json");
var checkout = new ClassicCheckoutSDKService(client);
var paymentResultResponse = checkout.VerifyPaymentResult(paymentResultRequest);
Assert.AreEqual(paymentResultResponse.ResultCode, PaymentVerificationResponse.ResultCodeEnum.Authorised);
}

/// <summary>
/// Test success flow for async
/// POST /payments/result
/// </summary>
[TestMethod]
public async Task PaymentsResultAsyncSuccessTest()
{
var paymentVerificationRequest = CreatePaymentVerificationRequest();
var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentsresult-success.json");
var checkout = new ClassicCheckoutSDKService(client);
var paymentVerificationResponse = await checkout.VerifyPaymentResultAsync(paymentVerificationRequest);
Assert.AreEqual(paymentVerificationResponse.ResultCode,
PaymentVerificationResponse.ResultCodeEnum.Authorised);
}

/// <summary>
/// Test success flow for
/// POST /payments/result
/// </summary>
[TestMethod]
public void PaymentsResultErrorTest()
{
var paymentResultRequest = CreatePaymentVerificationRequest();
var client =
CreateMockTestClientApiKeyBasedRequestAsync(
"mocks/checkout/paymentsresult-error-invalid-data-payload-422.json");
var checkout = new ClassicCheckoutSDKService(client);
var paymentResultResponse = checkout.VerifyPaymentResult(paymentResultRequest);
Assert.IsNull(paymentResultResponse.ResultCode);
}

[TestMethod]
public void ApplicationInfoTest()
{
Expand Down
10 changes: 0 additions & 10 deletions Adyen.Test/ExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ public void TestDeviceRenderOptionsObjectListToString()
Assert.IsTrue(deviceRenderOptions.ToJson().Contains(expected));
}

[TestMethod]
public void TestToCollectionsStringEmpty()
{
var paymentVerificationResponse = new PaymentVerificationResponse(merchantReference: "ref",
shopperLocale: "NL",
additionalData: new Dictionary<string, string> { { "scaExemptionRequested", "lowValue" } });
var expected = "\"scaExemptionRequested\": \"lowValue\"";
Assert.IsTrue(paymentVerificationResponse.ToJson().Contains(expected));
}

[TestMethod]
public void TestPalLiveEndPoint()
{
Expand Down
167 changes: 0 additions & 167 deletions Adyen/Model/Checkout/Avs.cs

This file was deleted.

Loading

0 comments on commit 12d7af8

Please sign in to comment.