File tree Expand file tree Collapse file tree
main/java/com/github/binarywang/wxpay/service
test/java/com/github/binarywang/wxpay/service/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,8 +27,20 @@ public interface MiPayService {
2727 */
2828 MedInsOrdersResult medInsOrders (MedInsOrdersRequest request ) throws WxPayException ;
2929
30-
31-
32-
30+ /**
31+ * <pre>
32+ * 使用医保自费混合订单号查看下单结果
33+ *
34+ * 从业机构使用混合下单订单号,通过该接口主动查询订单状态,完成下一步的业务逻辑。
35+ *
36+ * 文档地址:<a href="https://pay.weixin.qq.com/doc/v3/partner/4012503155">使用医保自费混合订单号查看下单结果</a>
37+ * </pre>
38+ *
39+ * @param mixTradeNo 医保自费混合订单号
40+ * @param subMchId 医疗机构的商户号
41+ * @return MedInsOrdersResult 下单结果
42+ * @throws WxPayException the wx pay exception
43+ */
44+ MedInsOrdersResult getMedInsOrderByMixTradeNo (String mixTradeNo , String subMchId ) throws WxPayException ;
3345
3446}
Original file line number Diff line number Diff line change @@ -34,7 +34,13 @@ public MedInsOrdersResult medInsOrders(MedInsOrdersRequest request) throws WxPay
3434
3535 String result = this .payService .postV3WithWechatpaySerial (url , GSON .toJson (request ));
3636 return GSON .fromJson (result , MedInsOrdersResult .class );
37+ }
3738
38-
39+ @ Override
40+ public MedInsOrdersResult getMedInsOrderByMixTradeNo (String mixTradeNo , String subMchId ) throws WxPayException {
41+ String url = String .format ("%s/v3/med-ins/orders/mix-trade-no/%s?sub_mchid=%s" ,
42+ this .payService .getPayBaseUrl (), mixTradeNo , subMchId );
43+ String result = this .payService .getV3 (url );
44+ return GSON .fromJson (result , MedInsOrdersResult .class );
3945 }
4046}
Original file line number Diff line number Diff line change @@ -46,5 +46,22 @@ public void medInsOrders() throws WxPayException {
4646 log .info (result .toString ());
4747 }
4848
49+ /**
50+ * 使用医保自费混合订单号查看下单结果测试
51+ * @throws WxPayException
52+ */
53+ @ Test
54+ public void getMedInsOrderByMixTradeNo () throws WxPayException {
55+ // 测试用的医保自费混合订单号和医疗机构商户号
56+ String mixTradeNo = "202204022005169952975171534816" ;
57+ String subMchid = "1900000109" ;
58+
59+ MiPayService miPayService = wxPayService .getMiPayService ();
60+
61+ MedInsOrdersResult result = miPayService .getMedInsOrderByMixTradeNo (mixTradeNo , subMchid );
62+
63+ log .info (result .toString ());
64+ }
65+
4966
5067}
You can’t perform that action at this time.
0 commit comments