store.purchase() throws userdata.

I’m testing store.* in iOS.

If I called ‘store.purchase()’ method, it shows a transactionCallback like below.

Why is ‘transaction’ userdata? :slight_smile:

{ "name":"storeTransaction", "transaction":"\<type 'userdata' is not supported by JSON.\>" }

Userdata is a type returned from calls to C functions that returns an allocated C memory structure. It’s like a table with regards to being able to access it’s members as described here:

https://docs.coronalabs.com/api/library/store/event/storeTransaction/transaction.html

However, it looks like you’re trying to use JSON’s .prettify to print a table. The JSON library we use doesn’t know how to handle userdata.  Please refer to the documentation and print out the entries by hand.

Rob

Userdata is a type returned from calls to C functions that returns an allocated C memory structure. It’s like a table with regards to being able to access it’s members as described here:

https://docs.coronalabs.com/api/library/store/event/storeTransaction/transaction.html

However, it looks like you’re trying to use JSON’s .prettify to print a table. The JSON library we use doesn’t know how to handle userdata.  Please refer to the documentation and print out the entries by hand.

Rob