第二部分  接口测试用例
2.4.2.2 电子凭证协议
商家请认真填写，调试完成后做成文档，发送给快手技术进行审核！！！
一、通知发码接口测试用例
测试场景	请求报文（商家填写）	响应报文（商家填写）	截图（商家补充）
收单成功（重要！！！）	appkey=ks660621772091030245&version=1&timestamp=1782966971471&signMethod=MD5&param=%7B%22oid%22%3A%22SUCCESS_1782966971471%22%2C%22sellerId%22%3A%222174425348%22%2C%22num%22%3A2%2C%22itemId%22%3A%2220842040339391%22%2C%22skuId%22%3A%2287457167264391%22%2C%22itemTitle%22%3A%22%E6%B5%8B%E8%AF%95%E7%94%B5%E5%AD%90%E5%87%AD%E8%AF%81%22%2C%22sendType%22%3A%22VIRTUAL%22%2C%22eticketType%22%3A%22DINING_OPEN_TICKET%22%2C%22token%22%3A%22token-success-1782966971471%22%2C%22certExpireType%22%3A1%2C%22certStartTime%22%3A1782966971471%2C%22certEndTime%22%3A1814502971471%2C%22certActualStartTime%22%3A1782966971471%2C%22certActualEndTime%22%3A1814502971471%7D&sign=573c1159de0164632b97d7c38a3e17df	{"result":1,"error_msg":"","data":{"oid":"SUCCESS_1782966971471","sendType":"VIRTUAL","sendNum":2,"etickets":[{"id":"67","status":"UNUSED","num":1,"validStartTime":1782966971471,"validEndTime":1814502971471,"eticketType":"DINING_OPEN_TICKET"},{"id":"68","status":"UNUSED","num":1,"validStartTime":1782966971471,"validEndTime":1814502971471,"eticketType":"DINING_OPEN_TICKET"}]}}	商家补充截图
拒单场景：appkey 未传入
（快手按 10s、30s、1min、2min、3min… 策略重试，最多 16 次）	version=1&timestamp=1782966971487&signMethod=MD5&param=%7B%22oid%22%3A%22NOKEY_1782966971487%22%2C%22sellerId%22%3A%222174425348%22%2C%22num%22%3A1%2C%22itemId%22%3A%2220842040339391%22%2C%22sendType%22%3A%22VIRTUAL%22%2C%22token%22%3A%22token-nokey-1782966971487%22%2C%22certExpireType%22%3A3%2C%22certExpDays%22%3A30%2C%22certActualStartTime%22%3A1782966971487%2C%22certActualEndTime%22%3A1785558971487%7D&sign=6d07ef1b34dae634722085e69998d5ce	{"result":4010003,"error_msg":"appkey 不匹配","data":null}	商家补充截图
拒单场景：签名错误
（快手按 10s、30s、1min、2min、3min… 策略重试，最多 16 次）	appkey=ks660621772091030245&version=1&timestamp=1782966971496&signMethod=MD5&param=%7B%22oid%22%3A%22BADSIGN_1782966971496%22%2C%22sellerId%22%3A%222174425348%22%2C%22num%22%3A1%2C%22itemId%22%3A%2220842040339391%22%2C%22sendType%22%3A%22VIRTUAL%22%2C%22token%22%3A%22token-badsign-1782966971496%22%2C%22certExpireType%22%3A3%2C%22certExpDays%22%3A30%2C%22certActualStartTime%22%3A1782966971496%2C%22certActualEndTime%22%3A1785558971496%7D&sign=00000000000000000000000000000000	{"result":4010003,"error_msg":"签名验证失败","data":null}	商家补充截图
拒单场景：参数缺失（缺少 oid）
（快手按 10s、30s、1min、2min、3min… 策略重试，最多 16 次）	appkey=ks660621772091030245&version=1&timestamp=1782966971499&signMethod=MD5&param=%7B%22sellerId%22%3A%22123%22%2C%22num%22%3A1%2C%22sendType%22%3A%22VIRTUAL%22%7D&sign=154c203c15b779c708bc3a1e508ba78d	{"result":4010003,"error_msg":"缺少 oid","data":null}	商家补充截图

二、查询发码结果接口测试用例
测试场景	请求报文（商家填写）	响应报文（商家填写）	截图（商家补充）
查询成功：返回卡券信息（全部卡券）	appkey=ks660621772091030245&version=1&timestamp=1782966971504&signMethod=MD5&param=%7B%22oid%22%3A%22TEST_CASE_1782966971344%22%2C%22sendType%22%3A%22VIRTUAL%22%7D&sign=9a012f1aa5843082ee6ed63961bd3173	{"result":1,"error_msg":"","data":{"oid":"TEST_CASE_1782966971344","sendType":"VIRTUAL","sendNum":3,"etickets":[{"id":"64","status":"UNUSED","num":1,"validStartTime":1782966971344,"validEndTime":1785558971344},{"id":"65","status":"UNUSED","num":1,"validStartTime":1782966971344,"validEndTime":1785558971344},{"id":"66","status":"UNUSED","num":1,"validStartTime":1782966971344,"validEndTime":1785558971344}]}}	商家补充截图
查询成功：返回卡券信息（指定 eticketId）	appkey=ks660621772091030245&version=1&timestamp=1782966971509&signMethod=MD5&param=%7B%22oid%22%3A%22TEST_CASE_1782966971344%22%2C%22eticketId%22%3A%2264%22%2C%22sendType%22%3A%22VIRTUAL%22%7D&sign=2c49920c246566219d448e9837299d7f	{"result":1,"error_msg":"","data":{"oid":"TEST_CASE_1782966971344","sendType":"VIRTUAL","sendNum":1,"etickets":[{"id":"64","status":"UNUSED","num":1,"validStartTime":1782966971344,"validEndTime":1785558971344}]}}	商家补充截图
查询失败：返回卡券不存在
必须返回错误码「4012005」	appkey=ks660621772091030245&version=1&timestamp=1782966971512&signMethod=MD5&param=%7B%22oid%22%3A%22TEST_CASE_1782966971344%22%2C%22eticketId%22%3A%2299999%22%2C%22sendType%22%3A%22VIRTUAL%22%7D&sign=90e584abb3d92a857175af1e8b235747	{"result":4012005,"error_msg":"卡券不存在: 99999","data":null}	商家补充截图
查询失败：订单不存在
必须返回错误码「4012002」	appkey=ks660621772091030245&version=1&timestamp=1782966971516&signMethod=MD5&param=%7B%22oid%22%3A%22NOT_EXIST_1782966971516%22%2C%22sendType%22%3A%22VIRTUAL%22%7D&sign=1a55c5588006c0de81122a213aac714c	{"result":4012002,"error_msg":"订单不存在: NOT_EXIST_1782966971516","data":null}	商家补充截图

三、关单 / 销毁接口测试用例
测试场景	请求报文（商家填写）	响应报文（商家填写）	截图（商家补充）
关单/销毁成功（指定卡券 DESTROYED）
（注意：不存在的订单，请返回关单成功）	appkey=ks660621772091030245&version=1&timestamp=1782966971518&signMethod=MD5&param=%7B%22oid%22%3A%22TEST_CASE_1782966971344%22%2C%22reason%22%3A%22USER_APPLY_REFUND%22%2C%22etickets%22%3A%5B%7B%22id%22%3A%2264%22%2C%22num%22%3A1%2C%22goodsValue%22%3A100%7D%5D%7D&sign=098882a0a3ef3ccf4abe56aad9927f80	{"result":1,"error_msg":"","data":{"oid":"TEST_CASE_1782966971344"}}	商家补充截图
销毁后验证卡券状态为 DESTROYED	appkey=ks660621772091030245&version=1&timestamp=1782966971525&signMethod=MD5&param=%7B%22oid%22%3A%22TEST_CASE_1782966971344%22%2C%22eticketId%22%3A%2264%22%2C%22sendType%22%3A%22VIRTUAL%22%7D&sign=72b9574b73af8353c5f060469b5213ad	{"result":1,"error_msg":"","data":{"oid":"TEST_CASE_1782966971344","sendType":"VIRTUAL","sendNum":1,"etickets":[{"id":"64","status":"DESTROYED","num":1,"validStartTime":1782966971344,"validEndTime":1785558971344}]}}	商家补充截图
关单/销毁成功（整单销毁，不传 etickets）	appkey=ks660621772091030245&version=1&timestamp=1782966971528&signMethod=MD5&param=%7B%22oid%22%3A%22TEST_CASE_1782966971344%22%2C%22reason%22%3A%22ETICKET_EXPIRED%22%7D&sign=cda4984e91bef29e7aa1c65b4d208553	{"result":1,"error_msg":"","data":{"oid":"TEST_CASE_1782966971344"}}	商家补充截图
关单/销毁成功（订单不存在，也必须返回成功）	appkey=ks660621772091030245&version=1&timestamp=1782966971538&signMethod=MD5&param=%7B%22oid%22%3A%22FAKE_DESTROY_1782966971538%22%2C%22reason%22%3A%22ETICKET_EXPIRED%22%7D&sign=b5c9ebf65c1b9d535d8dad0ac55775c4	{"result":1,"error_msg":"","data":{"oid":"FAKE_DESTROY_1782966971538"}}	商家补充截图

四、发码回调接口
📌 注意：该接口由商家发起。请调用快手线上地址，出现"订单不存在"即可视为调试通过！
接口: POST https://openapi.kwaixiaodian.com/integration/virtual/eticket/callback
测试场景	请求参数（商家提供）	请求报文（商家填写）	响应报文（商家填写）	截图（商家补充）
卡券发码	oid: "2319200000001216"
etickets: [{"id":"67","code":"","num":1,"status":"ISSUED"}]
token: "token-success-1782966971471"	access_token=xxx&appkey=ks660621772091030245&method=integration.virtual.eticket.callback&param=%7B%22oid%22%3A%222319200000001216%22%2C%22etickets%22%3A%5B%7B%22id%22%3A%2267%22%2C%22num%22%3A1%2C%22status%22%3A%22ISSUED%22%7D%5D%2C%22token%22%3A%22token-success-1782966971471%22%7D&signMethod=MD5&timestamp=1782966971471&version=1&sign=xxx	调用快手正式环境，出现"订单不存在"即为通过	商家补充截图

五、核销回调接口（可选，取决商家选择的对接方案）
📌 注意：该接口由商家发起。请调用快手线上地址，出现"订单不存在"即可视为调试通过！
接口: POST https://openapi.kwaixiaodian.com/integration/callback/virtual/eticket/consume
测试场景	请求参数（商家提供）	请求报文（商家填写）	响应报文（商家填写）	截图（商家补充）
卡券核销	oid: "2319200000001216"
etickets: [{"id":"67","num":1,"goodsValue":10}]
status: "CONSUMED"
consumeType: "consume"
storeName: "测试门店"
storeAddress: "测试地址"
seriallNum: "SN202607020001"
token: "token-success-1782966971471"
consumeTime: 1782966971471	access_token=xxx&appkey=ks660621772091030245&method=integration.callback.virtual.eticket.consume&param=%7B%22oid%22%3A%222319200000001216%22%2C%22etickets%22%3A%5B%7B%22id%22%3A%2267%22%2C%22num%22%3A1%2C%22goodsValue%22%3A10%7D%5D%2C%22status%22%3A%22CONSUMED%22%2C%22consumeType%22%3A%22consume%22%2C%22storeName%22%3A%22%E6%B5%8B%E8%AF%95%E9%97%A8%E5%BA%97%22%2C%22storeAddress%22%3A%22%E6%B5%8B%E8%AF%95%E5%9C%B0%E5%9D%80%22%2C%22seriallNum%22%3A%22SN202607020001%22%2C%22token%22%3A%22token-success-1782966971471%22%2C%22consumeTime%22%3A1782966971471%7D&signMethod=MD5&timestamp=1782966971471&version=1&sign=xxx	调用快手正式环境，出现"订单不存在"即为通过	商家补充截图

六、销毁回调接口（可选，取决商家选择的对接方案）
📌 注意：该接口由商家发起。请调用快手线上地址，出现"订单不存在"即可视为调试通过！
接口: POST https://openapi.kwaixiaodian.com/integration/callback/virtual/eticket/destroy
测试场景	请求参数（商家提供）	请求报文（商家填写）	响应报文（商家填写）	截图（商家补充）
销毁成功	oid: "2319200000001216"
etickets: [{"id":"67","num":1,"goodsValue":100}]
reason: "ETICKET_EXPIRED"
token: "token-success-1782966971471"	access_token=xxx&appkey=ks660621772091030245&method=integration.callback.virtual.eticket.destroy&param=%7B%22oid%22%3A%222319200000001216%22%2C%22etickets%22%3A%5B%7B%22id%22%3A%2267%22%2C%22num%22%3A1%2C%22goodsValue%22%3A100%7D%5D%2C%22reason%22%3A%22ETICKET_EXPIRED%22%2C%22token%22%3A%22token-success-1782966971471%22%7D&signMethod=MD5&timestamp=1782966971471&version=1&sign=xxx	调用快手正式环境，出现"订单不存在"即为通过	商家补充截图
