| | |
| | | import org.yeshi.utils.exception.WXOrderException;
|
| | | import org.yeshi.utils.exception.WXPlaceOrderParamsException;
|
| | | import org.yeshi.utils.wx.WXPayUtil;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.shop.BanLiShopOrderUtil;
|
| | |
| | | public static boolean refund(String orderNo, BigDecimal money) throws WXOrderException {
|
| | | boolean success = WXPayUtil.refund(BanLiShopOrderUtil.getWXPayOrderNo(orderNo), money, money, null,
|
| | | new WXAPPInfo(Constant.getWXAccount(null, null).getGzAppId(),
|
| | | Constant.getWXAccount(null, null).getGzAppSecret(), MCH_ID, MCH_KEY), MCH_ID, BanLiShopWXPayUtil.class.getClassLoader().getResourceAsStream(MCH_CERT_PATH));
|
| | | Constant.getWXAccount(null, null).getGzAppSecret(), MCH_ID, MCH_KEY),
|
| | | MCH_ID, BanLiShopWXPayUtil.class.getClassLoader().getResourceAsStream(MCH_CERT_PATH));
|
| | | return success;
|
| | | }
|
| | |
|
| | |
| | | Constant.getWXAccount(null, null).getGzAppSecret(), MCH_ID, MCH_KEY));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 是否支付成功
|
| | | * |
| | | * @param orderNo
|
| | | * @return
|
| | | * @throws WXOrderException
|
| | | */
|
| | | public static boolean isPaySuccess(String orderNo) throws WXOrderException {
|
| | | return WXPayUtil.isPaySuccess(BanLiShopOrderUtil.getWXPayOrderNo(orderNo),
|
| | | new WXAPPInfo(Constant.getWXAccount(null, null).getGzAppId(),
|
| | | Constant.getWXAccount(null, null).getGzAppSecret(), MCH_ID, MCH_KEY));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 签名是否正确
|
| | | * |
| | | * @param params
|
| | | * @param sign
|
| | | * @return
|
| | | */
|
| | | public static boolean signIsRight(Map<String, String> params, String sign) {
|
| | | String newSign = WXUtil.getSignMD5(params, MCH_KEY);
|
| | | return newSign.equalsIgnoreCase(sign);
|
| | | }
|
| | |
|
| | | }
|