Interface URL address
Request parameter
Response parameter
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.
3. If an API timeout or an exception with an unspecified cause occurs, please use the relevant API to query the actual transfer result.
-> open.mega.balance.transfer.query You can retrieve the result using the filed bizId.
-> open.mega.balance.get Determine whether the balance transfer is normal based on the balance.
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"
}