package com.younike.wxpay.params;

import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.List;

/** 金额 */
@Data
public class Amount {

    @NotNull(message = "订单总金额不能为空")
    private Integer total;

    /* CNY：人民币，境内商户号仅支持人民币。 */
    private final String currency = "CNY";

    /************************* 支付回调信息 ***************************/

    private Integer payer_total;

    private String payer_currency;

    /************************* 退款信息 ***************************/
    private List<From> from;
    private Integer refund;

    private Integer payer_refund;
    private Integer settlement_refund;
    private Integer settlement_total;
    private Integer discount_refund;

    public static Amount pay(Integer total){
        Amount amount = new Amount();
        amount.setTotal(total);
        return amount;
    }

    public static Amount refund(Integer total, Integer refund){
        Amount amount = new Amount();
        amount.setTotal(total);
        amount.setRefund(refund);
        return amount;
    }
}
