[关闭]
@yaohang 2016-10-28T07:34:11.000000Z 字数 720 阅读 773

话费充值系统接口说明


在此输入正文

1.提交号码及金额

接口格式:domain/?phone_number=XXX&money=XXX
带两个参数:phone_number以及money,示例:127.0.0.1/?phone_number=18382016047&money=10

请求方式为GET,返回数据如下:

{
"ID": "201610281525579647895658",
"money": 10,
"phone_number": 18382016047,
"stat": "success"
}

ID为生成的唯一订单号,主要用来查询充值状态。

报错信息如下:

{
"message": {
"money": "Missing required parameter in the JSON body or the post body or the query string"
}
}

2.查询

接口格式:domain/query?ID=201610221115170494715489
只有一个参数就是提交时生成的ID,如果成功返回如下:

{
"mobile_order_id": "202000120161018116835396",
"money": "10",
"phone_number": "18382016047",
"result": "success"
}

result为充值结果,有successfailure两种。

如果提交的ID不存在,返回如下:
{
"error": "No query to the corresponding ID, please try again later"
}

注意,有可能当前ID正在充值过程中,这时是无法查询到的,所以如果暂时返回这种结果,请过一段时间再试(一般1分钟查询一次差不多吧,也不要太频繁)

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