同步注單異動額度
curl --request POST \
--url https://api.example.com/dt/callback/sync_credit \
--header 'Content-Type: application/json' \
--data '
{
"platform_id": "H88",
"token": "E47A56947DF6DA25B6F95C3BFE5748E7",
"uuid": "lobby1-82818443591811",
"account": "bentest",
"info": [
{
"transaction_id": "005-200926080808-0000005RB",
"order_id": "A003220118145511020000005",
"type": 23,
"canceled_id": "005-200926080808-0000005",
"credit": 2000,
"target_wallet": 0,
"proposal_id": "954531",
"ip": "127.0.0.1",
"order_detail": {
"room_account": "aad144",
"room_name": "TRP01",
"table_id": "A003",
"gmcode": "A003220118",
"in_proposal": 1,
"game_type": "BAC",
"play_type": 1,
"amount": 2000,
"valid_amount": 0,
"win": 0,
"flag": 1,
"round_detail": "8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0",
"create_time": 1668580007,
"reckon_time": 1668580007,
"last_update_time": 1668580007
},
"rolling_unit": 1000,
"ratio": 1
}
]
}
'import requests
url = "https://api.example.com/dt/callback/sync_credit"
payload = {
"platform_id": "H88",
"token": "E47A56947DF6DA25B6F95C3BFE5748E7",
"uuid": "lobby1-82818443591811",
"account": "bentest",
"info": [
{
"transaction_id": "005-200926080808-0000005RB",
"order_id": "A003220118145511020000005",
"type": 23,
"canceled_id": "005-200926080808-0000005",
"credit": 2000,
"target_wallet": 0,
"proposal_id": "954531",
"ip": "127.0.0.1",
"order_detail": {
"room_account": "aad144",
"room_name": "TRP01",
"table_id": "A003",
"gmcode": "A003220118",
"in_proposal": 1,
"game_type": "BAC",
"play_type": 1,
"amount": 2000,
"valid_amount": 0,
"win": 0,
"flag": 1,
"round_detail": "8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0",
"create_time": 1668580007,
"reckon_time": 1668580007,
"last_update_time": 1668580007
},
"rolling_unit": 1000,
"ratio": 1
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
platform_id: 'H88',
token: 'E47A56947DF6DA25B6F95C3BFE5748E7',
uuid: 'lobby1-82818443591811',
account: 'bentest',
info: [
{
transaction_id: '005-200926080808-0000005RB',
order_id: 'A003220118145511020000005',
type: 23,
canceled_id: '005-200926080808-0000005',
credit: 2000,
target_wallet: 0,
proposal_id: '954531',
ip: '127.0.0.1',
order_detail: {
room_account: 'aad144',
room_name: 'TRP01',
table_id: 'A003',
gmcode: 'A003220118',
in_proposal: 1,
game_type: 'BAC',
play_type: 1,
amount: 2000,
valid_amount: 0,
win: 0,
flag: 1,
round_detail: '8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0',
create_time: 1668580007,
reckon_time: 1668580007,
last_update_time: 1668580007
},
rolling_unit: 1000,
ratio: 1
}
]
})
};
fetch('https://api.example.com/dt/callback/sync_credit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/dt/callback/sync_credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'platform_id' => 'H88',
'token' => 'E47A56947DF6DA25B6F95C3BFE5748E7',
'uuid' => 'lobby1-82818443591811',
'account' => 'bentest',
'info' => [
[
'transaction_id' => '005-200926080808-0000005RB',
'order_id' => 'A003220118145511020000005',
'type' => 23,
'canceled_id' => '005-200926080808-0000005',
'credit' => 2000,
'target_wallet' => 0,
'proposal_id' => '954531',
'ip' => '127.0.0.1',
'order_detail' => [
'room_account' => 'aad144',
'room_name' => 'TRP01',
'table_id' => 'A003',
'gmcode' => 'A003220118',
'in_proposal' => 1,
'game_type' => 'BAC',
'play_type' => 1,
'amount' => 2000,
'valid_amount' => 0,
'win' => 0,
'flag' => 1,
'round_detail' => '8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0',
'create_time' => 1668580007,
'reckon_time' => 1668580007,
'last_update_time' => 1668580007
],
'rolling_unit' => 1000,
'ratio' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/dt/callback/sync_credit"
payload := strings.NewReader("{\n \"platform_id\": \"H88\",\n \"token\": \"E47A56947DF6DA25B6F95C3BFE5748E7\",\n \"uuid\": \"lobby1-82818443591811\",\n \"account\": \"bentest\",\n \"info\": [\n {\n \"transaction_id\": \"005-200926080808-0000005RB\",\n \"order_id\": \"A003220118145511020000005\",\n \"type\": 23,\n \"canceled_id\": \"005-200926080808-0000005\",\n \"credit\": 2000,\n \"target_wallet\": 0,\n \"proposal_id\": \"954531\",\n \"ip\": \"127.0.0.1\",\n \"order_detail\": {\n \"room_account\": \"aad144\",\n \"room_name\": \"TRP01\",\n \"table_id\": \"A003\",\n \"gmcode\": \"A003220118\",\n \"in_proposal\": 1,\n \"game_type\": \"BAC\",\n \"play_type\": 1,\n \"amount\": 2000,\n \"valid_amount\": 0,\n \"win\": 0,\n \"flag\": 1,\n \"round_detail\": \"8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0\",\n \"create_time\": 1668580007,\n \"reckon_time\": 1668580007,\n \"last_update_time\": 1668580007\n },\n \"rolling_unit\": 1000,\n \"ratio\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/dt/callback/sync_credit")
.header("Content-Type", "application/json")
.body("{\n \"platform_id\": \"H88\",\n \"token\": \"E47A56947DF6DA25B6F95C3BFE5748E7\",\n \"uuid\": \"lobby1-82818443591811\",\n \"account\": \"bentest\",\n \"info\": [\n {\n \"transaction_id\": \"005-200926080808-0000005RB\",\n \"order_id\": \"A003220118145511020000005\",\n \"type\": 23,\n \"canceled_id\": \"005-200926080808-0000005\",\n \"credit\": 2000,\n \"target_wallet\": 0,\n \"proposal_id\": \"954531\",\n \"ip\": \"127.0.0.1\",\n \"order_detail\": {\n \"room_account\": \"aad144\",\n \"room_name\": \"TRP01\",\n \"table_id\": \"A003\",\n \"gmcode\": \"A003220118\",\n \"in_proposal\": 1,\n \"game_type\": \"BAC\",\n \"play_type\": 1,\n \"amount\": 2000,\n \"valid_amount\": 0,\n \"win\": 0,\n \"flag\": 1,\n \"round_detail\": \"8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0\",\n \"create_time\": 1668580007,\n \"reckon_time\": 1668580007,\n \"last_update_time\": 1668580007\n },\n \"rolling_unit\": 1000,\n \"ratio\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/dt/callback/sync_credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"platform_id\": \"H88\",\n \"token\": \"E47A56947DF6DA25B6F95C3BFE5748E7\",\n \"uuid\": \"lobby1-82818443591811\",\n \"account\": \"bentest\",\n \"info\": [\n {\n \"transaction_id\": \"005-200926080808-0000005RB\",\n \"order_id\": \"A003220118145511020000005\",\n \"type\": 23,\n \"canceled_id\": \"005-200926080808-0000005\",\n \"credit\": 2000,\n \"target_wallet\": 0,\n \"proposal_id\": \"954531\",\n \"ip\": \"127.0.0.1\",\n \"order_detail\": {\n \"room_account\": \"aad144\",\n \"room_name\": \"TRP01\",\n \"table_id\": \"A003\",\n \"gmcode\": \"A003220118\",\n \"in_proposal\": 1,\n \"game_type\": \"BAC\",\n \"play_type\": 1,\n \"amount\": 2000,\n \"valid_amount\": 0,\n \"win\": 0,\n \"flag\": 1,\n \"round_detail\": \"8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0\",\n \"create_time\": 1668580007,\n \"reckon_time\": 1668580007,\n \"last_update_time\": 1668580007\n },\n \"rolling_unit\": 1000,\n \"ratio\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"uuid": "lobby1-82818443591811",
"timestamp": 1668580007001,
"data": {
"account": "c001",
"credit": 115,
"reserved": 100,
"balance": 215,
"platform_id": "H88",
"success_id": [
"005-200926080808-0000005",
"005-200926080808-0000006"
],
"fail_id": [
"005-200926080808-0000007"
]
}
}Wallet API
同步注單異動額度
注單狀態相關異動所需同步的玩家餘額變動(由 vendor 實作)
此 api 將不停重試直到成功,實作方需做好判斷,避免重複加款
實作方需做好同帳號多條 api 併發請求的處理
若已處理過,回傳成功,於 response message 內說明已處理過該派彩
POST
/
dt
/
callback
/
sync_credit
同步注單異動額度
curl --request POST \
--url https://api.example.com/dt/callback/sync_credit \
--header 'Content-Type: application/json' \
--data '
{
"platform_id": "H88",
"token": "E47A56947DF6DA25B6F95C3BFE5748E7",
"uuid": "lobby1-82818443591811",
"account": "bentest",
"info": [
{
"transaction_id": "005-200926080808-0000005RB",
"order_id": "A003220118145511020000005",
"type": 23,
"canceled_id": "005-200926080808-0000005",
"credit": 2000,
"target_wallet": 0,
"proposal_id": "954531",
"ip": "127.0.0.1",
"order_detail": {
"room_account": "aad144",
"room_name": "TRP01",
"table_id": "A003",
"gmcode": "A003220118",
"in_proposal": 1,
"game_type": "BAC",
"play_type": 1,
"amount": 2000,
"valid_amount": 0,
"win": 0,
"flag": 1,
"round_detail": "8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0",
"create_time": 1668580007,
"reckon_time": 1668580007,
"last_update_time": 1668580007
},
"rolling_unit": 1000,
"ratio": 1
}
]
}
'import requests
url = "https://api.example.com/dt/callback/sync_credit"
payload = {
"platform_id": "H88",
"token": "E47A56947DF6DA25B6F95C3BFE5748E7",
"uuid": "lobby1-82818443591811",
"account": "bentest",
"info": [
{
"transaction_id": "005-200926080808-0000005RB",
"order_id": "A003220118145511020000005",
"type": 23,
"canceled_id": "005-200926080808-0000005",
"credit": 2000,
"target_wallet": 0,
"proposal_id": "954531",
"ip": "127.0.0.1",
"order_detail": {
"room_account": "aad144",
"room_name": "TRP01",
"table_id": "A003",
"gmcode": "A003220118",
"in_proposal": 1,
"game_type": "BAC",
"play_type": 1,
"amount": 2000,
"valid_amount": 0,
"win": 0,
"flag": 1,
"round_detail": "8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0",
"create_time": 1668580007,
"reckon_time": 1668580007,
"last_update_time": 1668580007
},
"rolling_unit": 1000,
"ratio": 1
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
platform_id: 'H88',
token: 'E47A56947DF6DA25B6F95C3BFE5748E7',
uuid: 'lobby1-82818443591811',
account: 'bentest',
info: [
{
transaction_id: '005-200926080808-0000005RB',
order_id: 'A003220118145511020000005',
type: 23,
canceled_id: '005-200926080808-0000005',
credit: 2000,
target_wallet: 0,
proposal_id: '954531',
ip: '127.0.0.1',
order_detail: {
room_account: 'aad144',
room_name: 'TRP01',
table_id: 'A003',
gmcode: 'A003220118',
in_proposal: 1,
game_type: 'BAC',
play_type: 1,
amount: 2000,
valid_amount: 0,
win: 0,
flag: 1,
round_detail: '8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0',
create_time: 1668580007,
reckon_time: 1668580007,
last_update_time: 1668580007
},
rolling_unit: 1000,
ratio: 1
}
]
})
};
fetch('https://api.example.com/dt/callback/sync_credit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/dt/callback/sync_credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'platform_id' => 'H88',
'token' => 'E47A56947DF6DA25B6F95C3BFE5748E7',
'uuid' => 'lobby1-82818443591811',
'account' => 'bentest',
'info' => [
[
'transaction_id' => '005-200926080808-0000005RB',
'order_id' => 'A003220118145511020000005',
'type' => 23,
'canceled_id' => '005-200926080808-0000005',
'credit' => 2000,
'target_wallet' => 0,
'proposal_id' => '954531',
'ip' => '127.0.0.1',
'order_detail' => [
'room_account' => 'aad144',
'room_name' => 'TRP01',
'table_id' => 'A003',
'gmcode' => 'A003220118',
'in_proposal' => 1,
'game_type' => 'BAC',
'play_type' => 1,
'amount' => 2000,
'valid_amount' => 0,
'win' => 0,
'flag' => 1,
'round_detail' => '8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0',
'create_time' => 1668580007,
'reckon_time' => 1668580007,
'last_update_time' => 1668580007
],
'rolling_unit' => 1000,
'ratio' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/dt/callback/sync_credit"
payload := strings.NewReader("{\n \"platform_id\": \"H88\",\n \"token\": \"E47A56947DF6DA25B6F95C3BFE5748E7\",\n \"uuid\": \"lobby1-82818443591811\",\n \"account\": \"bentest\",\n \"info\": [\n {\n \"transaction_id\": \"005-200926080808-0000005RB\",\n \"order_id\": \"A003220118145511020000005\",\n \"type\": 23,\n \"canceled_id\": \"005-200926080808-0000005\",\n \"credit\": 2000,\n \"target_wallet\": 0,\n \"proposal_id\": \"954531\",\n \"ip\": \"127.0.0.1\",\n \"order_detail\": {\n \"room_account\": \"aad144\",\n \"room_name\": \"TRP01\",\n \"table_id\": \"A003\",\n \"gmcode\": \"A003220118\",\n \"in_proposal\": 1,\n \"game_type\": \"BAC\",\n \"play_type\": 1,\n \"amount\": 2000,\n \"valid_amount\": 0,\n \"win\": 0,\n \"flag\": 1,\n \"round_detail\": \"8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0\",\n \"create_time\": 1668580007,\n \"reckon_time\": 1668580007,\n \"last_update_time\": 1668580007\n },\n \"rolling_unit\": 1000,\n \"ratio\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/dt/callback/sync_credit")
.header("Content-Type", "application/json")
.body("{\n \"platform_id\": \"H88\",\n \"token\": \"E47A56947DF6DA25B6F95C3BFE5748E7\",\n \"uuid\": \"lobby1-82818443591811\",\n \"account\": \"bentest\",\n \"info\": [\n {\n \"transaction_id\": \"005-200926080808-0000005RB\",\n \"order_id\": \"A003220118145511020000005\",\n \"type\": 23,\n \"canceled_id\": \"005-200926080808-0000005\",\n \"credit\": 2000,\n \"target_wallet\": 0,\n \"proposal_id\": \"954531\",\n \"ip\": \"127.0.0.1\",\n \"order_detail\": {\n \"room_account\": \"aad144\",\n \"room_name\": \"TRP01\",\n \"table_id\": \"A003\",\n \"gmcode\": \"A003220118\",\n \"in_proposal\": 1,\n \"game_type\": \"BAC\",\n \"play_type\": 1,\n \"amount\": 2000,\n \"valid_amount\": 0,\n \"win\": 0,\n \"flag\": 1,\n \"round_detail\": \"8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0\",\n \"create_time\": 1668580007,\n \"reckon_time\": 1668580007,\n \"last_update_time\": 1668580007\n },\n \"rolling_unit\": 1000,\n \"ratio\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/dt/callback/sync_credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"platform_id\": \"H88\",\n \"token\": \"E47A56947DF6DA25B6F95C3BFE5748E7\",\n \"uuid\": \"lobby1-82818443591811\",\n \"account\": \"bentest\",\n \"info\": [\n {\n \"transaction_id\": \"005-200926080808-0000005RB\",\n \"order_id\": \"A003220118145511020000005\",\n \"type\": 23,\n \"canceled_id\": \"005-200926080808-0000005\",\n \"credit\": 2000,\n \"target_wallet\": 0,\n \"proposal_id\": \"954531\",\n \"ip\": \"127.0.0.1\",\n \"order_detail\": {\n \"room_account\": \"aad144\",\n \"room_name\": \"TRP01\",\n \"table_id\": \"A003\",\n \"gmcode\": \"A003220118\",\n \"in_proposal\": 1,\n \"game_type\": \"BAC\",\n \"play_type\": 1,\n \"amount\": 2000,\n \"valid_amount\": 0,\n \"win\": 0,\n \"flag\": 1,\n \"round_detail\": \"8 3 23 ; 45 26 17 | 4 | 1 | 8 | 0\",\n \"create_time\": 1668580007,\n \"reckon_time\": 1668580007,\n \"last_update_time\": 1668580007\n },\n \"rolling_unit\": 1000,\n \"ratio\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"uuid": "lobby1-82818443591811",
"timestamp": 1668580007001,
"data": {
"account": "c001",
"credit": 115,
"reserved": 100,
"balance": 215,
"platform_id": "H88",
"success_id": [
"005-200926080808-0000005",
"005-200926080808-0000006"
],
"fail_id": [
"005-200926080808-0000007"
]
}
}主體
application/json
⌘I