5.3会员卡交易

优质
小牛编辑
132浏览
2023-12-01

请在交易界面中输入金额后,微卡先调用5.4协议获取交易验证码,再提交交易

注意:平台已启用动态会员卡号,每次都会变化。需要记录会员卡号的场景,请使用接口返回参数中的mbno.

请求参数说明

参数描述必填示例值类型最大长度
action接口参数组object
└action需要调用的接口名称mb_transstring
getGET参数组,本组参数需要参与签名object
└action0:充值,1:消费number
└mbno卡号,兼容动态卡号47302320number
└amt交易金额100number
└points积分交易金额(例:100积分抵扣1元,points=100)300number
└subject备注摘要备注string
└ref关联业务单号12345678number
└vericode验证码(通卡则是卡密码)验证码string
└op操作员操作员string
└nobonus1:不处理线上奖励,默认为01number
└ptamt用于在会员消费时可以直接上传积分/赠券(action=1时有效))50number
└lsco批量核券id27207625number
└bonus赠送金额 (action=0时有效)100number
└createpay(action=1时有效)生成支付单记录(1=生成记录)1number
└ptrate积分支付比率(当createpay=1并且points>0必传,以便计算积分抵扣金额)100number
└iscompensated离线标识(1=离线模式交易补传)1number
└trantime离线模式下,交易实际发生的时间(格式:yyyyMMddHHmmss)20210107121212number
└market(createpay=1时有效)1=触发线上奖励活动,注:提交本参数时,禁止使用ptamt和5.2mb_points,否则会重复触发奖励1number
└paytype科目:wx(微信)、ali(支付宝)、bk(银行卡)、ca(现金) 根据后台科目管理上传bkstring

请求示例

{
	"action": {
		"action": "mb_trans"
	},
	"get": {
		"action": "1",
		"mbno": "47302320",
		"amt": "100",
		"points": "300",
		"subject": "备注",
		"ref": "12345678",
		"vericode": "验证码",
		"op": "操作员",
		"nobonus": "1",
		"ptamt": "50",
		"lsco": "27207625",
		"bonus": "100",
                "createpay": "1",
                "market": "1",
                "iscompensated": "1",
                "trantime": "20210107121212",
                "ptrate": "100",
                "paytype": "bk"
	}
}

响应参数说明

参数描述必填示例值类型最大长度
status返回状态。接口成功时为1,出错为01number
info错误时会返回相应的错误信息交易成功string
id会员交易流水号26956240number
bal会员卡余额5695.99
balance会员卡余额5695.99
cashAmt消费实际金额0.00number
bonusAmt本次消费赠送金额100number
bns_balance赠送金额39909.39number
pt本次增加积分100number
ptbalance积分余额410number
pt_return积分增加明细object
└id积分交易流水26956241number
└points积分增加100number
└balance积分余额410number
pt_result积分扣减明细object
└status状态:1成功 0失败1number
└info状态信息积分更新成功string
└id积分交易流水26956242number
└pt积分扣减-300number
└bal积分余额110number
resultobject
└status状态:1成功 0失败1number
└errcount0number
└colistlist
└└status1number
└└info优惠券使用成功string
└└coid券id27207625number
└└mbid平台id5759774number
└└cash券金额30.00number
└└cono券号码287076257395number
└└price券金额0number
└└subject备注赠送string
mbno会员卡号string
msid10021number
bonus本次储值赠送金额(当action=0时返回)100number

响应示例

{
  "status": "1",
  "info": "交易成功",
  "id": "26956240",
  "bal": 5695.99,
  "balance": 5695.99,
  "cashAmt": "0.00",
  "bonusAmt": "100",
  "bns_balance": "39909.39",
  "pt": 100,
  "bonus": 100,
  "ptbalance": 410,
  "pt_return": {
    "id": "26956241",
    "points": 100,
    "balance": 410
  },
  "pt_result": {
    "status": 1,
    "info": "积分更新成功",
    "id": "26956242",
    "pt": -300,
    "bal": 110
  },
  "result": {
    "status": 1,
    "errcount": 0,
    "colist": [
      {
        "status": 1,
        "info": "优惠券使用成功",
        "coid": "27207625",
        "mbid": "5759774",
        "cash": "30.00",
        "cono": "287076257395",
        "price": 0,
        "subject": "赠送"
      }
    ]
  },
  "mbno": "",
  "server_timestamp": 1566368182,
  "server_time": "2019-08-21 14:16:22",
  "server_name": "wx-task2.hz",
  "msid": "10021"
}

POST请求方式

支持单品券核销
pylsco=[
{
"coid":"26308703",
"no":"28*******722", // coid和no二选其一
"dgid":"4917938",
"cutamt":"0.01"
},
{
"coid":"26689866",// coid和no二选其一
"no":"28*******723",
"dgid":"4917938",
"cutamt":"0.01"
}
]

单品券核销,以上参数必传(coid和no二选其一即可)