Skip to main content

Deduct Currency

Deducts the player's currency.

Call Information

CurrencySubtract(string currencyCode, long currencyAmount, PlayNANOODelegate callback) {}

Call Details

ParameterDescriptionType
currencyCodeCurrency codestring
currencyAmountCurrency amountstring
callbackCommunication resultPlayNANOODelegate

Source Code

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

void Awake()
{
plugin = Plugin.GetInstance();

string currencyCode = "string";
long currencyAmount = 0;
plugin.CurrencyManager.Subtract(currencyCode, currencyAmount, (status, errorMessage, jsonString, values) =>
{
if (status.Equals(Configure.PN_API_STATE_SUCCESS))
{
Debug.Log(values["amount"]);
}
else
{
Debug.Log("Fail");
}
});
}
}

Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"amount": 100
}

Response Details

Data KeyDescriptionType
amountCurrency helddouble