| @@ -14,11 +14,6 @@ public class PayProperty { | |||||
| */ | */ | ||||
| private boolean real; | private boolean real; | ||||
| /** | |||||
| * 是否分账 | |||||
| */ | |||||
| private boolean share; | |||||
| public boolean isReal() { | public boolean isReal() { | ||||
| return real; | return real; | ||||
| } | } | ||||
| @@ -26,12 +21,4 @@ public class PayProperty { | |||||
| public void setReal(boolean real) { | public void setReal(boolean real) { | ||||
| this.real = real; | this.real = real; | ||||
| } | } | ||||
| public boolean isShare() { | |||||
| return share; | |||||
| } | |||||
| public void setShare(boolean share) { | |||||
| this.share = share; | |||||
| } | |||||
| } | } | ||||
| @@ -39,5 +39,4 @@ mapper: | |||||
| - com.simple.common.CommonMapper | - com.simple.common.CommonMapper | ||||
| pay: | pay: | ||||
| real: true | |||||
| share: false | |||||
| real: true | |||||
| @@ -14,11 +14,6 @@ public class PayProperty { | |||||
| */ | */ | ||||
| private boolean real; | private boolean real; | ||||
| /** | |||||
| * 是否分账 | |||||
| */ | |||||
| private boolean share; | |||||
| public boolean isReal() { | public boolean isReal() { | ||||
| return real; | return real; | ||||
| } | } | ||||
| @@ -26,12 +21,4 @@ public class PayProperty { | |||||
| public void setReal(boolean real) { | public void setReal(boolean real) { | ||||
| this.real = real; | this.real = real; | ||||
| } | } | ||||
| public boolean isShare() { | |||||
| return share; | |||||
| } | |||||
| public void setShare(boolean share) { | |||||
| this.share = share; | |||||
| } | |||||
| } | } | ||||
| @@ -39,5 +39,4 @@ mapper: | |||||
| - com.simple.common.CommonMapper | - com.simple.common.CommonMapper | ||||
| pay: | pay: | ||||
| real: true | |||||
| share: false | |||||
| real: true | |||||
| @@ -16,11 +16,6 @@ public class PayProperty { | |||||
| */ | */ | ||||
| private boolean real; | private boolean real; | ||||
| /** | |||||
| * 是否分账 | |||||
| */ | |||||
| private boolean share; | |||||
| public boolean isReal() { | public boolean isReal() { | ||||
| return real; | return real; | ||||
| } | } | ||||
| @@ -28,12 +23,4 @@ public class PayProperty { | |||||
| public void setReal(boolean real) { | public void setReal(boolean real) { | ||||
| this.real = real; | this.real = real; | ||||
| } | } | ||||
| public boolean isShare() { | |||||
| return share; | |||||
| } | |||||
| public void setShare(boolean share) { | |||||
| this.share = share; | |||||
| } | |||||
| } | } | ||||
| @@ -72,7 +72,7 @@ public class WxPayOrderController extends BaseController { | |||||
| try { | try { | ||||
| record.setIp(IPUtil.getIpAddr(request)); | record.setIp(IPUtil.getIpAddr(request)); | ||||
| return wxPayOrderService.createPayOrder(payProperty.isReal(), payProperty.isShare(), appInfo, user, record, EnumPayWay.PAY_WAY_WECHAT); | |||||
| return wxPayOrderService.createPayOrder(payProperty.isReal(), appInfo, user, record, EnumPayWay.PAY_WAY_WECHAT); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage()); | logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage()); | ||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| @@ -40,4 +40,3 @@ mapper: | |||||
| pay: | pay: | ||||
| real: true | real: true | ||||
| share: false | |||||
| @@ -62,6 +62,9 @@ public class WxPayAccount implements Serializable { | |||||
| /**商户模式**/ | /**商户模式**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="商户模式-0:普通商户模式1:服务商模式",name="type") | @io.swagger.annotations.ApiModelProperty(value="商户模式-0:普通商户模式1:服务商模式",name="type") | ||||
| private Integer type; | private Integer type; | ||||
| /**是否开启分账**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="0:未开启分账1:开启分账",name="type") | |||||
| private boolean share; | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| @@ -104,15 +107,18 @@ public class WxPayAccount implements Serializable { | |||||
| public void setCertPath(String _certPath) { | public void setCertPath(String _certPath) { | ||||
| certPath = _certPath; | certPath = _certPath; | ||||
| } | } | ||||
| public Integer getType() { | public Integer getType() { | ||||
| return type; | return type; | ||||
| } | } | ||||
| public void setType(Integer type) { | public void setType(Integer type) { | ||||
| this.type = type; | this.type = type; | ||||
| } | } | ||||
| public boolean isShare() { | |||||
| return share; | |||||
| } | |||||
| public void setShare(boolean share) { | |||||
| this.share = share; | |||||
| } | |||||
| public String getPayNotifyUrl() { | public String getPayNotifyUrl() { | ||||
| return notifyUrl + "/pay"; | return notifyUrl + "/pay"; | ||||
| } | } | ||||
| @@ -123,6 +129,7 @@ public class WxPayAccount implements Serializable { | |||||
| return notifyUrl + "/separate"; | return notifyUrl + "/separate"; | ||||
| } | } | ||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| @@ -133,6 +140,7 @@ public class WxPayAccount implements Serializable { | |||||
| ,NotifyUrl_ASC("`notify_url` ASC"),NotifyUrl_DESC("`notify_url` DESC") | ,NotifyUrl_ASC("`notify_url` ASC"),NotifyUrl_DESC("`notify_url` DESC") | ||||
| ,CertPath_ASC("`cert_path` ASC"),CertPath_DESC("`cert_path` DESC") | ,CertPath_ASC("`cert_path` ASC"),CertPath_DESC("`cert_path` DESC") | ||||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | ||||
| ,Share_ASC("`share` ASC"),Share_DESC("`share` DESC") | |||||
| ; | ; | ||||
| private String value; | private String value; | ||||
| Field(String value){ | Field(String value){ | ||||
| @@ -18,7 +18,7 @@ public interface WxPayOrderService { | |||||
| * @param payWay | * @param payWay | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| ResultData createPayOrder(boolean isReal, boolean isShare, WxAppinfo appInfo, WxCUser user, WxPayOrder record, EnumPayWay payWay); | |||||
| ResultData createPayOrder(boolean isReal, WxAppinfo appInfo, WxCUser user, WxPayOrder record, EnumPayWay payWay); | |||||
| /** | /** | ||||
| * 微信支付订单查询 | * 微信支付订单查询 | ||||
| @@ -94,7 +94,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| "\"XML_FORMAT_ERROR\":{\"detail\":\"XML格式错误\t\",\"reason\":\"XML格式错误\",\"reason\":\"请检查XML参数格式是否正确\"}}"); | "\"XML_FORMAT_ERROR\":{\"detail\":\"XML格式错误\t\",\"reason\":\"XML格式错误\",\"reason\":\"请检查XML参数格式是否正确\"}}"); | ||||
| @Override | @Override | ||||
| public ResultData createPayOrder(boolean isReal, boolean isShare, WxAppinfo appInfo, WxCUser user, WxPayOrder record, EnumPayWay payWay) { | |||||
| public ResultData createPayOrder(boolean isReal, WxAppinfo appInfo, WxCUser user, WxPayOrder record, EnumPayWay payWay) { | |||||
| final IdWorker idworker = IdWorker.get(); | final IdWorker idworker = IdWorker.get(); | ||||
| try { | try { | ||||
| @@ -224,7 +224,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| wxPayOrderSP.setTime_expire(Utility.getDataFormatStringYYYYMMDDHHmmss(futureDate)); // 15分钟后结束 | wxPayOrderSP.setTime_expire(Utility.getDataFormatStringYYYYMMDDHHmmss(futureDate)); // 15分钟后结束 | ||||
| wxPayOrderSP.setSign_type("HMAC-SHA256"); | wxPayOrderSP.setSign_type("HMAC-SHA256"); | ||||
| Map<String, String> payOrderMap = BeanUtils.toStringMap(wxPayOrderSP); | Map<String, String> payOrderMap = BeanUtils.toStringMap(wxPayOrderSP); | ||||
| if(isShare) { | |||||
| if(payAccount.isShare()) { | |||||
| payOrderMap.put("profit_sharing", "Y"); | payOrderMap.put("profit_sharing", "Y"); | ||||
| } | } | ||||
| wxPayOrderSP.setSign(WxPayment.createSignHMAC(payOrderMap, payAccount.getApiKey())); | wxPayOrderSP.setSign(WxPayment.createSignHMAC(payOrderMap, payAccount.getApiKey())); | ||||