...
|
...
|
@@ -2,6 +2,7 @@ package com.yohoufo.order.service.pay.alipay; |
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.base.Splitter;
|
|
|
import com.yoho.core.common.utils.MD5;
|
|
|
import com.yoho.error.ServiceError;
|
|
|
import com.yoho.error.exception.ServiceException;
|
...
|
...
|
@@ -506,24 +507,24 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
|
|
if (data.endsWith("|")) {
|
|
|
data = data.substring(0, data.length() - 1);
|
|
|
}
|
|
|
String[] dataArray = data.split("^");
|
|
|
if (dataArray.length != 8) {
|
|
|
List<String> dataList = Splitter.on("^").splitToList(data);
|
|
|
if (dataList.size() != 8) {
|
|
|
logger.error("[{}] getTransferData 支付宝回调数据字段个数有误", data);
|
|
|
return null;
|
|
|
}
|
|
|
// 1流水号^2收款方账号^3收款账号姓名^4付款金额^5成功标识(S)^6成功原因(null)^7支付宝内部流水号^8完成时间
|
|
|
try {
|
|
|
TransferData transferData = new TransferData();
|
|
|
String[] transferIdAndTradeBillId = dataArray[0].split("_");
|
|
|
String[] transferIdAndTradeBillId = dataList.get(0).split("_");
|
|
|
transferData.setTransferId(new Integer(transferIdAndTradeBillId[0]));
|
|
|
transferData.setTradeBillsId(new Integer(transferIdAndTradeBillId[1]));
|
|
|
transferData.setReceiveAccount(dataArray[1]);
|
|
|
transferData.setReceiveUserName(dataArray[2]);
|
|
|
transferData.setMoney(dataArray[3]);
|
|
|
transferData.setStatus(dataArray[4]);
|
|
|
transferData.setMessage(dataArray[5]);
|
|
|
transferData.setAlipayTradeId(dataArray[6]);
|
|
|
transferData.setTime(dataArray[7]);
|
|
|
transferData.setReceiveAccount(dataList.get(1));
|
|
|
transferData.setReceiveUserName(dataList.get(2));
|
|
|
transferData.setMoney(dataList.get(3));
|
|
|
transferData.setStatus(dataList.get(4));
|
|
|
transferData.setMessage(dataList.get(5));
|
|
|
transferData.setAlipayTradeId(dataList.get(6));
|
|
|
transferData.setTime(dataList.get(7));
|
|
|
return transferData;
|
|
|
} catch (NumberFormatException e) {
|
|
|
logger.error("[{}] getTransferData 支付宝回调数据格式有误", data);
|
...
|
...
|
|