修复回调部分东西

This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-05-29 19:22:12 +08:00
parent e961916a6b
commit feb38f18c3
6 changed files with 53 additions and 16 deletions

View File

@ -52,7 +52,7 @@ public class PayCallback implements IPayCallback {
if (AdapayStatusEnum.succeeded.code.equals(response.getString("status"))) { if (AdapayStatusEnum.succeeded.code.equals(response.getString("status"))) {
FinancialMaster update = new FinancialMaster(); FinancialMaster update = new FinancialMaster();
update.setId(response.getLong("order_no")); update.setOrderMasterCode(response.getString("order_no"));
update.setPaymentId(response.getString("id")); update.setPaymentId(response.getString("id"));
financialMasterService.updateFinancialMaster(update); financialMasterService.updateFinancialMaster(update);
} else { } else {

View File

@ -158,7 +158,7 @@ qiniu:
adapay: adapay:
debug: true debug: true
prod-mode: true prod-mode: true
notifyUrl: 'http://www.opsoul.com/adapay/callback' notifyUrl: 'https://www.opsoul.com/adapay/callback'
jim: jim:
appKey: '' appKey: ''

View File

@ -3,14 +3,12 @@ package com.ghy.common.adapay.callback;
import com.ghy.common.adapay.callback.mapping.DrawCashReplyMapping; import com.ghy.common.adapay.callback.mapping.DrawCashReplyMapping;
import com.ghy.common.adapay.callback.mapping.PayReplyMapping; import com.ghy.common.adapay.callback.mapping.PayReplyMapping;
import com.ghy.common.adapay.callback.mapping.RefundReplyMapping; import com.ghy.common.adapay.callback.mapping.RefundReplyMapping;
import com.ghy.common.core.controller.BaseController;
import com.huifu.adapay.core.AdapayCore; import com.huifu.adapay.core.AdapayCore;
import com.huifu.adapay.core.util.AdapaySign; import com.huifu.adapay.core.util.AdapaySign;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** /**
@ -19,12 +17,10 @@ import org.springframework.web.bind.annotation.RestController;
* @author HH 2022/3/25 * @author HH 2022/3/25
*/ */
@RestController @RestController
public class AdapayCallbackController { public class AdapayCallbackController extends BaseController {
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
@PostMapping("/adapay/callback") @PostMapping("/adapay/callback")
public String callback(@RequestBody Event event) { public String callback(Event event) {
logger.info(" 收单返回消息event" + event); logger.info(" 收单返回消息event" + event);
//验签请参data //验签请参data
String data = event.getData(); String data = event.getData();

View File

@ -7,23 +7,27 @@ package com.ghy.common.enums;
*/ */
public enum OrderStatus { public enum OrderStatus {
WAIT_PAY("0", "待支付"), RECEIVE(0, "待接单"),
PAID("1", "已支付"), PLAIN(1, "待排期"),
CANCEL("2", "已取消"); GOING(2, "待上门"),
SERVER(3, "服务中"),
FINISH(4, "已完成"),
CANCEL(5, "已取消");
private final String code; private final Integer code;
private final String desc; private final String desc;
OrderStatus(String code, String desc) { OrderStatus(Integer code, String desc) {
this.code = code; this.code = code;
this.desc = desc; this.desc = desc;
} }
public String getCode() { public Integer getCode() {
return code; return code;
} }
public String getDesc() { public String getDesc() {
return desc; return desc;
} }
} }

View File

@ -0,0 +1,29 @@
package com.ghy.common.enums;
/**
* @author clunt
* 付款状态
*/
public enum PayStatus {
WAIT_PAY(0, "待支付"),
PAID(1, "已支付"),
CANCEL(2, "已取消");
private final Integer code;
private final String desc;
PayStatus(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

View File

@ -80,7 +80,15 @@
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = SYSDATE() update_time = SYSDATE()
</set> </set>
WHERE id = #{id} <where>
<if test="id !=null and id != 0">
AND id = #{id}
</if>
<if test="orderMasterCode !=null and orderMasterCode != ''">
AND order_master_code = #{orderMasterCode}
</if>
</where>
</update> </update>
<update id="paySucceeded"> <update id="paySucceeded">