public virtual RecurringCharge UpdateRecurringCharge(string id, RecurringChargeOptions options)
        {
            var url      = string.Format("{0}/{1}", Urls.RecurringCharges, id);
            var response = Requestor.PutJson(url, ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(Mapper <RecurringCharge> .MapFromJson(response));
        }
Пример #2
0
        public virtual AchAccount UpdateAchAccount(string achAccountId, AchAccountOptions o)
        {
            var url      = string.Format("{0}/{1}", Urls.AchAccounts, achAccountId);
            var response = Requestor.PutJson(url, ParameterBuilder.BuildJsonPostParameters(o), SecretKey);

            return(Mapper <AchAccount> .MapFromJson(response));
        }
Пример #3
0
        public virtual Transaction Sign(string transactionId, SignatureOptions options)
        {
            var url      = string.Format("{0}/{1}/sign", Urls.Transactions, transactionId);
            var response = Requestor.PostJson(url, ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(TransactionMapper.MapFromJson(response));
        }
Пример #4
0
        public virtual Models.Merchant UpdateMerchant(MerchantOptions m)
        {
            var merchant = ParameterBuilder.BuildJsonPostParameters(m);
            var response = Requestor.PutJson(Urls.Merchant, merchant, SecretKey);

            return(Mapper <Models.Merchant> .MapFromJson(response));
        }
        public virtual RecurringCharge RecurringCharge(RecurringChargeOptions options)
        {
            var response = Requestor.PostJson(
                Urls.RecurringCharges,
                ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(Mapper <RecurringCharge> .MapFromJson(response));
        }
Пример #6
0
        public virtual Credit Credit(CreditOptions options)
        {
            var response = Requestor.PostJson(
                Urls.Credits,
                ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(Mapper <Credit> .MapFromJson(response));
        }
Пример #7
0
        public virtual Refund Refund(string chargeId, RefundOptions options)
        {
            var url = string.Format("{0}/{1}/refund", Urls.Charges, chargeId);

            var response = Requestor.PostJson(url, ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(Mapper <Refund> .MapFromJson(response));
        }
Пример #8
0
        public virtual Charge Capture(string chargeId, CaptureOptions options)
        {
            var url = string.Format("{0}/{1}/capture", Urls.Charges, chargeId);

            var response = Requestor.PostJson(url, ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(Mapper <Charge> .MapFromJson(response));
        }
Пример #9
0
        public virtual Bank CreateBank(object options)
        {
            var response = Requestor.PostJson(
                Urls.Banks,
                ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(Mapper <Bank> .MapFromJson(response));
        }
Пример #10
0
        public virtual Card CreateCard(object options)
        {
            var response = Requestor.PostJson(
                Urls.Cards,
                ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(Mapper <Card> .MapFromJson(response));
        }
Пример #11
0
        public virtual Charge Authorize(ChargeOptions options)
        {
            options.AutoCapture = false;

            var response = Requestor.PostJson(
                Urls.Charges,
                ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(Mapper <Charge> .MapFromJson(response));
        }
Пример #12
0
        public virtual Transaction Void(string transactionId, string reference = null)
        {
            var url       = string.Format("{0}/{1}/void", Urls.Transactions, transactionId);
            var reqparams = new Dictionary <string, string> {
                { "reference", reference }
            };
            var response = Requestor.PostJson(url,
                                              ParameterBuilder.BuildJsonPostParameters(reqparams), SecretKey);

            return(TransactionMapper.MapFromJson(response));
        }
Пример #13
0
        public virtual Charge Capture(string chargeId, int amountInCents, string reference = null)
        {
            var url = string.Format("{0}/{1}/capture", Urls.Charges, chargeId);

            var response = Requestor.PostJson(url,
                                              ParameterBuilder.BuildJsonPostParameters(new CaptureOptions()
            {
                AmountInCents = amountInCents,
                Reference     = reference
            }), SecretKey);

            return(Mapper <Charge> .MapFromJson(response));
        }
Пример #14
0
        public virtual Refund Refund(string chargeId, int?refundAmountInCents, string reference = null, object data = null)
        {
            var url = string.Format("{0}/{1}/refund", Urls.Charges, chargeId);

            var options = new RefundOptions
            {
                AmountInCents = refundAmountInCents,
                Reference     = reference,
                Data          = data
            };
            var response = Requestor.PostJson(url, ParameterBuilder.BuildJsonPostParameters(options), SecretKey);

            return(Mapper <Refund> .MapFromJson(response));
        }