聪明付

This commit is contained in:
2025-06-02 09:43:01 +08:00
parent 89e112e13a
commit 34dbc7d036
11 changed files with 374 additions and 7 deletions

View File

@ -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,