You've already forked FrameTour-BE
聪明付
This commit is contained in:
@@ -7,4 +7,5 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class CancelOrderRequest {
|
||||
private String orderNo;
|
||||
private String reason = "取消订单";
|
||||
}
|
||||
|
@@ -0,0 +1,11 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CongMingPayConfig {
|
||||
private String programId;
|
||||
private String shopId;
|
||||
private String apiKey;
|
||||
private String apiHost = "https://api.congmingpay.com";
|
||||
}
|
@@ -2,9 +2,12 @@ package com.ycwl.basic.pay.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class CreateOrderResponse {
|
||||
private boolean success;
|
||||
private boolean skipPay;
|
||||
private String orderNo;
|
||||
private Map<String, Object> extData;
|
||||
}
|
||||
|
@@ -1,16 +1,22 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class PayResponse {
|
||||
private boolean valid;
|
||||
private String orderNo;
|
||||
@JsonIgnore
|
||||
private Object originalResponse;
|
||||
private Integer orderPrice;
|
||||
private Integer payPrice;
|
||||
private PAY_STATE state;
|
||||
private String payTime;
|
||||
@JsonIgnore
|
||||
private String customResponse;
|
||||
|
||||
public boolean isPay() {
|
||||
return state == PAY_STATE.SUCCESS;
|
||||
@@ -24,8 +30,17 @@ public class PayResponse {
|
||||
return state == PAY_STATE.REFUND;
|
||||
}
|
||||
|
||||
public void setPayPriceInYuan(BigDecimal money) {
|
||||
payPrice = money.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
}
|
||||
|
||||
public void setOrderPriceInYuan(BigDecimal money) {
|
||||
orderPrice = money.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
}
|
||||
|
||||
public enum PAY_STATE {
|
||||
SUCCESS,
|
||||
NOT_PAY,
|
||||
CANCEL,
|
||||
REFUND,
|
||||
FAIL,
|
||||
|
@@ -3,6 +3,9 @@ package com.ycwl.basic.pay.entity;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RefundOrderRequest {
|
||||
@@ -11,4 +14,12 @@ public class RefundOrderRequest {
|
||||
private String orderNo;
|
||||
private String refundNo;
|
||||
private String notifyUrl;
|
||||
|
||||
public BigDecimal getRefundPriceInYuan() {
|
||||
return new BigDecimal(BigInteger.valueOf(refundPrice), 2);
|
||||
}
|
||||
|
||||
public void setRefundPriceInYuan(BigDecimal refundPriceInYuan) {
|
||||
this.refundPrice = refundPriceInYuan.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
}
|
||||
}
|
||||
|
@@ -1,17 +1,23 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class RefundResponse {
|
||||
private boolean valid;
|
||||
private String orderNo;
|
||||
private String refundNo;
|
||||
@JsonIgnore
|
||||
private Object originalResponse;
|
||||
private Integer orderPrice;
|
||||
private Integer refundPrice;
|
||||
private PAY_STATE state;
|
||||
private String refundTime;
|
||||
@JsonIgnore
|
||||
private String customResponse;
|
||||
|
||||
public void setSuccess() {
|
||||
state = PAY_STATE.SUCCESS;
|
||||
@@ -21,6 +27,10 @@ public class RefundResponse {
|
||||
state = PAY_STATE.FAIL;
|
||||
}
|
||||
|
||||
public void setRefundPriceInYuan(BigDecimal bigDecimal) {
|
||||
refundPrice = bigDecimal.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
}
|
||||
|
||||
public enum PAY_STATE {
|
||||
SUCCESS,
|
||||
FAIL
|
||||
|
Reference in New Issue
Block a user