File tree Expand file tree Collapse file tree 5 files changed +29
-12
lines changed
src/CheckoutSdk/Issuing/Transactions/Responses Expand file tree Collapse file tree 5 files changed +29
-12
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public class Messages
1717
1818 public IndicatorType ? Indicator { get ; set ; }
1919
20- public string DeclinedReason { get ; set ; }
20+ public string DeclineReason { get ; set ; }
2121
2222 public long ? BillingAmount { get ; set ; }
2323
Original file line number Diff line number Diff line change 4141 <None Update =" Resources\KnetResponse.json" >
4242 <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
4343 </None >
44+ <None Update =" Resources\IssuingTransactionsDeclinedReason.json" >
45+ <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
46+ </None >
4447 </ItemGroup >
4548 <ItemGroup >
4649 <Content Include =" Resources\AppSettingsPreviousTest.json" >
Original file line number Diff line number Diff line change 66using Checkout . Issuing . Controls ;
77using Checkout . Issuing . Controls . Requests . Create ;
88using Checkout . Issuing . Controls . Responses . Create ;
9+ using Checkout . Issuing . Transactions . Responses ;
910using Checkout . Payments . Contexts ;
1011using Checkout . Payments . Response ;
1112using Checkout . Payments . Response . Source ;
@@ -119,6 +120,17 @@ public void ShouldDeserializeDefaultCardCTypeResponse()
119120 cardDetailsResponse . Type . ShouldBe ( CardType . Physical ) ;
120121 }
121122
123+ [ Fact ]
124+ public void ShouldDeserializeIssuingTransactionsDeclinedReasonResponse ( )
125+ {
126+ var fileContent = GetJsonFileContent ( "./Resources/IssuingTransactionsDeclinedReason.json" ) ;
127+ Messages messages =
128+ ( Messages ) new JsonSerializer ( ) . Deserialize ( fileContent ,
129+ typeof ( Messages ) ) ;
130+ messages . ShouldNotBeNull ( ) ;
131+ messages . DeclineReason . ShouldBe ( "velocity_reached" ) ;
132+ }
133+
122134 [ Fact ]
123135 public void ShouldDeserializeKnetResponse ( )
124136 {
Original file line number Diff line number Diff line change @@ -25,18 +25,8 @@ private async Task ShouldRequestCardMetadataForCardNumber()
2525 Source = new CardMetadataCardSource { Number = CardNumberConstant } ,
2626 Format = CardMetadataFormatType . Basic
2727 } ;
28- CardMetadataResponse response = await DefaultApi . MetadataClient ( ) . RequestCardMetadata ( request ) ;
2928
30- response . ShouldNotBeNull ( ) ;
31- response . Bin . ShouldBe ( TestCardSource . Visa . Number [ ..11 ] ) ;
32- response . Scheme . ShouldNotBeNull ( ) ;
33- response . CardType . ShouldBeOfType < CardMetadataType > ( ) ;
34- response . CardCategory . ShouldBeOfType < CardCategory > ( ) ;
35- response . IssuerCountry . ShouldBeOfType < CountryCode > ( ) ;
36- response . IssuerCountryName . ShouldNotBeNull ( ) ;
37- response . ProductId . ShouldNotBeNull ( ) ;
38- response . ProductType . ShouldNotBeNull ( ) ;
39- response . HttpStatusCode . ShouldBe ( 200 ) ;
29+ await MakeCardMetadataRequest ( request ) ;
4030 }
4131
4232 [ Fact ( Skip = "unavailable" ) ]
Original file line number Diff line number Diff line change 1+ {
2+ "id" : " msg_abatreternbygkaeqqter6gs4de" ,
3+ "initiator" : " cardholder" ,
4+ "type" : " authorization" ,
5+ "result" : " declined" ,
6+ "is_relayed" : false ,
7+ "indicator" : " normal_authorization" ,
8+ "decline_reason" : " velocity_reached" ,
9+ "billing_amount" : 1000056 ,
10+ "billing_currency" : " GBP" ,
11+ "created_on" : " 2025-04-07T11:48:57.0000000Z"
12+ }
You can’t perform that action at this time.
0 commit comments