Example #1
0
        public void CanFetchAndDeserializeCorrectly()
        {
            var expected = new[]
            {
                new PreAuthorizationResponse
                {
                    CreatedAt         = DateTimeOffset.Parse("2011-02-18T15:25:58Z"),
                    Currency          = "GBP",
                    Name              = "Variable Payments For Tennis Court Rental",
                    Description       = "You will be charged according to your monthly usage of the tennis courts",
                    ExpiresAt         = null,
                    Id                = "1234JKH8KLJ",
                    IntervalLength    = 1,
                    IntervalUnit      = "month",
                    MerchantId        = "WOQRUJU9OH2HH1",
                    Status            = "active",
                    RemainingAmount   = 65.0m,
                    NextIntervalStart = DateTimeOffset.Parse("2012-02-20T00:00:00Z"),
                    UserId            = "834JUH8KLJ",
                    MaxAmount         = 70.0m,
                    Uri               = "https://gocardless.com/api/v1/pre_authorizations/1609",
                    SubResourceUris   =
                    {
                        Bills = "https://gocardless.com/api/v1/merchants/WOQRUJU9OH2HH1/bills?source_id=1609"
                    }
                },
                new PreAuthorizationResponse
                {
                    CreatedAt         = DateTimeOffset.Parse("2011-02-18T15:25:58Z"),
                    Currency          = "GBP",
                    Name              = "Variable Payments For Tennis Court Rental",
                    Description       = "You will be charged according to your monthly usage of the tennis courts",
                    ExpiresAt         = null,
                    Id                = "1234JKH8KLJ",
                    IntervalLength    = 1,
                    IntervalUnit      = "month",
                    MerchantId        = "WOQRUJU9OH2HH2",
                    Status            = "active",
                    RemainingAmount   = 65.0m,
                    NextIntervalStart = DateTimeOffset.Parse("2012-02-20T00:00:00Z"),
                    UserId            = "834JUH8KLJ",
                    MaxAmount         = 70.0m,
                    Uri               = "https://gocardless.com/api/v1/pre_authorizations/1610",
                    SubResourceUris   =
                    {
                        Bills = "https://gocardless.com/api/v1/merchants/WOQRUJU9OH2HH1/bills?source_id=1610"
                    }
                },
            };

            DeepAssertHelper.AssertIEnumerableDeepEquality(expected, new ApiClient("asdf").GetMerchantPreAuthorizations("WOQRUJU9OH2HH1"));
        }
Example #2
0
        public void CanFetchAndDeserializeCorrectly()
        {
            var expected = new[]
            {
                new SubscriptionResponse
                {
                    Amount            = 44.0m,
                    IntervalLength    = 1,
                    IntervalUnit      = "month",
                    CreatedAt         = DateTimeOffset.Parse("2011-09-12T13:51:30Z"),
                    Currency          = "GBP",
                    Name              = "London Gym Membership",
                    Description       = "Entitles you to use all of the gyms around London",
                    ExpiresAt         = null,
                    NextIntervalStart = DateTimeOffset.Parse("2011-10-12T13:51:30Z"),
                    Id              = "AJKH638A99",
                    MerchantId      = "WOQRUJU9OH2HH1",
                    Status          = "active",
                    UserId          = "HJEH638AJD",
                    Uri             = "https://gocardless.com/api/v1/subscriptions/1580",
                    SubResourceUris =
                    {
                        Bills = "https://gocardless.com/api/v1/merchants/WOQRUJU9OH2HH1/bills?source_id=1580"
                    }
                }, new SubscriptionResponse
                {
                    Amount            = 44.0m,
                    IntervalLength    = 1,
                    IntervalUnit      = "month",
                    CreatedAt         = DateTimeOffset.Parse("2011-09-12T13:51:30Z"),
                    Currency          = "GBP",
                    Name              = "London Gym Membership",
                    Description       = "Entitles you to use all of the gyms around London",
                    ExpiresAt         = null,
                    NextIntervalStart = DateTimeOffset.Parse("2011-10-12T13:51:30Z"),
                    Id              = "AJKH638A9A",
                    MerchantId      = "WOQRUJU9OH2HH1",
                    Status          = "active",
                    UserId          = "HJEH638AJD",
                    Uri             = "https://gocardless.com/api/v1/subscriptions/1580",
                    SubResourceUris =
                    {
                        Bills = "https://gocardless.com/api/v1/merchants/WOQRUJU9OH2HH1/bills?source_id=1580"
                    }
                }
            };

            DeepAssertHelper.AssertIEnumerableDeepEquality(expected, new ApiClient("asdf").GetMerchantSubscriptions("WOQRUJU9OH2HH1"));
        }
Example #3
0
        public void CanFetchAndDeserializeCorrectly()
        {
            var expected = new[]
            {
                new BillResponse
                {
                    Amount         = 44.0m,
                    GocardlessFees = 0.44m,
                    PartnerFees    = 0m,
                    Currency       = "GBP",
                    CreatedAt      = DateTimeOffset.Parse("2011-11-04T21: 41: 25Z"),
                    Description    = "Month 2 payment",
                    Id             = "VZUG2SC3PRT5EM",
                    Name           = "Bill 2 for Subscription description",
                    PaidAt         = DateTimeOffset.Parse("2011-11-07T15: 00: 00Z"),
                    Status         = "paid",
                    MerchantId     = "WOQRUJU9OH2HH1",
                    UserId         = "FIVWCCVEST6S4D",
                    SourceType     = "subscription",
                    SourceId       = "YH1VEVQHYVB1UT",
                    Uri            = "https://gocardless.com/api/v1/bills/VZUG2SC3PRT5EM"
                },
                new BillResponse
                {
                    Amount         = 44.0m,
                    GocardlessFees = 0.44m,
                    PartnerFees    = 0m,
                    Currency       = "GBP",
                    CreatedAt      = DateTimeOffset.Parse("2011-11-04T21: 41: 25Z"),
                    Description    = "Month 2 payment",
                    Id             = "VZUG2SC3PRT5EN",
                    Name           = "Bill 2 for Subscription description",
                    PaidAt         = DateTimeOffset.Parse("2011-11-07T15: 00: 00Z"),
                    Status         = "paid",
                    MerchantId     = "WOQRUJU9OH2HH1",
                    UserId         = "FIVWCCVEST6S4D",
                    SourceType     = "subscription",
                    SourceId       = "YH1VEVQHYVB1UT",
                    Uri            = "https://gocardless.com/api/v1/bills/VZUG2SC3PRT5EM"
                }
            };

            DeepAssertHelper.AssertIEnumerableDeepEquality(expected, new ApiClient("asdf").GetMerchantBills("WOQRUJU9OH2HH1"));
        }
        public void CanFetchAndDeserializeCorrectly()
        {
            var expected = new[]
            {
                new UserResponse
                {
                    CreatedAt = DateTimeOffset.Parse("2011-11-18T17:06:15Z"),
                    Email     = "*****@*****.**",
                    Id        = "JKH8HGKL9H",
                    FirstName = "Frank",
                    LastName  = "Smith"
                },
                new UserResponse
                {
                    CreatedAt = DateTimeOffset.Parse("2011-11-19T14:16:15Z"),
                    Email     = "*****@*****.**",
                    Id        = "JKH8HGKL9I",
                    FirstName = "James",
                    LastName  = "Dean"
                }
            };

            DeepAssertHelper.AssertIEnumerableDeepEquality(expected, new ApiClient("asdf").GetMerchantUsers("WOQRUJU9OH2HH1"));
        }