Interface URL address
Loading table...
Request parameter
Loading table...
Response parameter
Loading table...
Return description:
- When the player scores, the result is returned
When code=37124 is returned, that is, msg=amount transfer failed – deduction failed, and the score already exists in the player’s account, it is recommended to retry the transfer after the player is offline.
2. When the player is given a score, the result is returned
When code=37124 is returned, that is, msg=amount transfer failed – deduction failed, your company needs to deduct the player’s corresponding score. The score already exists in the player’s account, just log in again.
Request Example
public static void main(String[] args) {
String sn = "ld00";
String random = String.valueOf(System.currentTimeMillis());
String secretCode = "oOGKmN8zAycJtz9cYJQXr8ddMYQ=";
String longinId = "1105191506";
String amount = "100";
String digest = HashUtil.md5Hex(random+sn+longinId+amount+secretCode);
String url = "https://ae8855.feiyanma.com/mega-cloud/api/";
try {
Map<String, Object> params = new HashMap<String, Object>();
params.put("sn", sn);
params.put("loginId", longinId);
params.put("amount", amount);
params.put("random", random);
params.put("digest", digest);
String json = buildParams(params, "open.mega.balance.transfer");
String result = OkHttpUtils.post(url , json);
System.out.println(result);
} catch (Exception e) {
e.printStackTrace();
}
}
private static String buildParams(Map<String, Object> postData, String method) {
Map<String, Object> rpcMap = new HashMap<>();
rpcMap.put("jsonrpc", "2.0");
rpcMap.put("method", method);
rpcMap.put("params", postData);
rpcMap.put("id", SeqUUIDUtil.toSequenceUUID());
String param = JsonUtil.toJson(rpcMap);
return param;
}
Response Example
{
"id": "1deaf133-c579-400a-a3c2-e54123adb9ca",
"result": 100,
"error": null,
"jsonrpc": "2.0"
}