|
@@ -1,5 +1,6 @@
|
|
|
package com.yonge.toolset.payment.core.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yonge.toolset.base.result.BaseResult;
|
|
|
import com.yonge.toolset.payment.base.PaymentTemplate;
|
|
|
import com.yonge.toolset.payment.base.enums.MethodNameEnum;
|
|
@@ -13,6 +14,8 @@ import com.yonge.toolset.payment.base.model.RefundBill;
|
|
|
import com.yonge.toolset.payment.base.model.callback.PaymentCallBack;
|
|
|
import com.yonge.toolset.payment.core.util.PaywayUtil;
|
|
|
import com.yonge.toolset.payment.core.service.PaymentClient;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -24,6 +27,8 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Service
|
|
|
public class PaymentClientImpl implements PaymentClient {
|
|
|
+ private final static Logger log = LoggerFactory.getLogger(PaymentClientImpl.class);
|
|
|
+
|
|
|
@Override
|
|
|
public BaseResult<Map<String, Object>> getOpenAuthMsg(OpenAuth openAuth) {
|
|
|
return PaywayUtil.getRealTemplate(openAuth.getOpenType(), openAuth.getPayChannel()).getOpenAuthMsg(openAuth);
|
|
@@ -31,26 +36,40 @@ public class PaymentClientImpl implements PaymentClient {
|
|
|
|
|
|
@Override
|
|
|
public BaseResult<Payment> executePayment(Payment payment) {
|
|
|
- return PaywayUtil.getRealTemplate(payment.getOpenType(), payment.getPayChannel()).executePayment(payment);
|
|
|
+ log.info("支付-付款请求参数:{}", JSONObject.toJSONString(payment));
|
|
|
+ BaseResult<Payment> paymentBaseResult = PaywayUtil.getRealTemplate(payment.getOpenType(), payment.getPayChannel()).executePayment(payment);
|
|
|
+ log.info("支付-付款返回参数:{}", JSONObject.toJSONString(paymentBaseResult));
|
|
|
+ return paymentBaseResult;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public BaseResult<Payment> queryPayment(Payment payment) {
|
|
|
- return PaywayUtil.getRealTemplate(payment.getOpenType(), payment.getPayChannel()).queryPayment(payment);
|
|
|
+ log.info("支付-查询请求参数:{}", JSONObject.toJSONString(payment));
|
|
|
+ BaseResult<Payment> paymentBaseResult = PaywayUtil.getRealTemplate(payment.getOpenType(), payment.getPayChannel()).queryPayment(payment);
|
|
|
+ log.info("支付-查询返回参数:{}", JSONObject.toJSONString(paymentBaseResult));
|
|
|
+ return paymentBaseResult;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public BaseResult<ClosePayment> closePayment(ClosePayment closePayment) {
|
|
|
- return PaywayUtil.getRealTemplate(closePayment.getOpenType(), closePayment.getPayChannel()).closePayment(closePayment);
|
|
|
+ log.info("支付-关单请求参数:{}", JSONObject.toJSONString(closePayment));
|
|
|
+ BaseResult<ClosePayment> closePaymentBaseResult = PaywayUtil.getRealTemplate(closePayment.getOpenType(), closePayment.getPayChannel()).closePayment(closePayment);
|
|
|
+ log.info("支付-关单返回参数:{}", JSONObject.toJSONString(closePaymentBaseResult));
|
|
|
+ return closePaymentBaseResult;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public BaseResult<RefundBill> refundPayment(RefundBill refundBill) {
|
|
|
- return PaywayUtil.getRealTemplate(refundBill.getOpenType(), refundBill.getPayChannel()).refundPayment(refundBill);
|
|
|
+ log.info("支付-退款请求参数:{}", JSONObject.toJSONString(refundBill));
|
|
|
+ BaseResult<RefundBill> refundBillBaseResult = PaywayUtil.getRealTemplate(refundBill.getOpenType(), refundBill.getPayChannel()).refundPayment(refundBill);
|
|
|
+ log.info("支付-退款返回参数:{}", JSONObject.toJSONString(refundBillBaseResult));
|
|
|
+ return refundBillBaseResult;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public BaseResult<PaymentCallBack> analysisNotice(OpenEnum openType, PaymentClientEnum paymentClient, PayChannelEnum payChannel, MethodNameEnum methodName, HttpServletRequest request) {
|
|
|
- return PaywayUtil.getRealTemplate(openType, payChannel).analysisNotice(openType, paymentClient, payChannel, methodName, request);
|
|
|
+ BaseResult<PaymentCallBack> paymentCallBackBaseResult = PaywayUtil.getRealTemplate(openType, payChannel).analysisNotice(openType, paymentClient, payChannel, methodName, request);
|
|
|
+ log.info("支付-回调解析结果:{}", JSONObject.toJSONString(paymentCallBackBaseResult));
|
|
|
+ return paymentCallBackBaseResult;
|
|
|
}
|
|
|
}
|