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());
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public bool Equals(RecurlyCredit credit)
 {
     return this.Id == credit.Id;
 }
Ejemplo n.º 5
0
 public bool Equals(RecurlyCredit credit)
 {
     return(this.Id == credit.Id);
 }