Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CheckoutSdk/Issuing/Transactions/Responses/Messages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Messages

public IndicatorType? Indicator { get; set; }

public string DeclinedReason { get; set; }
public string DeclineReason { get; set; }

public long? BillingAmount { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions test/CheckoutSdkTest/CheckoutSdkTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
<None Update="Resources\KnetResponse.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\IssuingTransactionsDeclinedReason.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\AppSettingsPreviousTest.json">
Expand Down
12 changes: 12 additions & 0 deletions test/CheckoutSdkTest/JsonSerializerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Checkout.Issuing.Controls;
using Checkout.Issuing.Controls.Requests.Create;
using Checkout.Issuing.Controls.Responses.Create;
using Checkout.Issuing.Transactions.Responses;
using Checkout.Payments.Contexts;
using Checkout.Payments.Response;
using Checkout.Payments.Response.Source;
Expand Down Expand Up @@ -119,6 +120,17 @@ public void ShouldDeserializeDefaultCardCTypeResponse()
cardDetailsResponse.Type.ShouldBe(CardType.Physical);
}

[Fact]
public void ShouldDeserializeIssuingTransactionsDeclinedReasonResponse()
{
var fileContent = GetJsonFileContent("./Resources/IssuingTransactionsDeclinedReason.json");
Messages messages =
(Messages)new JsonSerializer().Deserialize(fileContent,
typeof(Messages));
messages.ShouldNotBeNull();
messages.DeclineReason.ShouldBe("velocity_reached");
}

[Fact]
public void ShouldDeserializeKnetResponse()
{
Expand Down
12 changes: 1 addition & 11 deletions test/CheckoutSdkTest/Metadata/MetadataIntegrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,8 @@ private async Task ShouldRequestCardMetadataForCardNumber()
Source = new CardMetadataCardSource { Number = CardNumberConstant },
Format = CardMetadataFormatType.Basic
};
CardMetadataResponse response = await DefaultApi.MetadataClient().RequestCardMetadata(request);

response.ShouldNotBeNull();
response.Bin.ShouldBe(TestCardSource.Visa.Number[..11]);
response.Scheme.ShouldNotBeNull();
response.CardType.ShouldBeOfType<CardMetadataType>();
response.CardCategory.ShouldBeOfType<CardCategory>();
response.IssuerCountry.ShouldBeOfType<CountryCode>();
response.IssuerCountryName.ShouldNotBeNull();
response.ProductId.ShouldNotBeNull();
response.ProductType.ShouldNotBeNull();
response.HttpStatusCode.ShouldBe(200);
await MakeCardMetadataRequest(request);
}

[Fact(Skip = "unavailable")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "msg_abatreternbygkaeqqter6gs4de",
"initiator": "cardholder",
"type": "authorization",
"result": "declined",
"is_relayed": false,
"indicator": "normal_authorization",
"decline_reason": "velocity_reached",
"billing_amount": 1000056,
"billing_currency": "GBP",
"created_on": "2025-04-07T11:48:57.0000000Z"
}
Loading