Error in SDK when adding custom data to virtual purchase

When I add any form of custom data to a virtual purchase item in my config the SDK gives me a parse exception:

JsonReaderException: Unexpected character encountered while parsing value: {. Path 'customData', line 1, position 159. 

I can have custom data on inventory items but for some reason not on virtual purchases is this a known limitation not mentioned in the docs or a bug? I am using Unity 2021.3.15f1 with economy 3.0.0

Hi @jromin_1

Thanks for sharing that with us. I have been able to reproduce this issue with Economy 3.1.0. The exception you shared appears to occur when the new EconomyService.Instance.Configuration.SyncConfigurationAsync(); method is called if there are any VirtualPurchases containing Custom Data in the configuration.

As far as I can see at this point, the only workarounds are likely to be :
a) remove any Custom Data from virtual purchase objects
or
b) revert to one of the v2 Economy SDK packages (although there were some different configurtation / caching issues with those versions)

I have raised a ticket with the Economy SDK engineering team and will respond here when I have any information or alternate workarounds.

Apologies for the inconveniemce.

Thank you for confirming the bug, I have done a workaround by adding my custom data on the inventory items that the purchase will reward instead not ideal but good enough for now.

Hey, I was wondering if there are any updates regarding the bug? I am also currently facing the same issue and would like to know if there are any other workarounds except the above mentioned

Hi @nikhil_mane

I’m sorry to hear that you are also running into an issue due to the same bug. We have a fix scheduled to go out with the next Economy package update, we are just waiting for package approval. However, I’m afraid I can’t provide an ETA as the package manager approval process is quite rigorous.