问题券支付
好热闹
获取所有券
这个接口有 5 分钟的缓存时间
Description
获取某个用户名下所有代金券和/或超级券
Method and URL Structure
Method |
Resource URL |
GET |
/cmd/?cmd=get_coupons |
Request Parameters
Name |
Description |
Required |
Default |
username |
用户名 |
Yes |
|
password |
密码 |
Yes |
|
page |
分页, 每页 5个 |
No |
1 |
Request
{
"username":"username",
"password":"password"
}
cURL Example
curl http://www.haorenao.cn/cmd/?cmd=get_coupons&username=12345678910&password=pwd1234
JSON Response
Name |
Description |
ret |
标识是否成功 ok, 成功; failed, 失败 |
reason |
失败原因,比如:身份验证失败 |
coupons |
代金券和/或超级券的集合 |
{
"ret":"ok",
"reason": "",
"coupons": [{
"status": "created",
"coupon_type_display": "\u4ee3\u91d1\u5238",
"amount": 5.0,
"expiry_date": "2016-02-26T14:22:47",
"coupon_no": "f41f290c09064a0ba02ccb888125a1a3",
"coupon_type": "voucher",
"status_display": "\u65b0\u5efa",
"id": 8,
"refer_count": 0
},
{
"status": "created",
"coupon_type_display": "\u8d85\u7ea7\u5238",
"amount": 5.0,
"expiry_date": "2016-02-26T14:22:44",
"coupon_no": "6bfbbe699119855ae2276259e52bdd67",
"coupon_type": "super",
"status_display": "\u65b0\u5efa",
"id": 7,
"refer_count": 200
}],
}
券的类型
Type |
Display |
Description |
super |
超级券 |
用于生成代金券,生成的子券的金额和到期时间与此券相同 |
voucher |
代金券 |
用于抵扣付款的代金券 |
券的状态
Status |
Display |
Description |
created |
新建 |
新生成的券 |
past_due |
过期 |
超过使用期限 |
cancled |
取消 |
后台取消 |
invalid |
无效 |
无效的券 |
超级券生成子券的接口和返回值
Description
- 用超级券为某个用户生成代金券
- 没有注册的用户生成的券会暂时放在运营帐号下面,注册时会把这个券转移到新帐号下面。
- 超级券只使用来生成子券, 不做抵扣用途。
Method and URL Structure
Method |
Resource URL |
GET |
/cmd/?cmd=request_coupon_with_parent |
Request Parameters
Name |
Description |
Required |
Default |
username |
用户名 |
Yes |
|
coupon_no |
超级券号码 |
Yes |
|
Request
{
"username":"username",
"coupon_no":"6bfbbe699119855ae2276259e52bdd67"
}
cURL Example
curl www.haorenao.cn/cmd/?cmd=request_coupon_with_parent&username=1234567810&coupon_no=6bfbbe699119855ae2276259e52bdd67
JSON Response
Name |
Description |
ret |
标识是否成功。ok, 成功; failed, 失败 |
reason |
失败原因,比如:身份验证失败 |
coupon_no |
新生成的代金券号 |
{
"ret": "ok",
"reason": "",
"coupon_no": "df584bcc73aadb66d409b3b3886ce40b",
}
- 没有注册的用户生成的券会暂时放在运营帐号下面,注册时会把这个券转移到新帐号下面。
- 超级券只使用来生成子券, 不做抵扣用途。
用代金券抵扣金额接口和返回值:
Description
支付定单时用代金券折扣应付金额
Method and URL Structure
Method |
Resource URL |
GET |
/forum/order_payment/ |
Request Parameters
Name |
Description |
Required |
Default |
username |
用户名 |
Yes |
|
password |
密码 |
Yes |
|
coupon_no |
代金券号码 |
[Yes] |
|
amount |
为订单设置一个新金额(大于原来的金额) |
NO |
0 |
channel |
支付渠道: wx OR aplipay |
Yes |
alopay |
order_no |
订单号 |
Yes |
|
Request
{
"username":"username",
"password":"password",
"amount":4.0,
"channel":"aplipay",
"order_no":"13261148068267331984",
"coupon_no":"f41f290c09064a0ba02ccb888125a1a3",
}
cURL Example
curl www.haorenao.cn/forum/order_payment/
JSON Response
Name |
Description |
ret |
标识是否成功。ok, 成功; failed, 失败 |
reason |
失败原因,比如:身份验证失败 |
charge |
ping++ 返回的用于微信或支付宝客户端的支付凭证 |
{
"ret": "ok",
"reason": "",
"charge":charge 对象
}
ret 是 "ok", 并且 charge 为 null, 视为代金券的金额可以抵扣全部订单金额,
不用再掉用支付宝或微信支付了。
订单的状态
Status |
Display |
Discript |
-3 |
超时 |
付款成功后,达人超过48小时没有回答 |
-2 |
拒绝 |
付款成功后,达人拒绝回答 |
-1 |
取消 |
付款前用户取消订单 |
0 |
新建 |
新件订单,未付款 |
1 |
已付款 |
付款成功,等待达人处理 |
2 |
完成 |
达人回答了问题 |
3 |
待付款 |
未完成付款,或付款过程中取消付款操作了 |
4 |
开始进行 |
达人开始进行服务 |
5 |
等待确认 |
等待客户确认完成订单 |
状态为 3(待付款)时,订单仍然可以再次付款,但是不能再使用代金券付款了。