加载中…

nextAction 参数使用详解

在线支付接口可传递 nextAction 参数,用来实现支付成功后下一步需要执行的功能: # 基础使用 ## 支付商城订单 ```json {type:0, id:1234} ``` 其中 id 为待支付订单的订单编号**【必须是自己的订单】**,请注意,是接口获取的 id 参数,纯数字的那个,不是 OD1807220151884127 那个, 同时支付多个订单,请使用英文逗号分隔,例如: ```json {type:0, id:"77,88,99"} ``` ## 支付知识付费订单 ```json {type:1, id:1234} ``` 其中 id 为待支付知识的数字编号,同上 ## 发送短信 ```json {type:2, smsId:111, mobile:"13500000000", postJsonString:{code:1234, product:"参数2"}} ``` _上面的配置说明,使用  111 这个短信设置通道,给 13500000000 发送短信,短信模板参数为: {code:1234, product:"参数2"}_ > 请先在后台 “工厂设置” --> “模块管理” 中启用“短信验证码” 模块 > _短信设置里面,增加一条类型是“普通短信”的短信设置(不要设置为验证码)_ ## 支付报名费 ```json {type:3, id:1234} ``` id 为报名记录的id,并不是报名项目的id,不要搞错 ## 优惠买单 ```json {type:4, shopId: 888, money: 消费金额} ``` 参数说明: + type 固定值4 + shopId 门店id,后期便于区分买单门店,方便后期按门店统计买单金额 + money 本次消费金额,填写优惠前的金额,不要填写优惠后的金额 ## 支付押金 ```json { "type": 5, "amount": 押金金额, "refCode": 业务编号, "remark": 备注, "extJsonStr": 扩展属性的JSON格式数据, } ``` ## 购买会员 ```json { "type": 6, "userLevelPriceId": "指定的会员等级对应的收费项目的ID,并不是会员等级ID,千万注意", "isAutoRenew": "到期后是否自动续期 true/false", "remark": 备注 } ``` ## 领取指定的优惠券 ```json { "type": 7, "couponRuleId": 1234, "pwd": "如果是口令优惠券,需要传入口令" } ``` couponRuleId 为优惠券规则id ## 支付京东京励订单 ```json { "type": 8, "token": "京东京励订单信息内存对应token", "couponId": 9908 } ``` token 京东京励回调支付信息后保存在内存信息的对应token; couponId 为本次支付使用的优惠券; ## 餐饮-扫码点餐-买单 ```json { "type": 9, "orderId": 1234, "couponId": 9908 } ``` orderId 为扫码点餐的待支付订单id,一般为6位数字,不是很长的那个订单号; couponId 为本次买单使用的优惠券,如果使用多张优惠券,请使用英文的逗号分隔; ## 购买会员卡 ```json {type:10, id:1234} ``` 其中 id 为会员卡ID ## 支付图片交易订单 ```json {type:11, id:1234} ``` 其中 id 为图片交易购买记录的id ## 购买社区团购的团长 ```json {type:12} ``` 无需其他参数,只需要传type=12即可 ## 购买分销商资格 ```json {type:13} ``` 无需其他参数,只需要传type=13即可 ## 购买合伙人模式下的团队长 ```json {type:14} ``` 无需其他参数,只需要传type=14即可 ## 购买合伙人模式下的合伙人 ```json {type:141} ``` 无需其他参数,只需要传type=141即可 ## 支付购买课程订单 ```json {type:15, id:1234} ``` id 为购买课程的记录ID,并非是课程ID,不要搞错 ## 创建新组织【按照收费项目严格匹配】 ```json {type:16, priceId: 88, name:'组织名称', remark: '组织备注'} ``` + priceId 为后台设置的组织收费记录的ID + name 组织名称 + remark 组织备注 ## 创建新组织【按照每人/时长自动计算价格】 ```json {type:161, maxMembers: 88, durationType: 0, duration: 2, name:'组织名称', remark: '组织备注'} ``` + maxMembers 购买组织规模人数 + durationType 时长类型 0 天 1 月 2 年 + duration 时长 + name 组织名称 + remark 组织备注 ## 升级组织规模【按照收费项目严格匹配】 ```json {type:17, organizeId: 77, priceId: 88} ``` + organizeId 组织ID + priceId 为后台设置的组织收费记录的ID ## 升级组织规模【按照每人/时长自动计算价格】 ```json {type:171, organizeId: 77, addMembers: 88, durationType: 0, addDuration: 2} ``` + organizeId 组织ID + addMembers 调整人数规模,正数增加人数,负数减少人数,0 不改变人数 + durationType 时长类型 0 天 1 月 2 年 + addDuration 增加时长,填0 代表保持到期日不变 ## 购买商品视频剧集 ```json {type:18, goodsId: 77, number: 88} ``` + goodsId 商品ID + number 购买第几集 ## 加钟 ```json {type:19, orderAddBellId: 77} ``` + orderAddBellId 加钟记录ID ## 支付跑腿任务订单 ```json {type:20, taskId: 77} ``` + taskId 跑腿任务ID ## 购买交友盲盒的解锁次数 ```json {type:21, pullTimes: 10} ``` + pullTimes 购买解锁次数 ## 支付并投放盲盒 ```json {type:22, boxId: 10} ``` + boxId 盲盒ID ## cp匹配活动-付费入场 ```json {type:23, cpactivityId: 10} ``` + cpactivityId CP活动ID ## 京东外卖支付 ```json {type:24} ``` + 内部使用,暂不对外 ## 支付赛事赛程报名费 ```json {type:25, id: 12334} ``` + type 固定 25 + id 为报名记录ID # 变量置换 type == 2 ,也就是说发送短信的时候,有时候参数有可能是变量,比如上述例子中 mobile ,product 有可能是变量,那么我们假设在后台 “系统参数配置” 里面,将 mobile 和 product 配置成了 SEND_MOBILE 和 SMS_PRODUCT_NAME 两个系统参数,那么上述的 nextAction 可改为: ```json {type:2, smsId:111, mobile:{from:"config", key:"SEND_MOBILE"}, postJsonString:{code:1234, product:{from:"config", key:"SMS_PRODUCT_NAME"}}} ``` # 嵌套 如果需要串联,也就是说,支付完成后,先完成订单的付款,然后再进行发送短信,可以在 nextAction 里面再嵌套 nextAction,例如: ```json {type:0, id:129192, nextAction:{type:2, smsId:111, mobile:"13500000000", postJsonString:{code:9988, product:"工厂"}}} ```