| @@ -41,5 +41,10 @@ ALTER TABLE wx_merchant ADD COLUMN `cash_out_count` INT(3) DEFAULT 0 COMMENT ' | |||||
| ALTER TABLE wx_cash_out ADD COLUMN `phone` VARCHAR(20) NOT NULL COMMENT '提现的手机号' ; | ALTER TABLE wx_cash_out ADD COLUMN `phone` VARCHAR(20) NOT NULL COMMENT '提现的手机号' ; | ||||
| ALTER TABLE wx_cash_out ADD COLUMN `wx_b_open_head_img` VARCHAR(1000) COMMENT 'b端微信用户头像' ; | ALTER TABLE wx_cash_out ADD COLUMN `wx_b_open_head_img` VARCHAR(1000) COMMENT 'b端微信用户头像' ; | ||||
| ALTER TABLE `wx_pay_account` | |||||
| ADD COLUMN `merchant_cert_path` VARCHAR(100) COMMENT '商户自己的证书' AFTER `cert_path`; | |||||
| UPDATE wx_pay_account SET merchant_cert_path = CONCAT('/opt/iformall/service/merchant_wx_cert/',tenant_id,"/apiclient_cert.p12"); | |||||
| @@ -24,6 +24,8 @@ public class WxPayAccount extends TenantEntity { | |||||
| private String notifyUrl; | private String notifyUrl; | ||||
| @io.swagger.annotations.ApiModelProperty(value="证书本地存放位置",name="certPath") | @io.swagger.annotations.ApiModelProperty(value="证书本地存放位置",name="certPath") | ||||
| private String certPath; | private String certPath; | ||||
| @io.swagger.annotations.ApiModelProperty(value="商户自己的证书",name="merchantCertPath") | |||||
| private String merchantCertPath; | |||||
| @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") | @io.swagger.annotations.ApiModelProperty(value="是否开启分账(0:未开启分账1:开启分账)",name="type") | ||||
| @@ -189,6 +189,8 @@ public class WxCashOutAdapterService implements CashOutAdapterService{ | |||||
| /** | /** | ||||
| * https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2 | * https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2 | ||||
| * | |||||
| * 在wx_pay_account里面要设置merchant_cert_path,登陆特约商户的商户后台,账号中心-API安全。 | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public CashOutAdapterResult cashOut(WxAppinfo appInfo, WxPayAccount payAccount, WxCashOut cashOut) { | public CashOutAdapterResult cashOut(WxAppinfo appInfo, WxPayAccount payAccount, WxCashOut cashOut) { | ||||
| @@ -205,7 +207,7 @@ public class WxCashOutAdapterService implements CashOutAdapterService{ | |||||
| signMap.put("sign", signAgent); | signMap.put("sign", signAgent); | ||||
| String response = null; | String response = null; | ||||
| try { | try { | ||||
| response = WxPay.transfers(signMap, payAccount.getCertPath(), payAccount.getMchId()); | |||||
| response = WxPay.transfers(signMap, payAccount.getMerchantCertPath(), payAccount.getSubMchId()); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| log.error("零钱支付异常: " + e.getMessage(),e); | log.error("零钱支付异常: " + e.getMessage(),e); | ||||
| return new CashOutAdapterResult(false, EnumCashOutStatus.FAIL.getCode(), "微信零钱支付接口调用异常", null); | return new CashOutAdapterResult(false, EnumCashOutStatus.FAIL.getCode(), "微信零钱支付接口调用异常", null); | ||||
| @@ -11,6 +11,7 @@ | |||||
| <result column="api_key" jdbcType="VARCHAR" property="apiKey"/> | <result column="api_key" jdbcType="VARCHAR" property="apiKey"/> | ||||
| <result column="notify_url" jdbcType="VARCHAR" property="notifyUrl"/> | <result column="notify_url" jdbcType="VARCHAR" property="notifyUrl"/> | ||||
| <result column="cert_path" jdbcType="VARCHAR" property="certPath"/> | <result column="cert_path" jdbcType="VARCHAR" property="certPath"/> | ||||
| <result column="merchant_cert_path" jdbcType="VARCHAR" property="merchantCertPath"/> | |||||
| <result column="type" jdbcType="INTEGER" property="type"/> | <result column="type" jdbcType="INTEGER" property="type"/> | ||||
| <result column="share" jdbcType="INTEGER" property="share"/> | <result column="share" jdbcType="INTEGER" property="share"/> | ||||
| <result column="rate" jdbcType="INTEGER" property="rate"/> | <result column="rate" jdbcType="INTEGER" property="rate"/> | ||||
| @@ -25,7 +26,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`mch_id`,`sub_mch_id`,`sub_app_id`,`api_key`,`notify_url`,`cert_path`, | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`mch_id`,`sub_mch_id`,`sub_app_id`,`api_key`,`notify_url`,`cert_path`,`merchant_cert_path`, | |||||
| `type`,`share`,`rate`,`real_rate`, | `type`,`share`,`rate`,`real_rate`, | ||||
| `service_id`,`pay_score_notify_url`,`api_v3_key`,`cert_serial_no`,`private_key_path`,`private_cert_path` | `service_id`,`pay_score_notify_url`,`api_v3_key`,`cert_serial_no`,`private_key_path`,`private_cert_path` | ||||
| </sql> | </sql> | ||||