交易
URl:https://{{brand_url
}}/transaction?hash={{xxx}}。
方式:POST。
目的:当玩家游戏时,用于改变代理钱包系统中的玩家余额。
请求
参数名 | 类型 | 必选 | 参数说明 |
---|---|---|---|
playerId | String (24) | 是 | 代理定义的玩家唯一标识。 |
playerSessionId | String (32) | 是 | 游戏的会话。 |
gameCode | String (32) | 是 | 游戏的编码。 |
trans | transArray | 是 | 关于改变余额的交易信息的数组,请参考下面的交易信息的详细说明。一个交易(trans)可以包含多个动作,只有全部动作都成功后,该交易才成功完成。一旦它的某一个动作失败,此交易失败,并且回滚此交易已经完成的全部动作,将玩家的余额恢复到交易前的状态。 |
endSession | Int | 否 | 默认值 = 0, 表明该游戏会话是否已经结束。当玩家结束一个游戏时,该值被回调。 |
detailUrl | String (1024) | 否 | 说明一个回合的详细游戏信息的链接。 |
bonusChanges | bonusChangesArray | 否 | 奖金变化详情数组 |
providerCode | String(16) | 是 | 游戏供应商编码 |
gameType | String(16) | 是 |
|
transArray数组元素
键名 | 类型 | 必选 | 参数说明 |
---|---|---|---|
seq | int | 是 | 操作动作的顺序。 |
transId | String (64) | 是 | 交易的唯一标识。 如果相同的transId已经处理过,则应返回与上次相同的结果。不应发生新的交易或钱包金额变化。 |
referenceId | String (64) | 否 | 当 transType = ‘cancel’,此值为要取消的交易的transId。 |
amount | numeric (16, 4) | 是 | 此操作的金额。注:由于某些游戏供应商允许重复结算,所以当transType = 'amend' 时,此金额可能小于0,请确保能正常操作。 |
transType | String (16) | 是 | 交易类型,取值为:bet、transIn (转账到游戏)、win、transOut (转账到玩家)、cancel、amend(游戏过程中金额调整,用于体育,捕鱼,某些平台的真人游戏等,比如: 同一局游戏中回退某一部分金额,amend时交易金额amount有可能是负数,负数时需要扣除玩家金额,正数时需要增加玩家余额) |
transTime | DateTime | 是 | 操作的时间,格式:"yyyy-mm-dd hh24:mi:ss.SSS",时区为GMT+0。 |
roundId | String (127) | 是 | 回合的唯一标识。 |
roundType | String (16) | 是 | 回合的类型,取值为:normal、freegame、bonusgame。 |
endRound | int | 否 | 回合是否已经完成。1 -已完成,0-未完成, 默认为0 |
desc | String (1024) | 否 | 操作的描述。 |
jpc | numeric (16, 4) | 否 | 奖金池的贡献金额。 |
jpw | numeric (16, 4) | 否 | 奖金池的赢取金额。 |
jpDetails | jackpotArray | 否 | 奖金池赢取的详细信息。 |
validBet | numeric (16, 4) | 否 | 当transType = ‘transOut’,有效押注的金额。 |
validWin | numeric (16, 4) | 否 | 当transType = ‘transOut’,有效赢取的金额。 |
additionalData | Json | 否 | 额外的数据。 |
jackpotArray 数组元素
键名 | 类型 | 必选 | 参数说明 |
---|---|---|---|
id | String (8) | 是 | 奖金池赢取的唯一标识。 |
name | String (512) | 否 | 奖金池的名称。 |
type | String (32) | 否 | 类型,取值为:Daily, Hourly。 |
contribution | numeric (16, 4) | 否 | 奖金池的贡献金额。 |
win | numeric (16, 4) | 否 | 奖金池的赢取金额。 |
bonusChangesArray 数组元素
Name | Type | Required | Description |
---|---|---|---|
bonusCode | String(63) | 是 | 奖金编码唯一标识,在给玩家添加奖金接口返回。 |
count | Int | 是 | 奖金变化数量 |
value | numeric (16, 4) | 否 | 奖金的价值 |
响应
参数名 | 类型 | 必选 | 参数说明 |
---|---|---|---|
currency | String (4) | 是 | 玩家的币种编码。 |
balance | numeric (16, 4) | 是 | 玩家的余额。 |
bonusBalance | numeric (16, 4) | 否 | 玩家的奖金余额。 |
请求例子
//bet
{
"requestId": "requestId1234",
"brandId": 1001,
"playerId": "19823",
"playerSessionId": "custSessionId12341234",
"gameCode": "bfb",
"endSession": 0,
"providerCode": "pt",
"gameType": "slots",
"trans": [
{
"seq": 1,
"transId": "unique_bet1",
"amount": 1000,
"transType": "bet",
"transTime": " 2021-01-12 19:56:32.123",
"roundId": "roundid12341",
"roundType": "normal",
"desc": "desc",
"jpc": 10
}
]
}
//bet+bet
{
"requestId": "requestId1234",
"brandId": 1001,
"playerId": "19823",
"playerSessionId": "custSessionId12341234",
"gameCode": "bfb",
"endSession": 0,
"providerCode": "pt",
"gameType": "slots",
"trans": [
{
"seq": 1,
"transId": "unique_bet1",
"amount": 1000,
"transType": "bet",
"transTime": " 2021-01-12 19:56:32.123",
"roundId": "roundid12341",
"roundType": "normal",
"desc": "desc",
"jpc": 10
},
{
"seq": 2,
"transId": "unique_bet2",
"amount": 2000,
"transType": "bet",
"transTime": " 2021-01-12 19:56:33.123",
"roundId": "roundid12341",
"roundType": "normal",
"desc": "desc",
"jpc": 20
}
]
}
//bet with bonus
{
"requestId": "requestId1234",
"brandId": 1001,
"playerId": "19823",
"playerSessionId": "custSessionId12341234",
"gameCode": "bfb",
"endSession": 0,
"providerCode": "pt",
"gameType": "slots",
"trans": [
{
"seq": 1,
"transId": "unique_bet1",
"amount": 1000,
"transType": "bet",
"transTime": " 2021-01-12 19:56:32.123",
"roundId": "roundid12341",
"roundType": "bonusgame",
"desc": "desc",
"jpc": 10
}
],
"bonusChanges": [
{
"bonusCode": "BG-123XDEAFRR3",
"count": 1,
"value": 5
}
]
}
//win
{
"requestId": "requestId1234",
"brandId": 1001,
"playerId": "19823",
"playerSessionId": "custSessionId12341234",
"gameCode": "bfb",
"endSession": 1,
"detailUrl": "https://detailedresult.provider_url.com/getgamehistoryurl.php? &username=Player_TEST& token=92b9fee7af7fc246f56c45cb &showFullHistoryPerBet=false ",
"providerCode": "pt",
"gameType": "slots",
"trans": [
{
"seq": 1,
"transId": "unique_win1",
"amount": 1000,
"transType": "win",
"transTime": "2021-01-12 19:56:32.123",
"roundId": "roundid12341",
"roundType": "normal",
"desc": "desc",
"endRound": 1,
"jpc": 10,
"jpw": 100,
"jpDetails": [
{ "id": "id1",
"name": "name",
"type": "Daily"
},
{
"id": "id1",
"name": "name",
"type": "Daily"
}
]
}
]
}
//bet+win
{
"requestId": "requestId1234",
"brandId": 1001,
"playerId": "19823",
"playerSessionId": "custSessionId12341234",
"gameCode": "bfb",
"endSession": 1,
"detailUrl": "https://detailedresult.provider_url.com/getgamehistoryurl.php? &username=Player_TEST& token=92b9fee7af7fc246f56c45cb &showFullHistoryPerBet=false ",
"providerCode": "pt",
"gameType": "slots",
"trans": [
{
"seq": 1,
"transId": "unique_bet1",
"amount": 1000,
"transType": "bet",
"transTime": "2021-01-12 19:56:32.123",
"roundId": "roundid12341",
"roundType": "normal",
"desc": "desc",
"jpc": 10
},
{
"seq": 2,
"transId": "unique_wub1",
"amount": 1000,
"transType": "win",
"transTime": "2021-01-12 19:56:32.123",
"roundId": "roundid12341",
"roundType": "normal",
"desc": "desc",
"endRound": 1,
"jpc": 10,
"jpw": 100,
"jpDetails": [
{
"id": "id1",
"name": "name",
"type": "Daily"
},
{
"id": "id2",
"name": "name2",
"type": "Hourly"
}
]
}
]
}
响应例子
//success
{
"requestId": "requestId1234",
"error": "0",
"message": "success",
"currency": "CNY",
"balance": 10000,
"bonusBalance": 10100
}
//error T_01, 当余额不足时请返回玩家当前余额
{
"requestId": "requestId1234",
"error": "T_01",
"message": "Player Insufficient Funds",
"balance": 999,
"bonusBalance": 0
}
//error
{
"requestId": "requestId1234",
"error": "P_02",
"message": "Invalid hash"
}