Skip to content

Commit

Permalink
RepeatedResponseMessageBody payload is dyanamic
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrosMor committed Dec 28, 2018
1 parent ad03a56 commit 9918527
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Adyen.EcommLibrary.Test/CloudApiPosRequestTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CardAcquisitionResponse>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 9918527

Please sign in to comment.