[关闭]
@chengxuyuan 2019-07-17T08:14:21.000000Z 字数 1476 阅读 300

余额

橙旭园儿童编程


获取余额

whoami 接口也会返回余额,字段名 balance

Method and URL Structure

Method Resource URL Authorization
GET /server/balance/ YES

cURL Example

  1. curl -X GET http://localhost/server/balance/

Response Data

Name Description
pk id
owner 用户
amount 金额
withdraw_amount 已结算金额
record_amount 交易总额

Response

  1. {
  2. "pk":1,
  3. "owner":"test_003",
  4. "amount":"19.80",
  5. "withdraw_amount": "10.00",
  6. "record_amount": "29.80",
  7. "create_time":"2018-03-30T10:49:19.543563"
  8. }

获取余额记录

whoami 接口也会返回余额,字段名 balance

Method and URL Structure

Method Resource URL Authorization
GET /server/balance/record/ YES

cURL Example

  1. curl -X GET http://localhost/server/balance/record/

Response Data

Name Description
pk id
owner 用户
amount 金额
record_type 类型
extra 备注

Response

  1. {
  2. "count":4,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "pk":6,
  7. "owner":"test_003",
  8. "amount":"-3.90",
  9. "extra":"",
  10. "record_type":"支付",
  11. "create_time":"2017-11-13T16:34:29.433586"
  12. },{
  13. "pk":5,
  14. "owner":"test_003",
  15. "amount":"9.90",
  16. "extra":"",
  17. "record_type":"奖学金",
  18. "create_time":"2017-11-13T16:34:29.431315"
  19. },{
  20. "pk":4,
  21. "owner":"test_003",
  22. "amount":"-3.90",
  23. "extra":"",
  24. "record_type":"支付",
  25. "create_time":"2017-11-13T16:34:29.429003"
  26. },{
  27. "pk":3,
  28. "owner":"test_003",
  29. "amount":"9.90",
  30. "extra":"",
  31. "record_type":"奖学金",
  32. "create_time":"2017-11-13T16:34:29.426718"
  33. }]
  34. }

提现

Method and URL Structure

Method Resource URL Authorization
POST /server/balance/withdraw/ YES

cURL Example

  1. curl -X POST --data '{...}' http://localhost/server/balance/withdraw/

Request Pramaters

Name Description
amount 金额
extra 备注:支付账号等信息

Request Data

  1. {
  2. "amount": 33.3,
  3. "extra": "支付宝:xxxx_yyy,
  4. 名字:小明,
  5. 日期:2018-03-30"
  6. }

Response

`
{
"message": "",
"status": 0,
}

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注