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

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

Open
alvaromarithompson opened this issue Sep 23, 2024 · 3 comments

Comments

@alvaromarithompson
Copy link

alvaromarithompson commented Sep 23, 2024

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

Copy link

PETOSS-594

Copy link

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

@alvaromarithompson
Copy link
Author

The above bug is really the same complaint as #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.

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

1 participant