Просмотр исходного кода

fix cashout

release_toaliyun_real
xiaohanzi 5 лет назад
Родитель
Сommit
64b6c789ab
2 измененных файлов: 25 добавлений и 27 удалений
  1. +8
    -6
      mallinkBApi/src/main/java/com/iformall/controller/WxCashOutController.java
  2. +17
    -21
      mallinkCallback/src/main/java/com/iformall/controller/callback/AliPayController.java

+ 8
- 6
mallinkBApi/src/main/java/com/iformall/controller/WxCashOutController.java Просмотреть файл

@@ -102,10 +102,6 @@ public class WxCashOutController extends BaseController {
@GetMapping("getCurrentCashOutData") @GetMapping("getCurrentCashOutData")
public ResultData getCurrentCashOutData() { public ResultData getCurrentCashOutData() {
WxMerchantBUser buser = getLoginBUser(); WxMerchantBUser buser = getLoginBUser();
WxCUser mUser = getCurrentCUser(buser);
if (mUser == null) {
return new ResultData(Result.ERROR,"请用绑定["+buser.getPhone()+"]的微信在C端完成授权手机号操作。");
}
WxMerchant merchant = wxMerchantService.getById(buser.getMerchantId()); WxMerchant merchant = wxMerchantService.getById(buser.getMerchantId());
WxMall mall = wxMallService.getByTenantId(buser.getTenantId()); WxMall mall = wxMallService.getByTenantId(buser.getTenantId());
Map<String,Object> resultMap = new HashMap<String,Object>(); Map<String,Object> resultMap = new HashMap<String,Object>();
@@ -124,12 +120,18 @@ public class WxCashOutController extends BaseController {
resultMap.put("cashOutSupport", 0); resultMap.put("cashOutSupport", 0);
}else { }else {
resultMap.put("cashOutSupport", mall.getCashOutSupport()); resultMap.put("cashOutSupport", mall.getCashOutSupport());
if (1 == mall.getCashOutSupport().intValue()) {
WxCUser mUser = getCurrentCUser(buser);
if (mUser == null) {
return new ResultData(Result.ERROR,"请用绑定["+buser.getPhone()+"]的微信在C端完成授权手机号操作。");
}
resultMap.put("cashOutOpenNickName", mUser.getNickName());
resultMap.put("cashOutOpenHeadImg", mUser.getAvatarUrl());
}
} }
} }
} }
resultMap.put("cashOutLimit", mall.getCashOutLimit()); resultMap.put("cashOutLimit", mall.getCashOutLimit());
resultMap.put("cashOutOpenNickName", mUser.getNickName());
resultMap.put("cashOutOpenHeadImg", mUser.getAvatarUrl());
return new ResultData(resultMap); return new ResultData(resultMap);
} }




+ 17
- 21
mallinkCallback/src/main/java/com/iformall/controller/callback/AliPayController.java Просмотреть файл

@@ -1,5 +1,7 @@
package com.iformall.controller.callback; package com.iformall.controller.callback;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.iformall.controller.base.BaseController; import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.AliPayCUser; import com.iformall.domain.po.AliPayCUser;
import com.iformall.domain.po.WxMall; import com.iformall.domain.po.WxMall;
@@ -174,30 +176,18 @@ public class AliPayController extends BaseController {
} }
/** /**
*ISV_GATEWAY_URL?charset=GBK&biz_content=
{
"trade_no":"144534352534536","out_trade_no":"123456789","total_amount":"25.00","buyer_pay_amount":"16.50","receipt_amount":"20.00","gmt_payment":"2018-05-05 14:24:12","buyer_id":"2088102121935776","mall_cell_type":"SMID","mall_cell_id":"12345","mall_pid":"2088102121935788","mall_id":"1234567","mall_name":"测试商圈名称","mall_store_id":"001","notify_receive_pid":"2088102121935799"
}
&msg_method=alipay.business.mall.trade.success&utc_timestamp=1516797622752&version=1.1&sign_type=RSA2&notify_id=d275fec564e62af6bedbcee73f3f05fi5x&app_id=2013121700999429&sign=I+Y/lvqYUEEc10EPdpntRhFIQ==
ISV_GATEWAY_URL?charset=GBK&biz_content=
{
"trade_no":"2019082222001464620500962620","out_trade_no":"out202002240001","out_request_no":"outrequest0001","refund_fee":"20.00","gmt_refund_pay":"2020-01-05 14:24:12","buyer_id":"2088102121935776","mall_cell_type":"SMID","mall_cell_id":"12345","mall_pid":"2088102121935788","mall_id":"1234567","mall_store_id":"001","mall_name":"测试商圈名称","notify_receive_pid":"2088102121935799"
}
&msg_method=alipay.business.mall.trade.refunded&utc_timestamp=1516797622752&version=1.1&sign_type=RSA2&notify_id=d275fec564e62af6bedbcee73f3f05fi5x&app_id=2013121700999429&sign=I+Y/lvqYUEEc10EPdpntRhFIQ==
* https://opendocs.alipay.com/pre-apis/msgapi_pre/alipay.business.mall.trade.success
* https://opendocs.alipay.com/pre-apis/00fi1b
* @throws Exception 可能产生的任何异常 * @throws Exception 可能产生的任何异常
*/ */
@RequestMapping(value = "/notify") @RequestMapping(value = "/notify")
public void __Notify(@RequestParam Map<String, Object> paramMap) throws Exception { public void __Notify(@RequestParam Map<String, Object> paramMap) throws Exception {
logger.info(">>>>>>>>alipay callback"+paramMap);
String msgMethod = (String) paramMap.get("msg_method"); String msgMethod = (String) paramMap.get("msg_method");
if (StringUtils.isBlank(msgMethod)) { if (StringUtils.isBlank(msgMethod)) {
logger.error("alipay notify notify error. msg_method empity:"+paramMap); logger.error("alipay notify notify error. msg_method empity:"+paramMap);
}else { }else {
//支付成功 //支付成功
if ("alipay.business.mall.trade.success".equals(msgMethod)) { if ("alipay.business.mall.trade.success".equals(msgMethod)) {
String notifyId = (String) paramMap.get("notify_id");
String bizContent = (String) paramMap.get("biz_content"); String bizContent = (String) paramMap.get("biz_content");
/**bizContent********* /**bizContent*********
{ {
@@ -215,13 +205,19 @@ public class AliPayController extends BaseController {
"mall_name":"富茂链客", "mall_name":"富茂链客",
"receipt_amount":"17.00" "receipt_amount":"17.00"
}*/ }*/
//{"mall_cell_type":"PID","gmt_payment":"2021-04-26 11:46:39","mall_pid":"2088141123923631","mall_store_id":"1001","buyer_id":"2088622858197040","mall_cell_id":"2088222130914462","notify_receive_pid":"2088141123923631","out_trade_no":"16194087949622858197040","total_amount":"0.10","mall_id":"10020001","trade_no":"2021042622001497041452058065","mall_name":"富茂链客","receipt_amount":"0.10"}
String mallCellType= (String) paramMap.get("mall_cell_type");
String gmtPayment = (String) paramMap.get("gmt_payment");
String mallPid = (String) paramMap.get("mall_pid");
String mallStoreId = (String) paramMap.get("mall_store_id");
String buyerId = (String) paramMap.get("buyer_id");
String mallCellId = (String) paramMap.get("mall_cell_id");
if (StringUtils.isBlank(bizContent)) {
logger.error("alipay notify notify error. bizContent empity:"+paramMap);
}else {
JSONObject jo = JSON.parseObject(bizContent);
String mallCellType= jo.getString("mall_cell_type");
String gmtPayment = jo.getString("gmt_payment");
String mallPid = jo.getString("mall_pid");
String mallStoreId = jo.getString("mall_store_id");
String buyerId = jo.getString("buyer_id");
String mallCellId = jo.getString("mall_cell_id");
}
}else if ("alipay.business.mall.trade.refunded".equals(msgMethod)) {
} }
} }


Загрузка…
Отмена
Сохранить