Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialization error on Pricing plans with null Price per Unit or Flat Fee #1375

Closed
pat-eason opened this issue Nov 7, 2018 · 2 comments
Closed

Comments

@pat-eason
Copy link

Building out a test "create customer with subscription and products" method I kept getting a deserialization error when I would attempt to create a subscription with plans that had either nulls in the price per unit or flat fee. The UI allows for creating those kinds of plans and doesn't throw an error in that instance. However, if I change those values from null to 0 I can go through the process successfully.

It would appear that those fields need to be nullable.

image

Sample method:

// [...] abbreviated for brevity
// create subscription
var subscriptionItems = new List<SubscriptionItemOption>();
foreach (var product in configuration.DefaultSubscriptionProducts)
    subscriptionItems.Add(new SubscriptionItemOption {
        PlanId = product,
        Quantity = 0
    });
var subscription = subscriptionService.Create(new SubscriptionCreateOptions {
    CustomerId = customer.Id,
    Items = subscriptionItems,
    BillingCycleAnchor = beginningOfNextMonth.DateTime,
    Metadata = metadata,
});
// [...]

OS Version: Windows 10
.net Version: .net core 2.0
Stripe Version: 20.4.0

@ob-stripe
Copy link
Contributor

Hey @CoastalP47, thanks for the report. You are correct, this field should be nullable. We'll release a fix soon. Sorry for the inconvenience!

@ob-stripe
Copy link
Contributor

Fixed in 21.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants