コード例 #1
0
        public void RefundDetailsResponse()
        {
            var obj = new RefundDetailsResponse
            {
                CreditTransactionReference = "Lorum_636",
                CreditTransactionStatus    = "Lorum_830",
                DebitTransactionReference  = "Lorum_605",
                DebitTransactionStatus     = "Lorum_782",
                PurchaseId = "Lorum_513",
                RefundBic  = "Lorum_296",
                RefundIban = "Lorum_162",
                RefundName = "Lorum_400"
            };
            var deserialized = ConversionTest(obj);

            Assert.IsNotNull(deserialized);
            Assert.AreEqual(obj.CreditTransactionReference, deserialized.CreditTransactionReference);
            Assert.AreEqual(obj.CreditTransactionStatus, deserialized.CreditTransactionStatus);
            Assert.AreEqual(obj.DebitTransactionReference, deserialized.DebitTransactionReference);
            Assert.AreEqual(obj.DebitTransactionStatus, deserialized.DebitTransactionStatus);
            Assert.AreEqual(obj.PurchaseId, deserialized.PurchaseId);
            Assert.AreEqual(obj.RefundBic, deserialized.RefundBic);
            Assert.AreEqual(obj.RefundIban, deserialized.RefundIban);
            Assert.AreEqual(obj.RefundName, deserialized.RefundName);
        }
コード例 #2
0
        /// <summary>
        /// Reads the json.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="objectType">Type of the object.</param>
        /// <param name="existingValue">The existing value.</param>
        /// <param name="serializer">The serializer.</param>
        /// <returns></returns>
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var target = new RefundDetailsResponse();
            var token  = JToken.Load(reader);

            serializer.Populate(token.CreateReader(), target);
            return(target);
        }
コード例 #3
0
        public RefundDetailsResponse InsertUpdateRefundDetails
            ([FromBody] List <RefundDetails> refundDetailsList)
        {
            var ItReturnObj = _Kernel.Get <IITReturnDetailsBL>();
            var result      = new RefundDetailsResponse
            {
                IsSuccess = true
            };

            foreach (var item in refundDetailsList)
            {
                if (result.IsSuccess)
                {
                    item.Active = true;
                    result      = ItReturnObj.InsertUpdateRefundDetails(item);
                }
            }
            return(result);
        }