|
@ -204,25 +204,20 @@ |
|
|
final PaymentParam paymentParam = new PaymentParam(); |
|
|
final PaymentParam paymentParam = new PaymentParam(); |
|
|
paymentParam.setType(order.getPayType()); |
|
|
paymentParam.setType(order.getPayType()); |
|
|
final List<Payment> payments = paymentService.listRel(paymentParam); |
|
|
final List<Payment> payments = paymentService.listRel(paymentParam); |
|
|
|
|
|
if (payments.isEmpty()) { |
|
|
|
|
|
throw new BusinessException("请完成支付配置"); |
|
|
|
|
|
} |
|
|
return payments.get(0); |
|
|
return payments.get(0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 构建微信支付 |
|
|
|
|
|
* @param order |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
public JsapiServiceExtension getWxService(ShopOrder order) { |
|
|
public JsapiServiceExtension getWxService(ShopOrder order) { |
|
|
// Integer payType = order.getPayType();
|
|
|
|
|
|
final String uploadPath = config.getUploadPath(); // 服务器本地路径
|
|
|
|
|
|
// final HashMap<String, String> orderInfo = new HashMap<>();
|
|
|
|
|
|
// 微信小程序(微信支付)
|
|
|
|
|
|
// String key = "mp-weixin:".concat(order.getTenantId().toString());
|
|
|
|
|
|
// final String string = redisUtil.get(key);
|
|
|
|
|
|
// System.out.println("string = " + string);
|
|
|
|
|
|
// final JSONObject mpWx = JSONObject.parseObject(string);
|
|
|
|
|
|
// System.out.println("mpWx = " + mpWx);
|
|
|
|
|
|
// String key2 = "Payment:".concat(payType.toString()).concat(":").concat(order.getTenantId().toString());
|
|
|
|
|
|
|
|
|
final String uploadPath = config.getUploadPath(); |
|
|
final Payment payment = getPayment(order); |
|
|
final Payment payment = getPayment(order); |
|
|
if (ObjectUtil.isEmpty(payment)) { |
|
|
|
|
|
throw new BusinessException("请完成支付配置"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String privateKey = uploadPath.concat("/file").concat(payment.getApiclientKey()); // 秘钥证书
|
|
|
String privateKey = uploadPath.concat("/file").concat(payment.getApiclientKey()); // 秘钥证书
|
|
|
String apiclientCert = uploadPath.concat("/file").concat(payment.getApiclientCert()); |
|
|
String apiclientCert = uploadPath.concat("/file").concat(payment.getApiclientCert()); |
|
|
String pubKey = uploadPath.concat("/file").concat(payment.getPubKey()); // 公钥证书
|
|
|
String pubKey = uploadPath.concat("/file").concat(payment.getPubKey()); // 公钥证书
|
|
|