I'm attempting to create a Virtual Good which gives the user some currency. I've specified it to be a Currency Pack. However a BuyVirtualGoodsRequest says I don't have enough currency...
This would be done via an app store purchase in production, but unfortunately my client has yet to provide me with his developer account details so I can start working on that side of things.
I attempted to test the iOSBuyGoodsRequest using some example receipt JSON I found online, but I get the following error:
"Can not deserialize instance of String out of START_OBJECT token"
Bryan, please see response to your other post. I had a quick look at your set up and you dont need to define the virtual goods. You can simply make currency 1 coins and currency 2 the XP. I have given you sample code to credit players with these currencies.
Let me know if you need any further help with this and I will mock something up for you.
Sorry for the delay in answering this. Anyway, I have had a look at your configuration. It seems you have now modified the 'price' of the 100k currency pack to be -10000 in Currency 1. Is this an intentional work around? When you execute BuyVirtualGoodsRequest this now credits the player with 10000.
Let me know. There are other ways to credit players with currency.
John.
B
Bryan Mackenzie
said
over 8 years ago
Hey John,
"There are other ways to credit players with currency."
Could you please provide some examples?
Customer Support
said
over 8 years ago
Answer
Bryan, please see response to your other post. I had a quick look at your set up and you dont need to define the virtual goods. You can simply make currency 1 coins and currency 2 the XP. I have given you sample code to credit players with these currencies.
Let me know if you need any further help with this and I will mock something up for you.
Regards,
John.
B
Bryan Mackenzie
said
over 8 years ago
Got it, thanks.
M
Mohamad Hindi
said
over 6 years ago
Hello, so how to credit player with currency? :)
Customer Support
said
over 6 years ago
Hi Mohamad,
You can credit a player in Cloud Code by using the following,
// you can credit any of the 1-6 currencies, currency 1 is credited here, the reason field is optional
Spark.getPlayer().credit1(10, "Reason");
Sorry i meant how to credit user using virtual good ( which will be purchased with real money)
Customer Support
said
over 6 years ago
Hi Mohamad,
To do this you would set up a Virtual Good as a Currency Pack. This good would then be linked to an external store by Product ID (these can be set in the VG config). So when the user buys this Virtual Good Currency Pack they are charged the price from the external store. The values in currencies 1-6 are what is awarded to the player when the pack is successfully purchased. Does that make sense ? You can read more about this here.
Lee Griffiths
Hello,
I'm attempting to create a Virtual Good which gives the user some currency. I've specified it to be a Currency Pack. However a BuyVirtualGoodsRequest says I don't have enough currency...
This would be done via an app store purchase in production, but unfortunately my client has yet to provide me with his developer account details so I can start working on that side of things.
I attempted to test the iOSBuyGoodsRequest using some example receipt JSON I found online, but I get the following error:
Bryan, please see response to your other post. I had a quick look at your set up and you dont need to define the virtual goods. You can simply make currency 1 coins and currency 2 the XP. I have given you sample code to credit players with these currencies.
Let me know if you need any further help with this and I will mock something up for you.
Regards,
John.
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Lee,
Sorry for the delay in answering this. Anyway, I have had a look at your configuration. It seems you have now modified the 'price' of the 100k currency pack to be -10000 in Currency 1. Is this an intentional work around? When you execute BuyVirtualGoodsRequest this now credits the player with 10000.
Let me know. There are other ways to credit players with currency.
John.
Bryan Mackenzie
Hey John,
"There are other ways to credit players with currency."
Could you please provide some examples?
Customer Support
Bryan, please see response to your other post. I had a quick look at your set up and you dont need to define the virtual goods. You can simply make currency 1 coins and currency 2 the XP. I have given you sample code to credit players with these currencies.
Let me know if you need any further help with this and I will mock something up for you.
Regards,
John.
Bryan Mackenzie
Got it, thanks.
Mohamad Hindi
Hello, so how to credit player with currency? :)
Customer Support
Hi Mohamad,
You can credit a player in Cloud Code by using the following,
You can read more about this here.
Thanks,
Liam
1 person likes this
Mohamad Hindi
Thank you :)
Mohamad Hindi
Sorry i meant how to credit user using virtual good ( which will be purchased with real money)
Customer Support
Hi Mohamad,
To do this you would set up a Virtual Good as a Currency Pack. This good would then be linked to an external store by Product ID (these can be set in the VG config). So when the user buys this Virtual Good Currency Pack they are charged the price from the external store. The values in currencies 1-6 are what is awarded to the player when the pack is successfully purchased. Does that make sense ? You can read more about this here.
Thanks,
Liam
Mohamad Hindi
Yes got you....thanks :)
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics