You've already forked FrameTour-BE
支付
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CancelOrderRequest {
|
||||
private String orderNo;
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
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 CreateOrderRequest {
|
||||
/**
|
||||
* 价格,单位为分
|
||||
*/
|
||||
private Integer price;
|
||||
private String goodsName;
|
||||
private String orderNo;
|
||||
private String description;
|
||||
private String userIdentify;
|
||||
private String notifyUrl;
|
||||
|
||||
|
||||
public BigDecimal getPriceInYuan() {
|
||||
return new BigDecimal(BigInteger.valueOf(price), 2);
|
||||
}
|
||||
public CreateOrderRequest setPriceInCents(Integer priceInCents) {
|
||||
this.price = priceInCents;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CreateOrderRequest setPriceInYuan(BigDecimal priceInYuan) {
|
||||
this.price = priceInYuan.multiply(new BigDecimal(100)).intValue();
|
||||
return this;
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CreateOrderResponse {
|
||||
private boolean success;
|
||||
private boolean skipPay;
|
||||
private String orderNo;
|
||||
}
|
34
src/main/java/com/ycwl/basic/pay/entity/PayResponse.java
Normal file
34
src/main/java/com/ycwl/basic/pay/entity/PayResponse.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PayResponse {
|
||||
private boolean valid;
|
||||
private String orderNo;
|
||||
private Object originalResponse;
|
||||
private Integer orderPrice;
|
||||
private Integer payPrice;
|
||||
private PAY_STATE state;
|
||||
private String payTime;
|
||||
|
||||
public boolean isPay() {
|
||||
return state == PAY_STATE.SUCCESS;
|
||||
}
|
||||
|
||||
public boolean isCancel() {
|
||||
return state == PAY_STATE.CANCEL;
|
||||
}
|
||||
|
||||
public boolean isRefund() {
|
||||
return state == PAY_STATE.REFUND;
|
||||
}
|
||||
|
||||
public enum PAY_STATE {
|
||||
SUCCESS,
|
||||
CANCEL,
|
||||
REFUND,
|
||||
FAIL,
|
||||
UNKNOWN;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RefundOrderRequest {
|
||||
private Integer price;
|
||||
private Integer refundPrice;
|
||||
private String orderNo;
|
||||
private String refundNo;
|
||||
private String notifyUrl;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RefundOrderResponse {
|
||||
private boolean success;
|
||||
private String refundNo;
|
||||
}
|
28
src/main/java/com/ycwl/basic/pay/entity/RefundResponse.java
Normal file
28
src/main/java/com/ycwl/basic/pay/entity/RefundResponse.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RefundResponse {
|
||||
private boolean valid;
|
||||
private String orderNo;
|
||||
private String refundNo;
|
||||
private Object originalResponse;
|
||||
private Integer orderPrice;
|
||||
private Integer refundPrice;
|
||||
private PAY_STATE state;
|
||||
private String refundTime;
|
||||
|
||||
public void setSuccess() {
|
||||
state = PAY_STATE.SUCCESS;
|
||||
}
|
||||
|
||||
public void setFail() {
|
||||
state = PAY_STATE.FAIL;
|
||||
}
|
||||
|
||||
public enum PAY_STATE {
|
||||
SUCCESS,
|
||||
FAIL
|
||||
}
|
||||
}
|
12
src/main/java/com/ycwl/basic/pay/entity/WxMpPayConfig.java
Normal file
12
src/main/java/com/ycwl/basic/pay/entity/WxMpPayConfig.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.ycwl.basic.pay.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WxMpPayConfig {
|
||||
private String merchantId;
|
||||
private String appId;
|
||||
private String privateKey;
|
||||
private String serialNumber;
|
||||
private String apiV3Key;
|
||||
}
|
Reference in New Issue
Block a user