Beispiel #1
0
        public void Refund(BankAccount bank)
        {
            var request = CreateRequest("POST", "/refund");

            request.Query = BuildQueryForKeys("bank_account", bank.ToDictionary(Base.SerializationType.Plain));

            ExecuteSelfRequest(request);
        }
Beispiel #2
0
        public void RefundWithSplit(int?amount, SplitRule[] split_rules, BankAccount bank = null)
        {
            var request = CreateRequest("POST", "/refund");

            if (bank != null)
            {
                request.Query = BuildQueryForKeys("bank_account", bank.ToDictionary(Base.SerializationType.Plain));
            }

            request.Body = "{\"split_rules\":" + JsonConvert.SerializeObject(split_rules.Select(s => s.ToDictionary(SerializationType.Plain)).ToList()) + "}";

            request.Query.Add(new Tuple <string, string>("amount", amount.Value.ToString()));

            ExecuteSelfRequest(request);
        }
Beispiel #3
0
        public void Refund(BankAccount bank, int?amount = null, bool asyncRefund = true)
        {
            var request = CreateRequest("POST", "/refund");

            request.Query = BuildQueryForKeys("bank_account", bank.ToDictionary(Base.SerializationType.Plain));

            if (amount.HasValue)
            {
                request.Query.Add(new Tuple <string, string>("amount", amount.Value.ToString()));
            }

            if (!asyncRefund)
            {
                request.Query.Add(new Tuple <string, string>("async", asyncRefund.ToString().ToLower()));
            }

            ExecuteSelfRequest(request);
        }
Beispiel #4
0
        public void Refund(BankAccount bank)
        {
            var request = CreateRequest("POST", "/refund");

            request.Query =  BuildQueryForKeys("bank_account", bank.ToDictionary(Base.SerializationType.Plain));

            ExecuteSelfRequest(request);
        }