Xero-NetStandard
Xero-NetStandard copied to clipboard
AppStoreApi.GetSubscriptionAsync() does not support SIMPLE Product.Type
SDK you're using (please complete the following information):
- Version 9.0.0
Describe the bug When a subscription on the App Store contains a product whose pricing type is "Simple", retrieving any subscription that contains a product with "SIMPLE" pricing on it throws an exception on deserialization.
To Reproduce Steps to reproduce the behavior:
- Create a pricing plan that contains "Simple" pricing on it.
- Subscribe to that plan via the App Store / Testing pages
- Programmatically call
AppStoreApi.GetSubscriptionAsync()
. - An exception is thrown:
Xero.NetStandard.OAuth2.Client.ApiException: 'Error converting value "SIMPLE" to type 'Xero.NetStandard.OAuth2.Model.Appstore.Product+TypeEnum'. Path 'plans[1].subscriptionItems[1].product.type', line 1, position 1536.'
Expected behavior
The subscription should be returned containing the relevant subscription item that has product of type SIMPLE
Screenshots
App Store pricing type:
Lack of definition of type "SIMPLE" in `Product.TypeEnum":
Additional context
The lack of Product.TypeEnum.SIMPLE
can be seen at https://github.com/XeroAPI/Xero-NetStandard/blob/18684e235489c2c1acc2770b97e9583b064e788e/Xero.NetStandard.OAuth2/Model/Appstore/Product.cs#L38