Browse Source

fix cashout

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
84475b1ca1
4 changed files with 12 additions and 2 deletions
  1. +5
    -0
      mallinkAdmin/src/main/resources/db/migration/V202104130001__for_cash_out.sql
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxPayAccount.java
  3. +3
    -1
      mallinkService/src/main/java/com/iformall/service/pay/service/cashout/wx/WxCashOutAdapterService.java
  4. +2
    -1
      mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml

+ 5
- 0
mallinkAdmin/src/main/resources/db/migration/V202104130001__for_cash_out.sql View File

@@ -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 `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");




+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxPayAccount.java View File

@@ -24,6 +24,8 @@ public class WxPayAccount extends TenantEntity {
private String notifyUrl;
@io.swagger.annotations.ApiModelProperty(value="证书本地存放位置",name="certPath")
private String certPath;
@io.swagger.annotations.ApiModelProperty(value="商户自己的证书",name="merchantCertPath")
private String merchantCertPath;
@io.swagger.annotations.ApiModelProperty(value="商户模式-0:普通商户模式1:服务商模式",name="type")
private Integer type;
@io.swagger.annotations.ApiModelProperty(value="是否开启分账(0:未开启分账1:开启分账)",name="type")


+ 3
- 1
mallinkService/src/main/java/com/iformall/service/pay/service/cashout/wx/WxCashOutAdapterService.java View File

@@ -189,6 +189,8 @@ public class WxCashOutAdapterService implements CashOutAdapterService{
/**
* https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2
*
* 在wx_pay_account里面要设置merchant_cert_path,登陆特约商户的商户后台,账号中心-API安全。
*/
@Override
public CashOutAdapterResult cashOut(WxAppinfo appInfo, WxPayAccount payAccount, WxCashOut cashOut) {
@@ -205,7 +207,7 @@ public class WxCashOutAdapterService implements CashOutAdapterService{
signMap.put("sign", signAgent);
String response = null;
try {
response = WxPay.transfers(signMap, payAccount.getCertPath(), payAccount.getMchId());
response = WxPay.transfers(signMap, payAccount.getMerchantCertPath(), payAccount.getSubMchId());
} catch (Exception e) {
log.error("零钱支付异常: " + e.getMessage(),e);
return new CashOutAdapterResult(false, EnumCashOutStatus.FAIL.getCode(), "微信零钱支付接口调用异常", null);


+ 2
- 1
mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml View File

@@ -11,6 +11,7 @@
<result column="api_key" jdbcType="VARCHAR" property="apiKey"/>
<result column="notify_url" jdbcType="VARCHAR" property="notifyUrl"/>
<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="share" jdbcType="INTEGER" property="share"/>
<result column="rate" jdbcType="INTEGER" property="rate"/>
@@ -25,7 +26,7 @@
</resultMap>

<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`,
`service_id`,`pay_score_notify_url`,`api_v3_key`,`cert_serial_no`,`private_key_path`,`private_cert_path`
</sql>


Loading…
Cancel
Save