public static RecurlyLineItem[] GetCredits(string accountCode)
        {
            RecurlyLineItemList creditList = new RecurlyLineItemList();

            HttpStatusCode statusCode = RecurlyClient.PerformRequest(RecurlyClient.HttpRequestMethod.Get,
                                                                     RecurlyCredit.CreditsUrl(accountCode),
                                                                     new RecurlyClient.ReadXmlDelegate(creditList.ReadXml));

            if (statusCode == HttpStatusCode.NotFound)
            {
                return(null);
            }

            return(creditList.ToArray());
        }
예제 #2
0
        public static RecurlyCredit CreditAccount(string accountCode, int amountInCents, string description)
        {
            RecurlyCredit credit = new RecurlyCredit();
            credit.AmountInCents = amountInCents;
            credit.StartDate = DateTime.UtcNow;
            credit.Description = description;

            /* HttpStatusCode statusCode = */
            RecurlyClient.PerformRequest(RecurlyClient.HttpRequestMethod.Post,
                CreditsUrl(accountCode),
                new RecurlyClient.WriteXmlDelegate(credit.WriteXml),
                null);

            return credit;
        }
예제 #3
0
        public static RecurlyCredit CreditAccount(string accountCode, int amountInCents, int quantity, string description)
        {
            RecurlyCredit credit = new RecurlyCredit();

            credit.AmountInCents = amountInCents;
            credit.Quantity      = quantity;
            credit.StartDate     = DateTime.UtcNow;
            credit.Description   = description;

            /* HttpStatusCode statusCode = */
            RecurlyClient.PerformRequest(RecurlyClient.HttpRequestMethod.Post,
                                         CreditsUrl(accountCode),
                                         new RecurlyClient.WriteXmlDelegate(credit.WriteXml),
                                         null);

            return(credit);
        }
예제 #4
0
 public bool Equals(RecurlyCredit credit)
 {
     return this.Id == credit.Id;
 }
예제 #5
0
 public bool Equals(RecurlyCredit credit)
 {
     return(this.Id == credit.Id);
 }