package cn.bootx.platform.daxpay.param.pay;

import cn.bootx.platform.daxpay.code.PayChannelEnum;
import cn.bootx.platform.daxpay.code.PayWayEnum;
import cn.bootx.platform.daxpay.param.channel.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * 同意下单支付方式参数
 *
 * @author xxm
 * @since 2020/12/8
 */
@Data
@Schema(title = "支付通道参数")
public class PayChannelParam {

    /**
     * @see PayChannelEnum#getCode()
     */
    @Schema(description = "支付通道编码")
    @NotBlank(message = "支付通道编码不可为空")
    private String channel;

    /**
     * @see PayWayEnum#getCode()
     */
    @Schema(description = "支付方式编码")
    @NotBlank(message = "支付方式编码不可为空")
    private String way;

    @Schema(description = "支付金额")
    @NotNull(message = "支付金额不可为空")
    private Integer amount;

    /**
     * 附加支付参数, 传输json格式字符串
     * @see AliPayParam
     * @see WeChatPayParam
     * @see VoucherPayParam
     * @see WalletPayParam
     * @see UnionPayParam
     */
    @Schema(description = "附加支付参数")
    private Map<String,Object> channelParam;
}
