免转钱包允许您的玩家通过他们在您网站上注册的帐户或信用游玩我们的所有产品。
如果您对此功能感兴趣,请联系我们获取进一步的帮助。
首先,我们将检查用户帐户的余额。我们将发出API请求,然后您接收到后应该将帐户余额发回给我们。
请参阅取得用户帐号余额
如果用户没有足够的余额,我们将不接受该投注。
如果用户有足够的余额来下注,我们会请您从用户帐户中扣除投注的金额。
请参阅扣除投注金额
我们会为您发送投注的结果。 请参阅 结算投注
如果我们回滚了赌注,我们将发送回滚请求通知您。请参阅 回滚
如果我们取消了赌注,我们将发送取消请求通知您。请参阅 取消投注
免转钱包API 2.0可以使用于利记所有的产品线中,如体育博彩,真人视讯及游戏等,同时也包含第三方的游戏(同时又名无缝游戏),而旧版本的免转钱包API只适用于体育博彩,真人视讯及游戏等,且无法支持第三方游戏的运作。
尽管所有的流程免转钱包2.0及旧版本的免转钱包都一样,但呼叫及回覆的参数仍有些许不同,因此您方在对接、使用时请特别留意,不要将新版本及旧版本的免转钱包混用,此举动将会让服务无法正常营运。
根据上述所言,因此我司强烈建议贵司在对接时,使用免转钱包2.0来进行对接。
附注:對接Sv388Cockfighting的游戲需要對归还注额 API
您可以依照以下的步骤, 点击 测试网站 来测试您的 免转钱包 API
系统中的投注状态应如下图所示:运行(running),已结算(settled)和无效(void)。
所有 API函式皆透过 HTTP post。
● 所有 API请求符合以下规则:
1.Header:
Content-Type: application/json; charset=UTF-8
2.Body:
{"CompanyKey":"7b277d9ad9f146a591a6d40bf4290d62c65bf0bcda32b50404a011733cfb7b1e", "Username":"test"}
● 所有 API 回应必须是以 JSON 格式回应:
1.Header: Content-Type: application/json; charset=UTF-8
2.Body:
{"AccountName":"test","Balance":"9463.50002","ErrorCode":"0","ErrorMessage":"No Error"}
以下是API请求与回应的范例, 透过Postman 来展示。
我们将使用此API来获得会员的余额。
*您需要实现此API来处理我们的Request。并请依照以下示例实现ResponseBody。
Name | Sample | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | {Your domain}/GetBalance |
||||||||||||||||||||||||||||||||||||||||
Method | POST |
||||||||||||||||||||||||||||||||||||||||
Header |
Content-Type : application/json; charset=UTF-8 |
||||||||||||||||||||||||||||||||||||||||
RequestBody |
{ "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9", "Username":"Player01", "ProductType" : 1, "GameType" : 1, "Gpid" : -2 } |
||||||||||||||||||||||||||||||||||||||||
ResponseBody |
{ "AccountName":"Player01", "Balance":9483.500000000002, "ErrorCode":0, "ErrorMessage":"No Error" } |
||||||||||||||||||||||||||||||||||||||||
Remark |
|
public class GetBalanceRequest
{
public string CompanyKey { get; set; }
public string Username { get; set; }
public int ProductType { get; set; }
public int GameType { get; set; }
public int Gpid { get; set; }
}
public class GetBalanceResponse
{
public int ErrorCode { get; set; }
public string ErrorMessage { get; set; }
public string AccountName { get; set; }
public decimal Balance { get; set; }
}
[Route("GetBalance")]
[HttpPost]
public GetBalanceResponse GetBalance(GetBalanceRequest req)
{
// 此处应进行 companyKey 和其他数据的验证。
// 如果出现任何验证错误,返回相应的错误代码和消息。
// 连接数据库,从数据库中获取余额。
}
public class GetBalanceRequest {
private String companyKey;
private String username;
private int productType;
private int gameType;
private int gpid;
// 为每个属性实现获取方法和设置方法
}
public class GetBalanceResponse {
private int errorCode;
private String errorMessage;
private String accountName;
private BigDecimal balance;
// 为每个属性实现获取方法和设置方法
}
@POST
@Path("/GetBalance")
public GetBalanceResponse GetBalance(GetBalanceRequest req)
{
// 此处应进行 companyKey 和其他数据的验证。
// 如果出现任何验证错误,返回相应的错误代码和消息。
// 连接数据库,从数据库中获取余额。
}
class GetBalanceRequest
{
public $CompanyKey;
public $username;
public $productType;
public $GameType;
public $Gpid;
}
class GetBalanceResponse
{
public $ErrorCode;
public $ErrorMessage;
public $AccountName;
public $Balance;
}
$app->post('/GetBalance', function () use ($app) {
# 此处应进行 companyKey 和其他数据的验证。
# 如果出现任何验证错误,返回相应的错误代码和消息。
# 连接数据库,从数据库中获取余额。
});
$app->run();
我们将使用此API通知您在会员下注时扣除用户的投注金额,
如果您的Response中的errorCode不为0,我们将拒绝用户的赌注。
我们可能在同一个赌注下多次请求此API,这意味着用户提高了他们的赌注。
不同的产品类别会有不一样的逻辑。
体育博彩,相同的transferCode不能被扣除投注金额两次。
真人赌场和电子游戏,相同的transferCode可以被扣除投注金额两次,但第二次扣除投注金额必须比第一次大。
虚拟体育,相同的transferCode不能被扣除投注金额两次。
无缝游戏完美真人赌场,相同的transferCode且相同的transactionId不能被扣除投注金额两次,但相同的transferCode可以搭配不同的transactionId再扣除投注金额
*您需要实现此API来处理我们的Request。并请依照以下示例实现ResponseBody。
Name | Sample | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | {Your domain}/Deduct |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method | POST |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Header |
Content-Type : application/json; charset=UTF-8 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RequestBody |
{ "Amount": 1.5, "TransferCode": "3998211", "TransactionId": "3998211", "BetTime": "2021-06-01T00:23:25.9143053-04:00", "GameRoundId": null, "GamePeriodId": null, "OrderDetail": null, "PlayerIp": "1.2.3.4", "GameTypeName": null, "CompanyKey": "5021432A40D240EF8624D249874303C9", "Username": "Player01", "ProductType": 1, "GameType": 1, "GameId": 1, "Gpid": -2, "ExtraInfo":{ "sportType":"Football", "marketType":"Over/Under", "league":"ITALY SERIE A", "match":"Lecce vs Sampdoria", "betOption":"Over", "kickoffTime":"2021-06-01T00:23:25", "isHalfWonLose": true, "winlostDate": null }, "SeamlessGameExtraInfo":{ "FeatureBuyStatus":0, "EndRoundStatus":0 } } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ResponseBody |
{ "AccountName":"Player01", "Balance":8262, "ErrorCode":0, "ErrorMessage":"No Error", "BetAmount":1.5 } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Remark |
|
public class DeductRequest
{
public string CompanyKey { get; set; }
public string Username { get; set; }
public int ProductType { get; set; }
public int GameType { get; set; }
public decimal Amount { get; set; }
public string TransferCode { get; set; }
public string TransactionId { get; set; }
public DateTime BetTime { get; set; }
public string GameRoundId { get; set; }
public string GamePeriodId { get; set; }
public string OrderDetail { get; set; }
public string PlayerIp { get; set; }
public string GameTypeName { get; set; }
public int GameId { get; set; }
public int Gpid { get; set; }
public ExtraInfo ExtraInfo { get; set; }
public object SeamlessGameExtraInfo { get; set; }
}
public class ExtraInfo
{
public string sportType { get; set; }
public string marketType { get; set; }
public string league { get; set; }
public string match { get; set; }
public string betOption { get; set; }
public DateTime? kickoffTime { get; set; }
public bool isHalfWonLose { get; set; }
public DateTime? winlostDate { get; set; }
}
public class DeductResponse
{
public int ErrorCode { get; set; }
public string ErrorMessage { get; set; }
public string AccountName { get; set; }
public decimal Balance { get; set; }
public decimal BetAmount { get; set; }
}
[Route("Deduct")]
[HttpPost]
public DeductResponse Deduct(DeductRequest req)
{
// 验证CompanyKey和其他数据
// 如果遇到错误,返回错误代码和非空余额
// 连接到数据库
// 从玩家余额中扣除投注金额
// 插入投注信息,需要处理多次加注
// 返回玩家余额
}
public class DeductRequest {
private String companyKey;
private String username;
private int productType;
private int gameType;
private Decimal amount;
private String transferCode;
private String transactionId;
private Date betTime;
private String gameRoundId;
private String gamePeriodId;
private String orderDetail;
private String playerIp;
private String gameTypeName;
private int gameId;
private int gpId;
private ExtraInfo extraInfo;
private Object seamlessGameExtraInfo;
// 为每个属性实现获取方法和设置方法
}
public class ExtraInfo {
private String sportType;
private String marketType;
private String league;
private String match;
private String betOption;
private Date kickoffTime;
private boolean isHalfWonLose;
private DateTime? winlostDate { get; set; }
// 为每个属性实现获取方法和设置方法
}
public class DeductResponse {
private int errorCode;
private String errorMessage;
private String accountName;
private BigDecimal balance;
private BigDecimal betAmount;
// 为每个属性实现获取方法和设置方法
}
@POST
@Path("/Deduct")
public DeductResponse Deduct(DeductRequest req)
{
// 验证CompanyKey和其他数据
// 如果遇到错误,返回错误代码和非空余额
// 连接到数据库
// 从玩家余额中扣除投注金额
// 插入投注信息,需要处理多次加注
// 返回玩家余额
}
class DeductRequest {
public $CompanyKey;
public $Username;
public $ProductType;
public $GameType;
public $Amount;
public $TransferCode;
public $TransactionId;
public $BetTime;
public $GameRoundId;
public $GamePeriodId;
public $OrderDetail;
public $PlayerIp;
public $GameTypeName;
public $GameId;
public $GpId;
public $ExtraInfo;
public $SeamlessGameExtraInfo;
}
class ExtraInfo {
public $sportType;
public $marketType;
public $league;
public $match;
public $betOption;
public $kickoffTime;
public $isHalfWonLose;
public $winlostDate;
}
class DeductResponse {
public $ErrorCode;
public $ErrorMessage;
public $AccountName;
public $Balance;
public $BetAmount;
}
$app->post('/Deduct', function () use ($app) {
// 验证CompanyKey和其他数据
// 如果遇到错误,返回错误代码和非空余额
// 连接到数据库
// 从玩家余额中扣除投注金额
// 插入投注信息,需要处理多次加注
// 返回玩家余额
});
$app->run();
我们将使用此API发送投注结果,以便您结算投注。
我们可能会对同一个赌注发出多次API请求,这意味着我们要求该次赌注重新结算。
请贵司要记得处理这状况
当我方对注单进行结算时:
1. 注单在一开始应为 Running 状态
2. 我方呼叫 结算投注. 此时贵司需将注单状态转为 Settled
当我方对注单进行重新结算时:
1. 注单在一开始应为 Settled 状态
2. 我方呼叫 回滚. 此时贵司需将注单状态转为 Running.
3. 我方呼叫 结算投注. 此时贵司需将注单状态转为 Settled
*您需要实现此API来处理我们的Request。并请依照以下示例实现ResponseBody。
Name | Sample | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | {Your domain}/Settle |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method | POST |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Header |
Content-Type : application/json; charset=UTF-8 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RequestBody |
{ "TransferCode": "3998211", "WinLoss": 0.000000, "ResultType": 1, "ResultTime": "2021-06-01T23:33:49.0404216-04:00", "CommissionStake": 0.0, "GameResult": "", "CompanyKey": "Mm6DDwrTx4uKHgTVgVahxkbXB92HsrgKSZrX3nX8NqrQXHrGrbUuanpMBPAFHDxm", "Username": "Player01", "ProductType": 1, "GameType": 1, "Gpid": -2, "IsCashOut": true, "ExtraInfo":{ "sportType":"Football", "marketType":"Over/Under", "league":"ITALY SERIE A", "match":"Lecce vs Sampdoria", "betOption":"Over", "kickoffTime":"2024-06-01T00:23:25", "isHalfWonLose": true, "winlostDate": "2024-06-01T00:00:00" }, "SeamlessGameExtraInfo":{ "FeatureBuyStatus":0, "EndRoundStatus":0 } } |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ResponseBody |
{ "AccountName":"Player01", "Balance":8242, "ErrorCode":0, "ErrorMessage":"No Error" } |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Remark |
|
如果有任何情况迫使我们回滚结算,在我们回滚后,我们将透过此API 发送Request给您。
回滚意味着游戏中已结算的投注状态将返回成运行状态,并且必须再次结算。
*您需要实现此API来处理我们的Request。并请依照以下示例实现ResponseBody。
Name | Sample | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | {Your domain}/Rollback |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method | POST |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Header |
Content-Type : application/json; charset=UTF-8 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RequestBody |
{ "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9", "Username":"Player01", "TransferCode":"3998211", "ProductType": 1, "GameType": 1, "Gpid": -2, "ExtraInfo":{ "sportType":"Football", "marketType":"Over/Under", "league":"ITALY SERIE A", "match":"Lecce vs Sampdoria", "betOption":"Over", "kickoffTime":"2021-06-01T00:23:25", "isHalfWonLose": true, "winlostDate": null } } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ResponseBody |
{ "AccountName":"Player01", "Balance":8222, "ErrorCode":0, "ErrorMessage":"No Error" } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Remark |
|
如果有任何情况迫使我们取消投注,在我们取消投注后,我们将透过此API 发送Request给您。
取消意味着在比赛中状态为"running"或是"settled"的赌注将无效,并且将不再被接受。
1. 注单在一开始应为 Running 或 Settled 状态
(如果是对未结算的单做取消投注,可以针对加注做取消,如果是已结算的单做取消投注,只能对整笔单做取消,无法单独取消加注)
2. 我方呼叫 取消投注. 此时贵司需将注单状态转为 Void
*您需要实现此API来处理我们的Request。并请依照以下示例实现ResponseBody。
Name | Sample | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | {Your domain}/Cancel |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method | POST |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Header |
Content-Type : application/json; charset=UTF-8 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RequestBody |
{ "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9", "Username":"Player01", "TransferCode":"3998211", "ProductType": 1, "GameType": 1, "IsCancelAll" : true, "TransactionId":"3998211", "Gpid": -2, "ExtraInfo":{ "sportType":"Football", "marketType":"Over/Under", "league":"ITALY SERIE A", "match":"Lecce vs Sampdoria", "betOption":"Over", "kickoffTime":"2024-06-01T00:23:25", "isHalfWonLose": true, "winlostDate": "2024-06-01T00:00:00" } } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ResponseBody |
{ "AccountName":"Player01", "Balance":8242, "ErrorCode":0, "ErrorMessage":"No Error" } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Remark |
|
当玩家在游戏中获得红利/大奖,或从累积奖池获得奖金时,我司将会呼叫此API来直接对玩家钱包增加金额。
*您需要实现此API来处理我们的Request。并请依照以下示例实现ResponseBody。
Name | Sample | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | {Your domain}/Bonus |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method | POST |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Header |
Content-Type : application/json; charset=UTF-8 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RequestBody |
{ "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9", "Username":"Player01", "Amount":10, "BonusTime":"2018-06-06T23:00:00.0007712-04:00", "IsGameProviderPromotion": false, "ProductType": 1, "GameType": 1, "TransferCode":"3998211", "TransactionId":"3998211", "GameId": 1, "Gpid": -2, "SeamlessGameExtraInfo":{ "FeatureBuyStatus":0, "EndRoundStatus":0 } } |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ResponseBody |
{ "AccountName":"Player01", "Balance":8242, "ErrorCode":0, "ErrorMessage":"No Error" } |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Remark |
|
[HttpPost]
[Route("Bonus")]
public BonusResponse Bonus(BonusRequest request)
{
BonusResponse response = new BonusResponse();
// 验证CompanyKey和其他数据
// 如果遇到错误,返回错误代码,并且不返回空余额
// 连接到数据库,并从数据库获取奖金状态
response = GetBonusFromDB(request);
return response;
}
private BonusResponse GetBonusFromDB(BonusRequest request)
{
// ToDo: 需要在此处实现数据库查询逻辑。
throw new NotImplementedException();
}
public class BonusRequest
{
public decimal Amount { get; set; }
public string TransferCode { get; set; }
public string TransactionId { get; set; }
public DateTime BonusTime { get; set; }
public int GameId { get; set; }
public int GPId { get; set; }
public bool IsPromotion { get; set; }
public string CompanyKey { get; set; }
public string Username { get; set; }
public int ProductType { get; set; }
public int GameType { get; set; }
public object SeamlessGameExtraInfo { get; set; }
}
public class BonusResponse
{
public string AccountName { get; set; }
public decimal Balance { get; set; }
public int ErrorCode { get; set; }
public string ErrorMessage { get; set; }
}
@Path("/Bonus")
@POST
public BonusResponse Bonus(BonusRequest request) {
BonusResponse response = new BonusResponse();
// 验证CompanyKey和其他数据
// 如果遇到错误,返回错误代码,并且不返回空余额
// 连接到数据库,并从数据库获取奖金状态
response = getBonusFromDB(request);
return response;
}
private BonusResponse getBonusFromDB(BonusRequest request) {
// ToDo: 需要在此处实现数据库查询逻辑。
throw new UnsupportedOperationException();
}
public static class BonusRequest {
public BigDecimal Amount;
public String TransferCode;
public String TransactionId;
public Date BonusTime;
public int GameId;
public int GPId;
public boolean IsPromotion;
public String CompanyKey;
public String Username;
public int ProductType;
public int GameType;
public Object SeamlessGameExtraInfo;
// 实现每个属性的Getter和Setter方法
}
public static class BonusResponse {
public String AccountName;
public BigDecimal Balance;
public int ErrorCode;
public String ErrorMessage;
// 实现每个属性的Getter和Setter方法
}
public function Bonus(Request $request)
{
$response = new BonusResponse();
// 在這裡驗證 companyKey 和其他數據。
// 如果發生任何驗證錯誤,則返回相應的錯誤代碼和訊息。
// 連接到資料庫並檢索獎金狀態。
$response = $this->getBonusFromDB($request->all());
return response()->json($response);
}
private function getBonusFromDB($request)
{
// 在這裡實現資料庫查詢邏輯
}
class BonusRequest
{
public $Amount;
public $TransferCode;
public $TransactionId;
public $BonusTime;
public $GameId;
public $GPId;
public $IsPromotion;
public $CompanyKey;
public $Username;
public $ProductType;
public $GameType;
public $SeamlessGameExtraInfo;
}
class BonusResponse
{
public $AccountName;
public $Balance;
public $ErrorCode;
public $ErrorMessage;
}
当玩家在游戏中下注,但游戏商不接受玩家下注的全额而只接受部份下注金额,此时会呼叫此API通知客户端特定玩家的特定单号最新的下注额。客户端应归还多余的注额给玩家。
附注:對接Sv388Cockfighting的游戲需要對归还注额 API
Name | Sample | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | {Your domain}/ReturnStake |
||||||||||||||||||||||||||||||||||||||||||||||||||||
Method | POST |
||||||||||||||||||||||||||||||||||||||||||||||||||||
Header |
Content-Type : application/json; charset=UTF-8 |
||||||||||||||||||||||||||||||||||||||||||||||||||||
RequestBody |
{ "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9", "Username":"Player01", "CurrentStake":10, "ReturnStakeTime":"2018-06-06T23:00:00.0007712-04:00", "ProductType": 1, "GameType": 1, "TransferCode":"3998211", "TransactionId":"3998211" } |
||||||||||||||||||||||||||||||||||||||||||||||||||||
ResponseBody |
{ "AccountName":"Player01", "Balance":8242, "ErrorCode":0, "ErrorMessage":"No Error" } |
||||||||||||||||||||||||||||||||||||||||||||||||||||
Remark |
|
我们将使用此API 来同步我们之间的投注状态,通常用于检查或除虫。
例如,如果568win系统中的投注已结算,但在您的系统中的状态仍在运行,那么我们就知道投注出现问题。
*您需要实现此API来处理我们的Request。并请依照以下示例实现ResponseBody。
Name | Sample | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | {Your domain}/GetBetStatus |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method | POST |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Header |
Content-Type : application/json; charset=UTF-8 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RequestBody |
{ "CompanyKey":"difjwifjwejfdisdfkidsjfiojwiowej213kiorfj23o5sdfkj9", "Username":"Player01", "ProductType": 1, "GameType": 1, "TransferCode":"3998211", "TransactionId":"3998211", "Gpid": -2 } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ResponseBody |
{ "TransferCode":"3998211", "TransactionId":"3998211", "ErrorCode":0, "Status":"settled", "WinLoss":120, "Stake": 100, "ErrorMessage":"No Error" } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Remark |
|
[HttpPost]
[Route("GetBetStatus")]
public GetBetStatusResponse GetBetstatus(GetBetStatusRequest request)
{
GetBetStatusResponse response = new GetBetStatusResponse();
// 此处应进行 companyKey 和其他数据的验证。
// 如果出现任何验证错误,返回相应的错误代码和消息。
// 连接数据库,从数据库中获取投注状态。
response = GetStatusFromDB(request);
return response;
}
private GetBetStatusResponse GetStatusFromDB(GetBetStatusRequest request)
{
//ToDo 需要实现数据库查询逻辑
throw new NotImplementedException();
}
public class GetBetStatusRequest
{
public string CompanyKey { get; set; }
public string Username { get; set; }
public int ProductType { get; set; }
public int GameType { get; set; }
public string TransferCode { get; set; }
public string TransactionId { get; set; }
public int Gpid { get; set; }
}
public class GetBetStatusResponse
{
public string TransferCode { get; set; }
public string TransactionId { get; set; }
public string Status { get; set; }
public decimal WinLoss { get; set; }
public decimal Stake { get; set; }
public int ErrorCode { get; set; }
public string ErrorMessage { get; set; }
}
public class GetBetStatusRequest {
public String CompanyKey;
public String Username;
public int ProductType;
public int GameType;
public String TransferCode;
public String TransactionId;
public int Gpid;
// 为每个属性实现获取方法和设置方法
}
public class GetBetStatusResponse {
public String TransferCode;
public String TransactionId;
public String Status;
public BigDecimal WinLoss;
public BigDecimal Stake;
public int ErrorCode;
public String ErrorMessage;
// 为每个属性实现获取方法和设置方法
}
@Path("/GetBetStatus")
@POST
public GetBetStatusResponse getBetStatus(GetBetStatusRequest request) {
GetBetStatusResponse response = new GetBetStatusResponse();
// Validation companyKey and other data
// If encounter error, return error code
// Connect to the database, and get BetStatus from DB
response = getStatusFromDB(request);
return response;
}
private GetBetStatusResponse getStatusFromDB(GetBetStatusRequest request) {
// ToDo: Need to implement the database query logic here.
throw new UnsupportedOperationException();
}
public function getBetStatus(Request $request)
{
$response = new GetBetStatusResponse();
// 在這裡驗證 companyKey 和其他數據。
// 如果出現任何驗證錯誤,返回相應的錯誤碼和消息。
// 連接到數據庫並檢索賭注狀態。
$response = $this->getStatusFromDB($request->all());
return response()->json($response);
}
private function getStatusFromDB($request)
{
// 在這裡實現您的數據庫查詢邏輯
}
class GetBetStatusRequest
{
public $CompanyKey;
public $Username;
public $ProductType;
public $GameType;
public $TransferCode;
public $TransactionId;
public $Gpid;
}
class GetBetStatusResponse
{
public $TransferCode;
public $TransactionId;
public $Status;
public $WinLoss;
public $Stake;
public $ErrorCode;
public $ErrorMessage;
}
错误代号 | 错误讯息 | 叙述 |
---|---|---|
0 | No Error | 请求已正确响应 |
1 | Member not exist | 会员不存在 |
2 | Invalid Ip | IP无效 |
3 | Username empty | 会员名为空 |
4 | CompanyKey Error | CompanyKey错误 |
5 | Not enough balance | 会员的余额不足 |
6 | Bet not exists | * |
7 | Internal Error | * |
2001 | Bet Already Settled | Return this error code will stop the resend settle request from 568win. |
2002 | Bet Already Canceled | Return this error code will stop the resend cancel request from 568win. |
2003 | Bet Already Rollback | Return this error code will stop the resend rollback request from 568win. |
5003 | Bet With Same RefNo Exists | Bet with same refNo already exists. |
5008 | Bet Already Returned Stake | Bet already returned stake. |
若您有其他错误也可以定义至上方清单 |
第三方游戲的列表請參照: 第三方游戲资讯
附注:對接Sv388Cockfighting的游戲需要對ReturnStake API
产品类别 | 产品名称 | 中文产品名称 |
---|---|---|
1 | Sports Book | 体育博彩 |
3 | SBO Games | 电子游戏 |
5 | Virtual Sports | 虚拟运动 |
7 | SBO Live Casino | 真人赌场 |
9 | Seamless Game Provider | 无缝游戏 |
产品类别 | 游戏类别 | 游戏名称 | 中文游戏名称 | 适用装置 |
---|---|---|---|---|
1 | 0 |
Unknown(Use in GetBalance and Settle) GetBalance may use 0 as parameter to call, Settle please base on TransferCode to process only. |
未知游戲(使用在GetBalance和Settle) GetBalance會使用0當作參數來呼叫 Settle請根據TransferCode結算 |
Desktop, Mobile |
1 | 1 | Sports Book | 体育博彩 | Desktop, Mobile |
1 | 2 | In Between | 射龍門 | Desktop, Mobile |
1 | 3 | 568 Sports Book | 568 体育博彩 | Desktop, Mobile |
3 | 0 |
Unknown(Use in GetBalance and Settle) GetBalance may use 0 as parameter to call, Settle please base on TransferCode to process only. |
未知游戲(使用在GetBalance和Settle) GetBalance會使用0當作參數來呼叫 Settle請根據TransferCode結算 |
Desktop, Mobile |
3 | 161 | Money Roll | 錢滾錢 | Desktop, Mobile |
3 | 201 | Royal Baccarat | 皇家百家乐 | Desktop |
3 | 203 | Royal Roulettle | 皇家轮盘 | Desktop |
3 | 204 | Royal Blackjack | 皇家21点 | Desktop |
3 | 205 | Royal Sic Bo | 皇家骰宝 | Desktop |
3 | 207 | Royal 5 Box Blackjack | 皇家多手21点 | Desktop |
3 | 208 | Dragon Bonus | 龙宝 | Desktop |
3 | 511 | Royal Baccarat | 皇家百家乐 | Mobile |
3 | 513 | Royal Roulettle | 皇家轮盘 | Mobile |
3 | 514 | Royal Blackjack | 皇家21点 | Mobile |
3 | 515 | Royal Sic Bo | 皇家骰宝 | Mobile |
3 | 517 | Royal 5 Box Blackjack | 皇家多手21点 | Mobile |
3 | 518 | Dragon Bonus | 龙宝 | Mobile |
3 | 601 | Live Bingo! | 活力宾果! | Desktop |
5 | 0 |
Unknown(Use in GetBalance and Settle) GetBalance may use 0 as parameter to call, Settle please base on TransferCode to process only. |
未知游戲(使用在GetBalance和Settle) GetBalance會使用0當作參數來呼叫 Settle請根據TransferCode結算 |
Desktop, Mobile |
5 | 201601 | Virtual Football | 虚拟足球 | Desktop |
5 | 201604 | Virtual Basketball | 虚拟篮球 | Desktop |
5 | 201607 | Virtual Euro Cup | 虚拟歐洲杯 | Desktop |
5 | 201608 | Virtual Asian Cup | 虚拟亞洲杯 | Desktop |
5 | 201609 | Virtual Champions Cup | 虚拟冠軍杯 | Desktop |
5 | 202601 | Virtual Football | 虚拟足球 | Mobile |
5 | 202602 | Virtual Basketball | 虚拟篮球 | Mobile |
5 | 202607 | Virtual Euro Cup | 虚拟歐洲杯 | Mobile |
5 | 202608 | Virtual Asian Cup | 虚拟亞洲杯 | Mobile |
5 | 202609 | Virtual Champions Cup | 虚拟冠軍杯 | Mobile |
5 | 202610 | Bundesliga | 德国足球甲级联赛虚拟杯 | Mobile |
5 | 201600 | MixParlay | 混合过关 | Desktop |
5 | 202600 | MixParlay | 混合过关 | Mobile |
7 | 0 |
Unknown(Use in GetBalance and Settle) GetBalance may use 0 as parameter to call, Settle please base on TransferCode to process only. |
未知游戲(使用在GetBalance和Settle) GetBalance會使用0當作參數來呼叫 Settle請根據TransferCode結算 |
Desktop, Mobile |
7 | 1 | Baccarat | 百家乐 | Desktop, Mobile |
7 | 3 | Roulette | 大轮盘 | Desktop, Mobile |
7 | 5 | SicBo | 骰宝 | Desktop, Mobile |
7 | 9 | DragonTiger | 龙宝 | Desktop, Mobile |
7 | 10 | MultipleTableBaccarat | 多桌百家乐 | Desktop,Mobile |
7 | 12 | SpeedBaccarat | 极速百家乐 | Desktop,Mobile |
赌注结果 | 描述 |
---|---|
0 | 赢 |
1 | 输 |
2 | 平手 |