This commit is contained in:
songliang 2023-07-15 15:51:40 +08:00
parent 4e49a9fe6c
commit 1ac67a6007
2 changed files with 115 additions and 13 deletions

View File

@ -122,18 +122,113 @@
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=MarketSellOrderOk>
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| tokenId | string | 是 | google or apple |
| owner | string | 是 | 订单表,一次返回多个 |
| nftToken | string | 是 | 签名 |
| amount | string | 是 | 签名 |
| orderId | string | 是 | 签名 |
| currency | string | 是 | 签名 |
| price | string | 是 | 签名 |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```
5. Market下架商品回调
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=MarketCancelOrderOk>
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| orderId | string | 是 | google or apple |
| nftToken | array | 是 | 订单表,一次返回多个 |
| tokenId | string | 是 | 签名 |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```
6. Market更新商品价格回调
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=MarketPriceUpdateOrderOk>
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| orderId | string | 是 | google or apple |
| nftToken | array | 是 | 订单表,一次返回多个 |
| tokenId | string | 是 | 签名 |
| priceOld | string | 是 | 签名 |
| price | string | 是 | 签名 |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```
7. Market购买商品回调
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=MarketBuyOrderOk>
参数说明:
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| tokenId | string | 是 | 签名 |
| orderId | string | 是 | 签名 |
| nftToken | string | 是 | 签名 |
| amount | string | 是 | 签名 |
| seller | string | 是 | 签名 |
| buyer | string | 是 | 签名 |
| crc20 | string | 是 | 签名 |
| price | string | 是 | 签名 |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```
8. Maket购买商品回调(仅支持金币)
地址: <https://game2006api-test.kingsome.cn/webapp/index.php?c=Callback&a=dispatch&action=GameItemMarketBuyOk>
参数说明:
| 参数名 | 类型 |必填 | 说明 |
| ----------- | ------- | ---- | ------------------------------------------------- |
| address | string | 是 | 用户钱包地址 |
| order_id | string | 是 | 购买订单id |
返回说明:
```javascript
{
"errcode": 0, //0成功 1已发货 2订单不存在
"errmsg": ""
}
```

View File

@ -5,7 +5,7 @@ namespace services;
require_once('phpcommon/bchelper.php');
require_once('services/callback/BuyPassCbService.php');
require_once('services/callback/BuyShopGoodsCbService.php');
require_once ('services/callback/common/SignatureService.php');
require_once('services/callback/common/SignatureService.php');
require_once('ShopAddItemService.php');
use phpcommon\SqlHelper;
@ -29,7 +29,7 @@ class GameItemMarketBuyOk
'order_id' => $orderId
)
);
//1已发货 2订单不存在
//1已发货 2订单不存在 3订单模式错误
if (!$orderDb) {
echo json_encode(array(
'errcode' => 2,
@ -69,6 +69,14 @@ class GameItemMarketBuyOk
));
}
break;
default:
// 这里不应该出现其他模式,内部错误
echo json_encode(array(
'errcode' => 3,
'errmsg' => "order mode error.",
));
die();
break;
}
echo json_encode(array(
@ -92,16 +100,16 @@ class GameItemMarketBuyOk
private function _updateOrderState($address, $transId)
{
SqlHelper::update(
myself()->_getMysql($address),
't_bc_order',
array(
'order_id' => $transId
),
array(
'status' => 1,
'modifytime' => myself()->_getNowTime(),
)
);
myself()->_getMysql($address),
't_bc_order',
array(
'order_id' => $transId
),
array(
'status' => 1,
'modifytime' => myself()->_getNowTime(),
)
);
}
private function buyFromMarket($order, $idx)
@ -165,5 +173,4 @@ class GameItemMarketBuyOk
ShopBuyRecord::addWithAddress($address, $id, $goods_num);
}
}
}