Xero-NetStandard icon indicating copy to clipboard operation
Xero-NetStandard copied to clipboard

AppStoreApi.GetSubscriptionAsync() does not support SIMPLE Product.Type

Open alvaromarithompson opened this issue 5 months ago • 3 comments

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:

  1. Create a pricing plan that contains "Simple" pricing on it.
  2. Subscribe to that plan via the App Store / Testing pages
  3. Programmatically call AppStoreApi.GetSubscriptionAsync().
  4. 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: image

Lack of definition of type "SIMPLE" in `Product.TypeEnum": image

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

alvaromarithompson avatar Sep 23 '24 13:09 alvaromarithompson