#brahn-subscriptions-list

1 messages · Page 1 of 1 (latest)

sage cypressBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

serene estuary
#

Hello can you send the text of the Stripe call that you are making and tell me what specifically is returning as null?

worthy marsh
#

Hello, yes

#
StripeConfiguration.ApiKey = ApiKey;

var service = new CustomerService();
var optionsFirst = new CustomerListOptions
{
    Limit = 100
};

List<Customer> customers = [];

string customersJson = string.Empty;

if (System.IO.File.Exists("customers.txt"))
{
    customersJson = System.IO.File.ReadAllText("customers.txt");
}

if (!string.IsNullOrWhiteSpace(customersJson))
{
    customers = JsonSerializer.Deserialize<List<Customer>>(customersJson);
}
else
{
    List<Customer> foundCustomers = [.. service.List(optionsFirst)];
    customers.AddRange(foundCustomers);

    while (foundCustomers.Count != 0)
    {
        var options = new CustomerListOptions
        {
            Limit = 100,
            StartingAfter = customers.Last().Id
        };

        foundCustomers = [.. service.List(options)];

        customers.AddRange(foundCustomers);

        Console.WriteLine($"Found {customers.Count} customers.");
    }

    customers = customers.Distinct().ToList();

    System.IO.File.WriteAllText("customers.txt", JsonSerializer.Serialize(customers));
}
serene estuary
#

And what is null?

worthy marsh
#

The customers are returning their values, but all subscriptions within the customers are null

#

Which they aren't

serene estuary
#

Or you could just list subscriptions without a customer filter and then iterate through the subscriptions to see which subscription is assosciated with what customer

worthy marsh
#

Oh, interesting

#

Gotcha, thanks I'll try that.