3.4下单并支付【推荐】
POST
checkoutOrder
接口描述
下单与支付合并一个接口,消费订单支付 ,卡付与手机支付共用此接口;用这种方式,所有订单皆为已支付状态;实现此接口,不必重复实现3.1、3.3接口,效果一样
请求参数
参数名
类型
描述
必填
token
String
登录TOKEN
必填
appid
String
商户appid
必填
amount
Double
订单金额,最多两位小数点
必填
product_id
Long
菜品 ID
必填
product_name
String
菜品名称
必填
price
Dount
菜品价格
必填
unit
String
菜品规格、单位,如份
必填
category_id
Long
菜品分类 ID
必填
payment
String
支付方式:CASH现金 ,CODE刷卡刷码手机支付(即非现金支付);202402增加 PHONE手机号消费
必填
card_no
String
当 payment 支付方式为 CASH 时,可以不传;为 CODE 时,必须传入。卡付时:可以为 会员卡序列号、动态会员码;【特别注意】手机支付时:可以为微信支付或支付宝的付款码;202402增加:手机号消费时,传入11位手机号码
可选
consume_type
String
扣费模式:TIME次卡,必传; BALANCE金额卡,可不传,默认扣费模式。
可选
wait
int
是否等待轮询:1等待,0不等待直接返回扫码结果;默认为等待
必填
响应参数
参数名
类型
描述
必填
code
int
错误码,成功返回 200,失败返回其它
必填
message
String
错误描述
必填
order_id
Long
订单 ID
必填
total_amount
Double
订单金额
必填
sale_date
String
下单时间, 时间格式为 yyyy-MM-dd HH:mm:ss
必填
customer_sn
String
会员卡号
必填
pay_status
int
支付状态
必填
trade_status
int
订单交易状态
必填
update_date
String
订单状态变更时间, 时间格式为 yyyy-MM-dd HH:mm:ss,此处同支付时间
必填
result_code
String
业务结果码,成功返回 SUCCESS【注意大写】,失败返回其它
必填
result_msg
String
业务成功返回ok,业务失败返回具体失败提示
必填