Skip to content

docs: add example of exception response for tappayment's rest api #790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
3 commits merged into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .ci/hk/en/sdk/TapPayments/Global/tds-payments-global.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,21 @@ The return value is a JSON object of an order.
}
```

The only scenarios where the game server should use the REST API are when querying and validating orders. An example of an exception response is shown below:

```json
// 1004 - Order does not exist 1018 - Order verification error
{
"data" : {
"code" : 1004,
"error" : "order_not_found",
"error_description" : "Order does not exist",
"msg" : "Order does not exist"
},
"success" : false
}
```

#### Order Refund
Refund an order.

Expand All @@ -1040,9 +1055,9 @@ curl -X GET \

|Field | Meaning |
|--------------------|---------------|
|client_id | |
|user_id | |
|order_id | |
|client_id |Client ID |
|user_id |User OpenID |
|order_id |Order ID |
|order_token |Token used for verification |
|goods\_open\_id |Item ID |
|amount |Order Amount |
Expand Down
27 changes: 22 additions & 5 deletions .ci/hk/zh-Hans/sdk/TapPayments/Global/tds-payments-global.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ TapPayment.QueryOrder ( orderId, new ITapPayment.Callback < Order > ()

// 或者直接传递一个已存在的订单对象
Order order = new Order();
order.id = "订单ID";
order.id = "订单 ID";
TapPayment.QueryOrder ( orderId, new ITapPayment.Callback < Order > ()
{
...
Expand All @@ -586,7 +586,7 @@ TapPayment.queryOrder(orderId, new ITapPayment.Callback < Order >() {

// 或者直接传递一个已存在的订单对象
Order order = new Order();
order.id = "订单ID";
order.id = "订单 ID";

TapPayment.queryOrder(order, new ITapPayment.Callback < Order >() {
....
Expand Down Expand Up @@ -1203,6 +1203,23 @@ curl -X POST \
}
```

游戏服务端使用 REST API 应该只有「查询订单」以及「核销订单」的场景。异常响应示例如下所示:

```json
// 1004 - 订单不存在 1018 - 验证订单错误
{
"data" : {
"code" : 1004,
"error" : "order_not_found",
"error_description" : "订单不存在",
"msg" : "订单不存在"
},
"success" : false
}
```



#### 订单退款
对一个订单进行退款

Expand All @@ -1220,9 +1237,9 @@ curl -X GET \

|字段 | 含义 |
|--------------------|---------------|
|client_id | |
|user_id | |
|order_id | |
|client_id | 应用 Client ID |
|user_id | 用户 OpenID |
|order_id | 订单 ID |
|order_token |用于核销的 token |
|goods\_open\_id |商品 ID |
|amount |订单金额 |
Expand Down