修复售后订单问题 修复支付问题
This commit is contained in:
@ -43,13 +43,17 @@ public class AliPayMessageHandler implements PayMessageHandler<AliPayMessage, Al
|
||||
//交易完成
|
||||
if ("TRADE_SUCCESS".equals(trade_status) || "TRADE_FINISHED".equals(trade_status)) {
|
||||
|
||||
String orderId = (String) payMessage.getPayMessage().get("out_trade_no");
|
||||
log.info("支付宝回调消息处理,发送处理消息orderId={}",orderId);
|
||||
//消息队列处理
|
||||
payNoticeProducer.sendPayNoticeMessage(orderId, PayTypeEnum.ALI.getValue());
|
||||
log.info("支付宝回调消息发送完毕");
|
||||
return payService.getPayOutMessage("success", "成功");
|
||||
|
||||
String orderNo = (String) payMessage.getPayMessage().get("out_trade_no");
|
||||
//截取订单编号
|
||||
String[] split = orderNo.split("-");
|
||||
if (split.length > 0) {
|
||||
String orderId = split[0];
|
||||
log.info("支付宝回调消息处理,发送处理消息orderId={}", split[0]);
|
||||
//消息队列处理
|
||||
payNoticeProducer.sendPayNoticeMessage(orderId, PayTypeEnum.ALI.getValue());
|
||||
log.info("支付宝回调消息发送完毕");
|
||||
return payService.getPayOutMessage("success", "成功");
|
||||
}
|
||||
}
|
||||
|
||||
return payService.getPayOutMessage("fail", "失败");
|
||||
|
@ -19,6 +19,8 @@ import java.util.stream.Stream;
|
||||
public enum PayTypeEnum {
|
||||
|
||||
ALI("alipay","支付宝支付"),
|
||||
ALI_H5("alipay_h5","微信支付"),
|
||||
ALI_APP("alipay_app","微信支付"),
|
||||
WEIXIN("weixin","微信支付"),
|
||||
WEIXIN_H5("weixin_h5","微信H5支付"),
|
||||
WEIXIN_APPLET("weixin_applet","微信小程序支付"),
|
||||
|
@ -6,6 +6,8 @@ import lombok.Getter;
|
||||
public enum PayEnum {
|
||||
|
||||
ALI("alipay","支付宝支付"),
|
||||
ALI_APP("alipay_app","支付宝APP支付"),
|
||||
ALI_H5("alipay_h5","支付宝H5支付"),
|
||||
WEIXIN("weixin","微信支付"),
|
||||
WEIXIN_H5("weixin_h5","微信H5支付"),
|
||||
WEIXIN_APPLET("weixin_applet","微信小程序支付"),
|
||||
|
@ -1,7 +1,10 @@
|
||||
package co.yixiang.yshop.module.pay.strategy.type;
|
||||
|
||||
import co.yixiang.yshop.module.pay.controller.admin.merchantdetails.vo.PayParam;
|
||||
import co.yixiang.yshop.module.pay.enums.PayTypeEnum;
|
||||
import co.yixiang.yshop.module.pay.strategy.Pay;
|
||||
import co.yixiang.yshop.module.pay.strategy.weixin.skd.RandomStringUtil;
|
||||
import com.egzosn.pay.spring.boot.core.bean.MerchantPayOrder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
@ -9,9 +12,11 @@ import java.util.Map;
|
||||
|
||||
public class AliPay implements Pay {
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String,String> selectPayWay(String payCode, PayParam param) throws Exception{
|
||||
//do something
|
||||
|
||||
return Collections.emptyMap();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -178,8 +178,9 @@ public class WxPayServiceUtils {
|
||||
params.put("sign", sign);
|
||||
String xml = PaymentKit.toXml(params);
|
||||
log.info(xml);
|
||||
String cert_url = "/yshop-server/apiclient_cert.p12";
|
||||
log.info("certUrl:{}",cert_url);
|
||||
String xmlStr = WXPayUtil.doRefund("https://api.mch.weixin.qq.com/secapi/pay/refund", xml,cert_url,mch_id);
|
||||
log.info(xmlStr);
|
||||
//加入微信支付日志
|
||||
return PaymentKit.xmlToMap(xmlStr);
|
||||
}
|
||||
|
Reference in New Issue
Block a user