/// <inheritdoc />
        /// <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>
        /// <exception cref="T:System.ArgumentException"></exception>
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            RefundDetailsRequest target;
            var token = JToken.Load(reader);

            switch (Enum.Parse(typeof(PaymentMethod), token["payment_method"].Value <string>()))
            {
            case PaymentMethod.AfterPay:
                target = new AfterPayRefundDetailsRequest();
                break;

            case PaymentMethod.DirectDebit:
                target = new DirectDebitRefundDetailsRequest();
                break;

            case PaymentMethod.iDEAL:
                target = new IdealRefundDetailsRequest();
                break;

            default:
                throw new ArgumentException();
            }

            serializer.Populate(token.CreateReader(), target);
            return(target);
        }
        public void IdealRefundDetailsRequest()
        {
            var obj          = new IdealRefundDetailsRequest();
            var deserialized = ConversionTest(obj);

            Assert.IsNotNull(deserialized);
            Assert.AreEqual(obj.Method, deserialized.Method);
        }