- 单品优惠退款的时候,有时候可以部分退,有时候又提示“请全额退款”
微信单品优惠退款排查 ## 背景 同一个商户,同一个满5000-300的单品活动,同一个商品,有的订单可以部分退款,有的订单无法部分退款,提示请全额退款错误 经过认真检查,没有违反任何单品优惠退款的规则,订单金额=单品总价,退款商品goods_id正确,退款金额<订单总金额 退款均请求单品退款接口:https://api.mch.weixin.qq.com/secapi/pay/refundv2 ### 可部分退款订单:4200002014202311119476757956 **支付请求参数** "request_body": { "body": "XX商城小程序", "total_fee": 500000, "fee_type": "CNY", "spbill_create_ip": "172.22.193.194", "notify_url": "XXXXXXXXXX", "trade_type": "JSAPI", "out_trade_no": "3023111148957838433321", "sub_appid": "wx69XXXXX494428ce", "time_start": "20231111213557", "time_expire": "20231111214057", "product_id": "3023111148957838433321", "device_info": "1212021-XX", "detail": "{\"goods_detail\":[{\"goods_id\":\"71936\",\"goods_name\":\"XX心 · 客房餐饮XX\",\"quantity\":50,\"price\":10000}]}", "sub_openid": "oy_u45WwvobyFziWCmkj-x4EqFiw", "scene_info": "{\"store_info\":{\"id\":\"XXX\",\"name\":\"XXXXXXXu5e97\\u603b\\u90e8\"}}", "profit_sharing": "Y", "version": "1.0", "appid": "wx0b0XXXXXXdef401", "mch_id": "122XXXX702", "sub_mch_id": "155XXXX491", "nonce_str": "siTadfoWbj7Gq93v", "sign": "D29416D6AB3AD9762E7C1D75240E0349" } "response_body": { "return_code": "SUCCESS", "return_msg": "OK", "result_code": "SUCCESS", "mch_id": "122xxxx702", "appid": "wx0b0XXXXdef401", "openid": "ox-6_wcki8OY-zeRZkwhhcjCTuLY", "is_subscribe": "N", "sub_mch_id": "155XXXX491", "sub_appid": "wx692XXXXX4428ce", "sub_openid": "oy_u45WwvobyFziWCmkj-x4EqFiw", "sub_is_subscribe": "N", "device_info": "1212021-xxxx", "trade_type": "JSAPI", "trade_state": "SUCCESS", "bank_type": "BOC_DEBIT", "total_fee": "500000", "fee_type": "CNY", "cash_fee": "470000", "cash_fee_type": "CNY", "transaction_id": "4200002014202311119476757956", "out_trade_no": "3023111148957838433321", "attach": [], "time_end": "20231111213603", "trade_state_desc": "支付成功", "nonce_str": "q4FKsxJkNCtu52GH", "sign": "7E130582C72667A31F50BA26CD0889ED", "promotion_detail": "{\"promotion_detail\":[{\"promotion_id\":\"53124272468\",\"name\":\"满5000减300\",\"scope\":\"SINGLE\",\"type\":\"DISCOUNT\",\"amount\":30000,\"activity_id\":\"18078318\",\"wxpay_contribute\":0,\"merchant_contribute\":30000,\"other_contribute\":0,\"goods_detail\":[{\"goods_id\":\"71936\",\"quantity\":50,\"price\":10000,\"discount_amount\":30000,\"goods_remark\":\"\"}]}]}", "version": "1.0" } **退请求参数** "request_body": { "out_refund_no": "2024021562697832923106", "out_trade_no": "3023111148957838433321", "total_fee": 500000, "refund_fee": 230000, "op_user_id": "10001", "notify_url": "XXXXXX", "detail": "{\"goods_detail\":[{\"goods_id\":\"71936\",\"goods_name\":\"XX心 · 客房餐饮XX\",\"price\":10000,\"refund_amount\":230000,\"refund_quantity\":23}]}", "sign_type": "HMAC-SHA256", "appid": "wx0XXX0cdef401", "mch_id": "122XXXX702", "sub_mch_id": "155XXXX491", "nonce_str": "Q95duFlEUJDcgr6X", "sign": "15fa8006b1d099dc754fcc15cbe57589e91b2024d3cebc46c6eeda276b732290" }, "response_body": { "return_code": "SUCCESS", "return_msg": "OK", "result_code": "SUCCESS", "appid": "wx0bXXXXXXef401", "mch_id": "122XXXX02", "sub_mch_id": "155XXXX491", "nonce_str": "ZbvMY8fjFschuRDj", "sign": "A8C06222CE4EDA086BA7960CC60F713C8F8EC68DB3739070AC3B32749431B7BF", "transaction_id": "4200002014202311119476757956", "out_trade_no": "3023111148957838433321", "out_refund_no": "2024021562697832923106", "refund_id": "50303207872024021521876165951", "refund_fee": "230000", "total_fee": "500000", "cash_fee": "470000", "cash_refund_fee": "216200", "promotion_detail": "{\"promotion_detail\":[{\"promotion_id\":\"53124272468\",\"scope\":\"SINGLE\",\"type\":\"DISCOUNT\",\"refund_amount\":13800,\"goods_detail\":[{\"goods_id\":\"71936\",\"price\":10000,\"refund_amount\":230000,\"refund_quantity\":23}]}]}" }, ----------------------- ### 不可退款订单:4200002010202311116838410445 **支付请求参数** "request_body": { "body": "XX商城小程序", "total_fee": 500000, "fee_type": "CNY", "spbill_create_ip": "172.22.193.31", "notify_url": "XXXXX", "trade_type": "JSAPI", "out_trade_no": "3023111152203967073128", "sub_appid": "wx692XXXXX4428ce", "time_start": "20231111223003", "time_expire": "20231111223503", "product_id": "3023111152203967073128", "device_info": "1212021-xxxx", "detail": "{\"goods_detail\":[{\"goods_id\":\"71936\",\"goods_name\":\"XX心 · 客房餐饮XX\",\"quantity\":50,\"price\":10000}]}", "sub_openid": "oy_u45RFEpxpXlXqvX-EA569YD1U", "scene_info": "{\"store_info\":{\"id\":\"xx\",\"name\":\"\xxxxx9152\\u5e97\\u603b\\u90e8\"}}", "profit_sharing": "Y", "version": "1.0", "appid": "wx0b0xxxxx0cdef401", "mch_id": "122xxxx702", "sub_mch_id": "155xxxx491", "nonce_str": "yVnRDQzKfIE9uY0c", "sign": "20AFDF50FBB4F3CE2BCF9CA5937186C5" }, "response_body": { "return_code": "SUCCESS", "return_msg": "OK", "result_code": "SUCCESS", "mch_id": "122xxxx702", "appid": "wx0b0xxxx0cdef401", "openid": "ox-6_wZdP7Sgn80HQCe884JPdLeU", "is_subscribe": "N", "sub_mch_id": "155xxxx491", "sub_appid": "wx6924xxxxx4428ce", "sub_openid": "oy_u45RFEpxpXlXqvX-EA569YD1U", "sub_is_subscribe": "N", "device_info": "1212021-xxxx", "trade_type": "JSAPI", "trade_state": "SUCCESS", "bank_type": "GDB_CREDIT", "total_fee": "500000", "fee_type": "CNY", "cash_fee": "470000", "cash_fee_type": "CNY", "transaction_id": "4200002010202311116838410445", "out_trade_no": "3023111152203967073128", "attach": [], "time_end": "20231111223054", "trade_state_desc": "支付成功", "nonce_str": "nE9X7XhhnzcahN6J", "sign": "F4C9CDB98CEF2DFC757642F7B4A6E893", "promotion_detail": "{\"promotion_detail\":[{\"promotion_id\":\"53154054603\",\"name\":\"满5000减300\",\"scope\":\"SINGLE\",\"type\":\"DISCOUNT\",\"amount\":30000,\"activity_id\":\"18078318\",\"wxpay_contribute\":0,\"merchant_contribute\":30000,\"other_contribute\":0,\"goods_detail\":[{\"goods_id\":\"71936\",\"quantity\":50,\"price\":10000,\"discount_amount\":30000,\"goods_remark\":\"\"}]}]}", "version": "1.0" }, **退款请求参数** "request_body": { "out_refund_no": "2024020245284475031230", "out_trade_no": "3023111152203967073128", "total_fee": 500000, "refund_fee": 330000, "op_user_id": "10001", "notify_url": "xxxxxx", "detail": "{\"goods_detail\":[{\"goods_id\":\"71936\",\"goods_name\":\"凯悦心 · 客房餐饮随心兑\",\"price\":10000,\"refund_amount\":330000,\"refund_quantity\":33}]}", "sign_type": "HMAC-SHA256", "appid": "wx0bxxxxdef401", "mch_id": "122xxxx702", "sub_mch_id": "155xxxx491", "nonce_str": "kIRzqiy7jQVuUG8g", "sign": "ef70bbd28f6eba1e89050795ff001a9b21e2177fb183bcf762f5e4f556918e45" }, "response_body": { "return_code": "SUCCESS", "return_msg": "OK", "result_code": "FAIL", "err_code": "ERROR", "err_code_des": "请使用全额退款", "appid": "wx0bxxxxxcdef401", "mch_id": "122xxxx702", "sub_mch_id": "155xxxx491", "nonce_str": "ce54FDPJVyt5728F", "sign": "341A2EEF78AC62B80D5EE1D39FE68FFF1E27C506F2AC8A3D0C871A0BEF5CEAFB" }, 敏感信息均使用XXXX脱敏,应该有微信单号即可,如果需要更详细的信息请回复留言,谢谢
02-27 - 合单查询订单API,如何判断支付成功?
根据合单支付接口文档的返回参数,并没有一个顶层的trade_state交易状态字段,而是在sub_orders里面有各自的trade_state,这就带来一个问题,如何判断这笔合单支付交易是成功的,是否会存在部分成功部分失败,甚至各种状态组合出现,如果各个子单状态会出现不一致的情况,那就不是一个事务,合单支付也就失去了意义 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter5_1_11.shtml 1、是不是要循环sub_orders判断所有子单的状态为SUCCESS 2、假设3个子单,是否会出现两个成功一个失败的情况
2023-07-05 - 获取标签下用户粉丝列表,system error?
背景: 调用接口:https://api.weixin.qq.com/cgi-bin/user/tag/get?access_token=XXX 官方文档 5. 获取标签下粉丝列表 https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html 商户需要将默认组内的所有粉丝转移到其他组,因此第一次使用该接口获取默认组所有openid,同时记录下最后一页的nextOpenId 公众号appid: wx7528cd11366548ad nextOpenid: o4zAjtzy6UvQr6CJ9S1sBw5cSPW8 过了一周,再获取新增粉丝openid,无论是传入上次的nextOpenId还是不传均无法得到返回 1、不传nextopenid,返回 {"errcode":-1,"errmsg":"system error hint: [HFIa.nyWf-iz3MsA] rid: 61e63f19-008b1085-437e3493"} 2、传上一次记录的默认组最后一页nextopenid:o4zAjtzy6UvQr6CJ9S1sBw5cSPW8,返回count=0,但实际上默认组有3000多新增粉丝 [图片] 这个问题早在3年前就发现,迟迟得不到解决,论坛相似问题如下 https://developers.weixin.qq.com/community/pay/doc/00046cf484ca985e35c9d95835b800 https://developers.weixin.qq.com/community/develop/doc/00028e928281c0bafdac172fb5a400 作为开发者,我个人猜测是第二次获取新增关注的粉丝如果不传nextopenid,数据库扫描行数太多导致database 超时,因此我特意记录了第一次的nextopenid备用,结果传入后得到count=0,不知道为何会这样,希望官方能真正说明一下,做不到就给个准信,我们和商户说明情况,换方案即可,现在这样悬而未决,真的很头疼
2022-01-18 - 点击计划商家小票链接格式验证BUG
[图片] 根据后台规则,链接可以包含横杠"-" 但是提交的时候报格式错误,去除横杠就可以提交,但是总不能让商户为此修改域名吧,成本太高了 这个BUG存在很长时间了,你们还是提醒后端改正吧 举例: https://static-pet.xxxxxxx.com/pay/success.html 不可以 https://staticpet.xxxxxxx.com/pay/success.html 可以
2020-12-25 - 请问服务商模式下调用wx.openOfflinePayView接口?
请问服务商模式下调用wx.openOfflinePayView接口,是使用服务商的app_secret进行签名求paySign值么? 我尝试了很多次都不行 { "appId":"这里是特约商户的小程序,服务商特约商户后台已经绑定到支付商户号", "timeStamp":"1604481069", "nonceStr":"OeRaJ0AU4ZwKEVyt", "package":"mch_id=这里填写的特殊商户号的mch_id", "signType":"MD5", "paySign":"42007162D81D8C65A96F2BB7929FEBA3" // 那么这个paySign是使用服务商的app_secret求吗?尝试了下不行 }
2020-11-04 - 为什么商家券领券通知不返回发券凭证?
无论是小程序发券,还是H5发券,都是需要out_request_no商家发券凭证,并且保证唯一,这个凭证不仅仅是保证幂等性,还是商家和微信关联信息的一个很重要的依据,现在的设计简直匪夷所思!我发券的时候想记录点额外的数据和out_request_no绑定,可是回调的时候偏偏不告诉你out_request_no,这直接导致我们根本无法知道回调给我的券当初是那个out_request_no发的,不知道微信是故意这样设计,还是那史上最垃圾的openid机制一样,打折保护用户隐私的旗号恶心开发者! https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/marketing/h5/chapter3_1.shtml https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/marketing/busifavor/chapter4_1.shtml
2020-09-02