GetAdjustments() публичный Метод

Gets all adjustments for this account, by type
public GetAdjustments ( Adjustment type = Adjustment.AdjustmentType.All, Adjustment state = Adjustment.AdjustmentState.Any ) : RecurlyList
type Adjustment Adjustment type to retrieve. Optional, default: All.
state Adjustment State of the Adjustments to retrieve. Optional, default: Any.
Результат RecurlyList
Пример #1
0
        public void ListAdjustmentsCredits()
        {
            Account acct = new Account(Factories.GetMockAccountName());
            acct.Create();

            Adjustment a = acct.CreateAdjustment("Charge", 3456, "USD", 1);
            a.Create();

            a = acct.CreateAdjustment("Credit", -3456, "USD", 1);
            a.Create();

            AdjustmentList adjustments = acct.GetAdjustments(Adjustment.AdjustmentType.credit);
            Assert.IsTrue(adjustments.Count == 1);
            Assert.AreEqual(adjustments[0].UnitAmountInCents, -3456);
        }
Пример #2
0
        public void ListAdjustments()
        {
            Account acct = new Account(Factories.GetMockAccountName());
            acct.Create();

            Adjustment a = acct.CreateAdjustment("Charge", 5000, "USD", 1);
            a.Create();

            a = acct.CreateAdjustment("Credit", -1492, "USD", 1);
            a.Create();

            acct.InvoicePendingCharges();

            AdjustmentList adjustments = acct.GetAdjustments();
            Assert.IsTrue(adjustments.Count == 2);
        }
Пример #3
0
        public void ListAdjustmentsCharges()
        {
            Account acct = new Account(Factories.GetMockAccountName());
            acct.Create();

            Adjustment a = acct.CreateAdjustment("Charge", 1234, "USD", 1);
            a.Create();

            a = acct.CreateAdjustment("Credit", -5678, "USD", 1);
            a.Create();

            acct.InvoicePendingCharges();

            AdjustmentList adjustments = acct.GetAdjustments(Adjustment.AdjustmentType.charge);
            Assert.IsTrue(adjustments.Count == 1);
            Assert.AreEqual(adjustments[0].UnitAmountInCents, 1234);
        }
Пример #4
0
        public void ListAdjustmentsPendingToInvoiced()
        {
            Account acct = new Account(Factories.GetMockAccountName());
            acct.Create();

            Adjustment a = acct.CreateAdjustment("Charge", 1234, "USD", 1);
            a.Create();

            a = acct.CreateAdjustment("Credit", -5678, "USD", 1);
            a.Create();

            AdjustmentList adjustments = acct.GetAdjustments(state: Adjustment.AdjustmentState.pending);
            Assert.IsTrue(adjustments.Count == 2);

            acct.InvoicePendingCharges();

            adjustments = acct.GetAdjustments(state: Adjustment.AdjustmentState.invoiced);
            Assert.IsTrue(adjustments.Count == 2);
        }