# OrderMethodService
> 订单支付方式相关服务

---

## createOrderMethod
> 创建支付方式

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/OrderMethodService/createOrderMethod`
- RPC：`rpc createOrderMethod(CreateOrderMethodRequest) returns (CreateOrderMethodResponse);`

**请求对象 (`CreateOrderMethodRequest`)**

```json
{
  "name": "string // 支付名称",
  "code": "string // 支付代号",
  "description": "string // 支付描述",
  "url": "string // 自定义支付URL",
  "parentCode": "string // 使用预设支付方式代号",
  "paramsJSON": "bytes // 预设支付方式参数",
  "clientType": "string",
  "qrcodeTitle": "string"
}
```

**响应对象 (`CreateOrderMethodResponse`)**

```json
{
  "orderMethodId": "int64"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/OrderMethodService/createOrderMethod" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## deleteOrderMethod
> 删除支付方式

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/OrderMethodService/deleteOrderMethod`
- RPC：`rpc deleteOrderMethod(DeleteOrderMethodRequest) returns (RPCSuccess);`

**请求对象 (`DeleteOrderMethodRequest`)**

```json
{
  "orderMethodId": "int64"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/OrderMethodService/deleteOrderMethod" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findAllAvailableOrderMethods
> 查找所有已启用的支付方式

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/OrderMethodService/findAllAvailableOrderMethods`
- RPC：`rpc findAllAvailableOrderMethods(FindAllAvailableOrderMethodsRequest) returns (FindAllAvailableOrderMethodsResponse);`

**请求对象 (`FindAllAvailableOrderMethodsRequest`)**

```json
{}
```

**响应对象 (`FindAllAvailableOrderMethodsResponse`)**

```json
{
  "orderMethods": "[]OrderMethod"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/OrderMethodService/findAllAvailableOrderMethods" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findAllEnabledOrderMethods
> 查找所有支付方式

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/OrderMethodService/findAllEnabledOrderMethods`
- RPC：`rpc findAllEnabledOrderMethods(FindAllEnabledOrderMethodsRequest) returns (FindAllEnabledOrderMethodsResponse);`

**请求对象 (`FindAllEnabledOrderMethodsRequest`)**

```json
{}
```

**响应对象 (`FindAllEnabledOrderMethodsResponse`)**

```json
{
  "orderMethods": "[]OrderMethod"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/OrderMethodService/findAllEnabledOrderMethods" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findEnabledOrderMethod
> 查找单个支付方式

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/OrderMethodService/findEnabledOrderMethod`
- RPC：`rpc findEnabledOrderMethod(FindEnabledOrderMethodRequest) returns (FindEnabledOrderMethodResponse);`

**请求对象 (`FindEnabledOrderMethodRequest`)**

```json
{
  "orderMethodId": "int64"
}
```

**响应对象 (`FindEnabledOrderMethodResponse`)**

```json
{
  "orderMethod": "OrderMethod"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/OrderMethodService/findEnabledOrderMethod" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findEnabledOrderMethodWithCode
> 根据代号查找支付方式

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/OrderMethodService/findEnabledOrderMethodWithCode`
- RPC：`rpc findEnabledOrderMethodWithCode(FindEnabledOrderMethodWithCodeRequest) returns (FindEnabledOrderMethodWithCodeResponse);`

**请求对象 (`FindEnabledOrderMethodWithCodeRequest`)**

```json
{
  "code": "string"
}
```

**响应对象 (`FindEnabledOrderMethodWithCodeResponse`)**

```json
{
  "orderMethod": "OrderMethod"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/OrderMethodService/findEnabledOrderMethodWithCode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateOrderMethod
> 修改支付方式

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/OrderMethodService/updateOrderMethod`
- RPC：`rpc updateOrderMethod(UpdateOrderMethodRequest) returns (RPCSuccess);`

**请求对象 (`UpdateOrderMethodRequest`)**

```json
{
  "orderMethodId": "int64",
  "name": "string // 名称",
  "code": "string",
  "description": "string // 描述（备注）",
  "url": "string",
  "paramsJSON": "bytes // 预设支付方式参数",
  "isOn": "bool // 是否启用",
  "clientType": "string",
  "qrcodeTitle": "string"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/OrderMethodService/updateOrderMethod" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---
