ConsumePeerCurrency
Consumes currency in a peer.
Service | Operation |
---|---|
product | CONSUME_PEER_VC |
Method Parameters
Parameter | Description |
---|---|
currencyType | Type of currency (Ex. ticket, tokens) |
amount | Currency amount to be consumed |
peer | Name of the peer |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code Only
// Cloud Code Only
// Cloud Code Only
// Cloud Code Only
// Cloud Code Only
// Cloud Code only. To view example, switch to the Cloud Code tab
var currencyType = "tokens";
var amount = 1;
var peer = "gameloot";
var productProxy = bridge.getProductServiceProxy();
var postResult = productProxy.consumePeerCurrency(currencyType, amount, peer);
if (postResult.status == 200) {
// Success!
}
{
"service": "product",
"operation": "CONSUME_PEER_VC",
"data": {
"vc_id": "tokens",
"vc_amount": 1,
"peer": "gameloot"
}
}