diff --git a/Adyen.EcommLibrary.Test/CloudApiPosRequestTest.cs b/Adyen.EcommLibrary.Test/CloudApiPosRequestTest.cs index b8af97d50..fcdd3fd0b 100644 --- a/Adyen.EcommLibrary.Test/CloudApiPosRequestTest.cs +++ b/Adyen.EcommLibrary.Test/CloudApiPosRequestTest.cs @@ -58,9 +58,8 @@ public void TestCloudApiTransactionStatusResponseSuccess() try { var transactionStatusResponse = (TransactionStatusResponse)saleToPoiResponse.MessagePayload; - var messagePayload = transactionStatusResponse.RepeatedMessageResponse.RepeatedResponseMessageBody.MessagePayload; - var messagePayloadResponse = (dynamic)messagePayload; - + var messagePayloadResponse = transactionStatusResponse.RepeatedMessageResponse.RepeatedResponseMessageBody.MessagePayload; + Assert.IsNotNull(saleToPoiResponse); Assert.AreEqual(saleToPoiResponse.MessageHeader.ServiceID, "35543420"); Assert.AreEqual(saleToPoiResponse.MessageHeader.SaleID, "TOSIM_1_1_6"); diff --git a/Adyen.EcommLibrary/CloudApiSerialization/SaleToPoiMessageSerializer.cs b/Adyen.EcommLibrary/CloudApiSerialization/SaleToPoiMessageSerializer.cs index b311770e5..77b7c6bbc 100644 --- a/Adyen.EcommLibrary/CloudApiSerialization/SaleToPoiMessageSerializer.cs +++ b/Adyen.EcommLibrary/CloudApiSerialization/SaleToPoiMessageSerializer.cs @@ -86,7 +86,7 @@ private object GetDeserializedRepeatedResponseMessagePayload(JToken saletoPoiMes var repeatedMessageResponse = saletoPoiMessageJtoken.ToString(); var repeatedMessage = saletoPoiMessageJtoken["TransactionStatusResponse"]["RepeatedMessageResponse"]["RepeatedResponseMessageBody"].ToString(); var objMessage = JObject.Parse(repeatedMessage); - + if (repeatedMessageResponse.Contains("CardAcquisitionResponse")) { return objMessage[repeatedMessageResponse].ToObject(); diff --git a/Adyen.EcommLibrary/Model/Nexo/RepeatedResponseMessageBody.cs b/Adyen.EcommLibrary/Model/Nexo/RepeatedResponseMessageBody.cs index b13ab5d96..2e544818f 100644 --- a/Adyen.EcommLibrary/Model/Nexo/RepeatedResponseMessageBody.cs +++ b/Adyen.EcommLibrary/Model/Nexo/RepeatedResponseMessageBody.cs @@ -19,6 +19,6 @@ public partial class RepeatedResponseMessageBody :IMessagePayload [System.Xml.Serialization.XmlElementAttribute("PaymentResponse", typeof(PaymentResponse), Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlElementAttribute("ReversalResponse", typeof(ReversalResponse), Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlElementAttribute("StoredValueResponse", typeof(StoredValueResponse), Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public object MessagePayload; + public dynamic MessagePayload; } } \ No newline at end of file