Commit 65dff1ce authored by hezhen's avatar hezhen

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents 7cb0cbdc eec6e38c
......@@ -292,7 +292,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
AlipayClient alipayClient = new DefaultAlipayClient(SystemConfig.ALIPAY_PAY_BASE_URL + "/gateway.do",
SystemConfig.ALIPAY_APPID, SystemConfig.ALIPAY_PRIVATE_KEY, AlipayConstants.FORMAT_JSON,
"utf-8", SystemConfig.ALIPAY_PUBLIC_KEY, AlipayConstants.SIGN_TYPE_RSA2);
return alipayClient;
return alipayClient;
}
//支付宝APP支付方法
......@@ -421,15 +421,16 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
}
/**
* APP支付退款
* APP支付退款
*
* @param
* @param outTradeNo 订单号
* @param tradNo 流水号
* @param outTradeNo 订单号
* @param tradNo 流水号
* @param refundAmount 退款金额
* @param refundReason 退款原因
* @return
*/
public boolean alipayOrderRefund(String outTradeNo, String tradNo, Integer refundAmount, String refundReason) {
public boolean alipayOrderRefund(String outTradeNo, String tradNo, Integer refundAmount, String refundReason) {
AlipayClient alipayClient = getAlipayClient();
AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
BigDecimal realAmount = new BigDecimal(refundAmount.toString()).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_UP);
......@@ -439,10 +440,11 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
"\"refund_amount\":" + realAmount + "," +
"\"out_request_no\":\"" + refundReason + "\"" +
" }");
try{
AlipayTradeRefundResponse response = alipayClient.execute(request);
try {
log.info("支付宝退款中:outTradeNo = {}, tradNo = {}, refundAmount = {}, refundReason = {}", outTradeNo, tradNo, refundAmount, refundReason);
if(response.isSuccess()){
AlipayTradeRefundResponse response = alipayClient.execute(request);
log.info(response.getMsg());
if (response.isSuccess()) {
return true;
} else {
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment