- Code: Select all
PlayerIO.Authenticate(
"MY GAME ID", //Your game id
"private", //Your connection id
new Dictionary<string, string> { //Authentication arguments
{"userToken", "Long-Long token"}
},
null, //PlayerInsight segments
delegate(Client client) {
client.Yahoo.Payments.ShowBuyCoinsDialog(
100, //coinamount
new Dictionary<string, string>() { //dialog arguments
{ "name", "100 Coins" },
{ "description", "100 Coins for your game!" },
{ "icon", "http://Adress_TO.pngImage" },
{ "currency", "usd"}
},
delegate(Dictionary<string, string> info) { //success callback
//Purchase completed
client.PayVault.Refresh(delegate() {
//Vault now contains the new balance
});
},
delegate(PlayerIOError error) { //error callback
//Purchase cancelled or failed
Debug.Log(error);
});
},
delegate(PlayerIOError error) {
//Error authenticating.
Debug.Log(error);
}
);
Error: "InvalidPurchaseArguments; You need to set up exchange rates in the admin panel to be able to buy coins through Yahoo!"
Read https://gamesnet.yahoo.net/forum/viewtopic.php?f=37&t=35022 But not understand. Where to insert the code segments are shown in the example, especially Http request? Could you suggest a full working code segment?