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 1 year 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

PETOSS-594

github-actions[bot] avatar Sep 23 '24 13:09 github-actions[bot]

Thanks for raising an issue, a ticket has been created to track your request

github-actions[bot] avatar Sep 23 '24 13:09 github-actions[bot]

The above bug is really the same complaint as https://github.com/XeroAPI/Xero-NetStandard/issues/534 - New features are being introduced into core Xero products but their development team is not keeping the libraries up-to-date with their chosen enum mapping mechanism, thus causing things to break.

We've implemented a work around by not using the Xero.NetStandard library for retrieving subscriptions, instead relying on our own in-house REST library.

alvaromarithompson avatar Sep 23 '24 13:09 alvaromarithompson