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

System.ArgumentException when parsing the test webhook payload #64

Open
osilvaa opened this issue Mar 11, 2024 · 1 comment
Open

System.ArgumentException when parsing the test webhook payload #64

osilvaa opened this issue Mar 11, 2024 · 1 comment

Comments

@osilvaa
Copy link

osilvaa commented Mar 11, 2024

Description of the Bug

I'm getting a System.ArgumentException when I read the Event object after serialization using either of the supported methods provided by the SDK.

var eventDto1 = ApiConfig.DeserializeObject<Event>(jsonString);
var eventDto2 = new Event(jsonString);

This is the error:

Property accessor 'Index' on object 'ChargeBee.Models.Subscription+SubscriptionShippingAddress' threw the following exception:'The property index is not present!'
System.Reflection.TargetInvocationException: Property accessor 'Index' on object 'ChargeBee.Models.Subscription+SubscriptionShippingAddress' threw the following exception:'The property index is not present!'
---> System.ArgumentException: The property index is not present!
at ChargeBee.Internal.Resource.ThrowIfKeyMissed(String key)
at ChargeBee.Internal.Resource.GetValue[T](String key, Boolean required)
at ChargeBee.Models.Subscription.SubscriptionShippingAddress.get_Index()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Steps to reproduce

Described above.

Expected Behavior

A shipping address with no index shouldn't throw an exception. Similarly, the test webhook function should provide a payload that doesn't throw exceptions when hooked up with the provided client.

In our context, we have interceptors that look into the object properties.

Code Snippets (if applicable)

No response

Operating System

Windows

Language version

.NET8

Library version

v3.0.0 and 3.15.0

Additional context

No response

Copy link

Hello @osilvaa, thank you for raising the issue. Your contribution is greatly appreciated and we look forward to addressing it.

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