>
Opens confirmation for buy coins
| Name | Required | Type | Description |
|---|---|---|---|
| action | Y | String | action type |
| amount | Y | Integer | amount of operation |
| price | Y | Integer | price of operation |
| projectId | Y | Integer | ID of project |
| remoteIp | N | String | Remote ip of client |
| server | N | String | Name of server |
| characterName | N | String | Character of query |
| param1 | N | String | Custom param 1 |
| param2 | N | String | Custom param 2 |
| param3 | N | String | Custom param 3 |
Example of use
<script type="text/javascript">
window.addEventListener('message', function(data){
let response = data.data;
if (response.name === 'showBuyConfirmationResult'){
console.log(response.result);
}
})
</script>
<input onclick="GSAPI.UI.showBuyConfirmation(
'buy', //action
1, //amount
2, //price
123123, //projectId
'127.0.0.1', //remoteIp
'server-name', //server
'character-name', //characterName
'123', //param1
'222', //param2
'444' //param3
);" type="button" value="Show Buy Confirmation">Example of responses
Successful response
{
"success": true,
"code": 0,
"description": "OK",
"transactionId": "3020944",
"price": "2",
"balance": 716,
"param1": "123",
"param2": "222",
"param3": "444",
"sign": "ecc1f569460ae5ee609c8cb49ce5878f"
}
Failed response with incorrect project
Response will be without sign because we don't have key to sign in this case
{
"success": false,
"code": 8,
"description": "Wrong project Id",
"param1": "123",
"param2": "222",
"param3": "444"
}
Failed response with different reason
{
"success": false,
"code": 1,
"description": "Not enough money for purchase",
"transactionId": "3020945",
"price": "2",
"balance": 718,
"param1": "123",
"param2": "222",
"param3": "444",
"sign": "ecc1f569460ae5ee609c8cb49ce5878f"
}