All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alipay.v3.model.AlipayTradePayModel Maven / Gradle / Ivy

There is a newer version: 3.1.6.ALL
Show newest version
/*
 * 支付宝开放平台API
 * 支付宝开放平台v3协议文档
 *
 * The version of the OpenAPI document: 2024-11-12
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.alipay.v3.model;

import java.util.Objects;
import java.util.Arrays;
import com.alipay.v3.model.AgreementParams;
import com.alipay.v3.model.BkAgentReqInfo;
import com.alipay.v3.model.BusinessParams;
import com.alipay.v3.model.ExtUserInfo;
import com.alipay.v3.model.ExtendParams;
import com.alipay.v3.model.GoodsDetail;
import com.alipay.v3.model.PayParams;
import com.alipay.v3.model.PromoParam;
import com.alipay.v3.model.RoyaltyInfo;
import com.alipay.v3.model.SettleInfo;
import com.alipay.v3.model.SubMerchant;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.alipay.v3.JSON;

/**
 * AlipayTradePayModel
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AlipayTradePayModel {
  public static final String SERIALIZED_NAME_ADVANCE_PAYMENT_TYPE = "advance_payment_type";
  @SerializedName(SERIALIZED_NAME_ADVANCE_PAYMENT_TYPE)
  private String advancePaymentType;

  public static final String SERIALIZED_NAME_AGREEMENT_PARAMS = "agreement_params";
  @SerializedName(SERIALIZED_NAME_AGREEMENT_PARAMS)
  private AgreementParams agreementParams;

  public static final String SERIALIZED_NAME_ALIPAY_STORE_ID = "alipay_store_id";
  @SerializedName(SERIALIZED_NAME_ALIPAY_STORE_ID)
  private String alipayStoreId;

  public static final String SERIALIZED_NAME_AUTH_CODE = "auth_code";
  @SerializedName(SERIALIZED_NAME_AUTH_CODE)
  private String authCode;

  public static final String SERIALIZED_NAME_AUTH_CONFIRM_MODE = "auth_confirm_mode";
  @SerializedName(SERIALIZED_NAME_AUTH_CONFIRM_MODE)
  private String authConfirmMode;

  public static final String SERIALIZED_NAME_AUTH_NO = "auth_no";
  @SerializedName(SERIALIZED_NAME_AUTH_NO)
  private String authNo;

  public static final String SERIALIZED_NAME_BKAGENT_REQ_INFO = "bkagent_req_info";
  @SerializedName(SERIALIZED_NAME_BKAGENT_REQ_INFO)
  private BkAgentReqInfo bkagentReqInfo;

  public static final String SERIALIZED_NAME_BODY = "body";
  @SerializedName(SERIALIZED_NAME_BODY)
  private String body;

  public static final String SERIALIZED_NAME_BUSINESS_PARAMS = "business_params";
  @SerializedName(SERIALIZED_NAME_BUSINESS_PARAMS)
  private BusinessParams businessParams;

  public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id";
  @SerializedName(SERIALIZED_NAME_BUYER_ID)
  private String buyerId;

  public static final String SERIALIZED_NAME_BUYER_OPEN_ID = "buyer_open_id";
  @SerializedName(SERIALIZED_NAME_BUYER_OPEN_ID)
  private String buyerOpenId;

  public static final String SERIALIZED_NAME_DISABLE_PAY_CHANNELS = "disable_pay_channels";
  @SerializedName(SERIALIZED_NAME_DISABLE_PAY_CHANNELS)
  private String disablePayChannels;

  public static final String SERIALIZED_NAME_DISCOUNTABLE_AMOUNT = "discountable_amount";
  @SerializedName(SERIALIZED_NAME_DISCOUNTABLE_AMOUNT)
  private String discountableAmount;

  public static final String SERIALIZED_NAME_EXT_USER_INFO = "ext_user_info";
  @SerializedName(SERIALIZED_NAME_EXT_USER_INFO)
  private ExtUserInfo extUserInfo;

  public static final String SERIALIZED_NAME_EXTEND_PARAMS = "extend_params";
  @SerializedName(SERIALIZED_NAME_EXTEND_PARAMS)
  private ExtendParams extendParams;

  public static final String SERIALIZED_NAME_GOODS_DETAIL = "goods_detail";
  @SerializedName(SERIALIZED_NAME_GOODS_DETAIL)
  private List goodsDetail = null;

  public static final String SERIALIZED_NAME_IS_ASYNC_PAY = "is_async_pay";
  @SerializedName(SERIALIZED_NAME_IS_ASYNC_PAY)
  private Boolean isAsyncPay;

  public static final String SERIALIZED_NAME_MERCHANT_ORDER_NO = "merchant_order_no";
  @SerializedName(SERIALIZED_NAME_MERCHANT_ORDER_NO)
  private String merchantOrderNo;

  public static final String SERIALIZED_NAME_NOTIFY_URL = "notify_url";
  @SerializedName(SERIALIZED_NAME_NOTIFY_URL)
  private String notifyUrl;

  public static final String SERIALIZED_NAME_OPERATOR_ID = "operator_id";
  @SerializedName(SERIALIZED_NAME_OPERATOR_ID)
  private String operatorId;

  public static final String SERIALIZED_NAME_OUT_TRADE_NO = "out_trade_no";
  @SerializedName(SERIALIZED_NAME_OUT_TRADE_NO)
  private String outTradeNo;

  public static final String SERIALIZED_NAME_PASSBACK_PARAMS = "passback_params";
  @SerializedName(SERIALIZED_NAME_PASSBACK_PARAMS)
  private String passbackParams;

  public static final String SERIALIZED_NAME_PAY_PARAMS = "pay_params";
  @SerializedName(SERIALIZED_NAME_PAY_PARAMS)
  private PayParams payParams;

  public static final String SERIALIZED_NAME_PRODUCT_CODE = "product_code";
  @SerializedName(SERIALIZED_NAME_PRODUCT_CODE)
  private String productCode;

  public static final String SERIALIZED_NAME_PROMO_PARAMS = "promo_params";
  @SerializedName(SERIALIZED_NAME_PROMO_PARAMS)
  private PromoParam promoParams;

  public static final String SERIALIZED_NAME_QUERY_OPTIONS = "query_options";
  @SerializedName(SERIALIZED_NAME_QUERY_OPTIONS)
  private List queryOptions = null;

  public static final String SERIALIZED_NAME_REQUEST_ORG_PID = "request_org_pid";
  @SerializedName(SERIALIZED_NAME_REQUEST_ORG_PID)
  private String requestOrgPid;

  public static final String SERIALIZED_NAME_ROYALTY_INFO = "royalty_info";
  @SerializedName(SERIALIZED_NAME_ROYALTY_INFO)
  private RoyaltyInfo royaltyInfo;

  public static final String SERIALIZED_NAME_SCENE = "scene";
  @SerializedName(SERIALIZED_NAME_SCENE)
  private String scene;

  public static final String SERIALIZED_NAME_SELLER_ID = "seller_id";
  @SerializedName(SERIALIZED_NAME_SELLER_ID)
  private String sellerId;

  public static final String SERIALIZED_NAME_SETTLE_CURRENCY = "settle_currency";
  @SerializedName(SERIALIZED_NAME_SETTLE_CURRENCY)
  private String settleCurrency;

  public static final String SERIALIZED_NAME_SETTLE_INFO = "settle_info";
  @SerializedName(SERIALIZED_NAME_SETTLE_INFO)
  private SettleInfo settleInfo;

  public static final String SERIALIZED_NAME_STORE_ID = "store_id";
  @SerializedName(SERIALIZED_NAME_STORE_ID)
  private String storeId;

  public static final String SERIALIZED_NAME_SUB_MERCHANT = "sub_merchant";
  @SerializedName(SERIALIZED_NAME_SUB_MERCHANT)
  private SubMerchant subMerchant;

  public static final String SERIALIZED_NAME_SUBJECT = "subject";
  @SerializedName(SERIALIZED_NAME_SUBJECT)
  private String subject;

  public static final String SERIALIZED_NAME_TERMINAL_ID = "terminal_id";
  @SerializedName(SERIALIZED_NAME_TERMINAL_ID)
  private String terminalId;

  public static final String SERIALIZED_NAME_TERMINAL_PARAMS = "terminal_params";
  @SerializedName(SERIALIZED_NAME_TERMINAL_PARAMS)
  private String terminalParams;

  public static final String SERIALIZED_NAME_TIME_EXPIRE = "time_expire";
  @SerializedName(SERIALIZED_NAME_TIME_EXPIRE)
  private String timeExpire;

  public static final String SERIALIZED_NAME_TIMEOUT_EXPRESS = "timeout_express";
  @SerializedName(SERIALIZED_NAME_TIMEOUT_EXPRESS)
  private String timeoutExpress;

  public static final String SERIALIZED_NAME_TOTAL_AMOUNT = "total_amount";
  @SerializedName(SERIALIZED_NAME_TOTAL_AMOUNT)
  private String totalAmount;

  public static final String SERIALIZED_NAME_TRANS_CURRENCY = "trans_currency";
  @SerializedName(SERIALIZED_NAME_TRANS_CURRENCY)
  private String transCurrency;

  public static final String SERIALIZED_NAME_UNDISCOUNTABLE_AMOUNT = "undiscountable_amount";
  @SerializedName(SERIALIZED_NAME_UNDISCOUNTABLE_AMOUNT)
  private String undiscountableAmount;

  public AlipayTradePayModel() { 
  }

  public AlipayTradePayModel advancePaymentType(String advancePaymentType) {
    
    this.advancePaymentType = advancePaymentType;
    return this;
  }

   /**
   * 支付模式类型,若值为ENJOY_PAY_V2表示当前交易允许走先享后付2.0垫资
   * @return advancePaymentType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "ENJOY_PAY_V2", value = "支付模式类型,若值为ENJOY_PAY_V2表示当前交易允许走先享后付2.0垫资")

  public String getAdvancePaymentType() {
    return advancePaymentType;
  }


  public void setAdvancePaymentType(String advancePaymentType) {
    this.advancePaymentType = advancePaymentType;
  }


  public AlipayTradePayModel agreementParams(AgreementParams agreementParams) {
    
    this.agreementParams = agreementParams;
    return this;
  }

   /**
   * Get agreementParams
   * @return agreementParams
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public AgreementParams getAgreementParams() {
    return agreementParams;
  }


  public void setAgreementParams(AgreementParams agreementParams) {
    this.agreementParams = agreementParams;
  }


  public AlipayTradePayModel alipayStoreId(String alipayStoreId) {
    
    this.alipayStoreId = alipayStoreId;
    return this;
  }

   /**
   * 支付宝店铺编号。 指商户创建门店后支付宝生成的门店ID。
   * @return alipayStoreId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2016041400077000000003314986", value = "支付宝店铺编号。 指商户创建门店后支付宝生成的门店ID。")

  public String getAlipayStoreId() {
    return alipayStoreId;
  }


  public void setAlipayStoreId(String alipayStoreId) {
    this.alipayStoreId = alipayStoreId;
  }


  public AlipayTradePayModel authCode(String authCode) {
    
    this.authCode = authCode;
    return this;
  }

   /**
   * 支付授权码。 当面付场景传买家的付款码(25~30开头的长度为16~24位的数字,实际字符串长度以开发者获取的付款码长度为准)或者刷脸标识串(fp开头的35位字符串); 周期扣款或代扣场景无需传入,协议号通过agreement_params参数传递;  支付宝预授权和新当面资金授权场景无需传入,授权订单号通过 auth_no字段传入。 注:交易的买家与卖家不能相同。
   * @return authCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "28763443825664394", value = "支付授权码。 当面付场景传买家的付款码(25~30开头的长度为16~24位的数字,实际字符串长度以开发者获取的付款码长度为准)或者刷脸标识串(fp开头的35位字符串); 周期扣款或代扣场景无需传入,协议号通过agreement_params参数传递;  支付宝预授权和新当面资金授权场景无需传入,授权订单号通过 auth_no字段传入。 注:交易的买家与卖家不能相同。")

  public String getAuthCode() {
    return authCode;
  }


  public void setAuthCode(String authCode) {
    this.authCode = authCode;
  }


  public AlipayTradePayModel authConfirmMode(String authConfirmMode) {
    
    this.authConfirmMode = authConfirmMode;
    return this;
  }

   /**
   * 预授权确认模式。 适用于支付宝预授权和新当面资金授权场景。枚举值: COMPLETE:转交易完成后解冻剩余冻结金额; NOT_COMPLETE:转交易完成后不解冻剩余冻结金额; 默认值为NOT_COMPLETE。
   * @return authConfirmMode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "COMPLETE", value = "预授权确认模式。 适用于支付宝预授权和新当面资金授权场景。枚举值: COMPLETE:转交易完成后解冻剩余冻结金额; NOT_COMPLETE:转交易完成后不解冻剩余冻结金额; 默认值为NOT_COMPLETE。")

  public String getAuthConfirmMode() {
    return authConfirmMode;
  }


  public void setAuthConfirmMode(String authConfirmMode) {
    this.authConfirmMode = authConfirmMode;
  }


  public AlipayTradePayModel authNo(String authNo) {
    
    this.authNo = authNo;
    return this;
  }

   /**
   * 资金预授权单号。 支付宝预授权和新当面资金授权场景下必填。
   * @return authNo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2016110310002001760201905725", value = "资金预授权单号。 支付宝预授权和新当面资金授权场景下必填。")

  public String getAuthNo() {
    return authNo;
  }


  public void setAuthNo(String authNo) {
    this.authNo = authNo;
  }


  public AlipayTradePayModel bkagentReqInfo(BkAgentReqInfo bkagentReqInfo) {
    
    this.bkagentReqInfo = bkagentReqInfo;
    return this;
  }

   /**
   * Get bkagentReqInfo
   * @return bkagentReqInfo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public BkAgentReqInfo getBkagentReqInfo() {
    return bkagentReqInfo;
  }


  public void setBkagentReqInfo(BkAgentReqInfo bkagentReqInfo) {
    this.bkagentReqInfo = bkagentReqInfo;
  }


  public AlipayTradePayModel body(String body) {
    
    this.body = body;
    return this;
  }

   /**
   * 订单附加信息。 如果请求时传递了该参数,将在异步通知、对账单中原样返回,同时会在商户和用户的pc账单详情中作为交易描述展示
   * @return body
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "Iphone6 16G", value = "订单附加信息。 如果请求时传递了该参数,将在异步通知、对账单中原样返回,同时会在商户和用户的pc账单详情中作为交易描述展示")

  public String getBody() {
    return body;
  }


  public void setBody(String body) {
    this.body = body;
  }


  public AlipayTradePayModel businessParams(BusinessParams businessParams) {
    
    this.businessParams = businessParams;
    return this;
  }

   /**
   * Get businessParams
   * @return businessParams
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public BusinessParams getBusinessParams() {
    return businessParams;
  }


  public void setBusinessParams(BusinessParams businessParams) {
    this.businessParams = businessParams;
  }


  public AlipayTradePayModel buyerId(String buyerId) {
    
    this.buyerId = buyerId;
    return this;
  }

   /**
   * 买家支付宝用户ID。 支付宝预授权和新当面资金授权场景下必填,其它场景不需要传入。
   * @return buyerId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2088202954065786", value = "买家支付宝用户ID。 支付宝预授权和新当面资金授权场景下必填,其它场景不需要传入。")

  public String getBuyerId() {
    return buyerId;
  }


  public void setBuyerId(String buyerId) {
    this.buyerId = buyerId;
  }


  public AlipayTradePayModel buyerOpenId(String buyerOpenId) {
    
    this.buyerOpenId = buyerOpenId;
    return this;
  }

   /**
   * 买家支付宝用户唯一标识
   * @return buyerOpenId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "074a1CcTG1LelxKe4xQC0zgNdId0nxi95b5lsNpazWYoCo5", value = "买家支付宝用户唯一标识")

  public String getBuyerOpenId() {
    return buyerOpenId;
  }


  public void setBuyerOpenId(String buyerOpenId) {
    this.buyerOpenId = buyerOpenId;
  }


  public AlipayTradePayModel disablePayChannels(String disablePayChannels) {
    
    this.disablePayChannels = disablePayChannels;
    return this;
  }

   /**
   * 禁用支付渠道。 多个渠道以逗号分割,如同时禁用信用支付类型和积分,则传入:\"credit_group,point\"。 支持传入的值:<a target=\"_blank\" href=\"https://docs.open.alipay.com/common/wifww7\">渠道列表</a>
   * @return disablePayChannels
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "credit_group", value = "禁用支付渠道。 多个渠道以逗号分割,如同时禁用信用支付类型和积分,则传入:\"credit_group,point\"。 支持传入的值:渠道列表")

  public String getDisablePayChannels() {
    return disablePayChannels;
  }


  public void setDisablePayChannels(String disablePayChannels) {
    this.disablePayChannels = disablePayChannels;
  }


  public AlipayTradePayModel discountableAmount(String discountableAmount) {
    
    this.discountableAmount = discountableAmount;
    return this;
  }

   /**
   * 可打折金额。 参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]。  如果同时传入了【可打折金额】、【不可打折金额】和【订单总金额】,则必须满足如下条件:【订单总金额】=【可打折金额】+【不可打折金额】。 如果订单金额全部参与优惠计算,则【可打折金额】和【不可打折金额】都无需传入。
   * @return discountableAmount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "80.00", value = "可打折金额。 参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]。  如果同时传入了【可打折金额】、【不可打折金额】和【订单总金额】,则必须满足如下条件:【订单总金额】=【可打折金额】+【不可打折金额】。 如果订单金额全部参与优惠计算,则【可打折金额】和【不可打折金额】都无需传入。")

  public String getDiscountableAmount() {
    return discountableAmount;
  }


  public void setDiscountableAmount(String discountableAmount) {
    this.discountableAmount = discountableAmount;
  }


  public AlipayTradePayModel extUserInfo(ExtUserInfo extUserInfo) {
    
    this.extUserInfo = extUserInfo;
    return this;
  }

   /**
   * Get extUserInfo
   * @return extUserInfo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public ExtUserInfo getExtUserInfo() {
    return extUserInfo;
  }


  public void setExtUserInfo(ExtUserInfo extUserInfo) {
    this.extUserInfo = extUserInfo;
  }


  public AlipayTradePayModel extendParams(ExtendParams extendParams) {
    
    this.extendParams = extendParams;
    return this;
  }

   /**
   * Get extendParams
   * @return extendParams
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public ExtendParams getExtendParams() {
    return extendParams;
  }


  public void setExtendParams(ExtendParams extendParams) {
    this.extendParams = extendParams;
  }


  public AlipayTradePayModel goodsDetail(List goodsDetail) {
    
    this.goodsDetail = goodsDetail;
    return this;
  }

  public AlipayTradePayModel addGoodsDetailItem(GoodsDetail goodsDetailItem) {
    if (this.goodsDetail == null) {
      this.goodsDetail = new ArrayList<>();
    }
    this.goodsDetail.add(goodsDetailItem);
    return this;
  }

   /**
   * 订单包含的商品列表信息,json格式。
   * @return goodsDetail
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "订单包含的商品列表信息,json格式。")

  public List getGoodsDetail() {
    return goodsDetail;
  }


  public void setGoodsDetail(List goodsDetail) {
    this.goodsDetail = goodsDetail;
  }


  public AlipayTradePayModel isAsyncPay(Boolean isAsyncPay) {
    
    this.isAsyncPay = isAsyncPay;
    return this;
  }

   /**
   * 是否异步支付,传入true时,表明本次期望走异步支付,会先将支付请求受理下来,再异步推进。商户可以通过交易的异步通知或者轮询交易的状态来确定最终的交易结果。 只在代扣场景下有效,其它场景无需传入。
   * @return isAsyncPay
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "false", value = "是否异步支付,传入true时,表明本次期望走异步支付,会先将支付请求受理下来,再异步推进。商户可以通过交易的异步通知或者轮询交易的状态来确定最终的交易结果。 只在代扣场景下有效,其它场景无需传入。")

  public Boolean getIsAsyncPay() {
    return isAsyncPay;
  }


  public void setIsAsyncPay(Boolean isAsyncPay) {
    this.isAsyncPay = isAsyncPay;
  }


  public AlipayTradePayModel merchantOrderNo(String merchantOrderNo) {
    
    this.merchantOrderNo = merchantOrderNo;
    return this;
  }

   /**
   * 商户的原始订单号
   * @return merchantOrderNo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "201008123456789", value = "商户的原始订单号")

  public String getMerchantOrderNo() {
    return merchantOrderNo;
  }


  public void setMerchantOrderNo(String merchantOrderNo) {
    this.merchantOrderNo = merchantOrderNo;
  }


  public AlipayTradePayModel notifyUrl(String notifyUrl) {
    
    this.notifyUrl = notifyUrl;
    return this;
  }

   /**
   * 通知地址
   * @return notifyUrl
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "通知地址")

  public String getNotifyUrl() {
    return notifyUrl;
  }


  public void setNotifyUrl(String notifyUrl) {
    this.notifyUrl = notifyUrl;
  }


  public AlipayTradePayModel operatorId(String operatorId) {
    
    this.operatorId = operatorId;
    return this;
  }

   /**
   * 商户操作员编号。
   * @return operatorId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "yx_001", value = "商户操作员编号。")

  public String getOperatorId() {
    return operatorId;
  }


  public void setOperatorId(String operatorId) {
    this.operatorId = operatorId;
  }


  public AlipayTradePayModel outTradeNo(String outTradeNo) {
    
    this.outTradeNo = outTradeNo;
    return this;
  }

   /**
   * 商户订单号。 由商家自定义,64个字符以内,仅支持字母、数字、下划线且需保证在商户端不重复。
   * @return outTradeNo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "20150320010101001", value = "商户订单号。 由商家自定义,64个字符以内,仅支持字母、数字、下划线且需保证在商户端不重复。")

  public String getOutTradeNo() {
    return outTradeNo;
  }


  public void setOutTradeNo(String outTradeNo) {
    this.outTradeNo = outTradeNo;
  }


  public AlipayTradePayModel passbackParams(String passbackParams) {
    
    this.passbackParams = passbackParams;
    return this;
  }

   /**
   * 公用回传参数。 如果请求时传递了该参数,支付宝会在异步通知时将该参数原样返回。
   * @return passbackParams
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "merchantBizType%3d3C%26merchantBizNo%3d2016010101111", value = "公用回传参数。 如果请求时传递了该参数,支付宝会在异步通知时将该参数原样返回。")

  public String getPassbackParams() {
    return passbackParams;
  }


  public void setPassbackParams(String passbackParams) {
    this.passbackParams = passbackParams;
  }


  public AlipayTradePayModel payParams(PayParams payParams) {
    
    this.payParams = payParams;
    return this;
  }

   /**
   * Get payParams
   * @return payParams
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public PayParams getPayParams() {
    return payParams;
  }


  public void setPayParams(PayParams payParams) {
    this.payParams = payParams;
  }


  public AlipayTradePayModel productCode(String productCode) {
    
    this.productCode = productCode;
    return this;
  }

   /**
   * 产品码。 商家和支付宝签约的产品码。 枚举值(点击查看签约情况): <a target=\"_blank\" href=\"https://opensupport.alipay.com/support/codelab/detail/486/487\">FACE_TO_FACE_PAYMENT</a>:当面付产品; <a target=\"_blank\" href=\"https://opensupport.alipay.com/support/codelab/detail/807/1419\">CYCLE_PAY_AUTH</a>:周期扣款产品; GENERAL_WITHHOLDING:代扣产品; <a target=\"_blank\" href=\"https://opensupport.alipay.com/support/codelab/detail/712/1471\">PRE_AUTH_ONLINE</a>:支付宝预授权产品; PRE_AUTH:新当面资金授权产品; 默认值为FACE_TO_FACE_PAYMENT。 注意:非当面付产品使用本接口时,本参数必填。请传入对应产品码。
   * @return productCode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "FACE_TO_FACE_PAYMENT", value = "产品码。 商家和支付宝签约的产品码。 枚举值(点击查看签约情况): FACE_TO_FACE_PAYMENT:当面付产品; CYCLE_PAY_AUTH:周期扣款产品; GENERAL_WITHHOLDING:代扣产品; PRE_AUTH_ONLINE:支付宝预授权产品; PRE_AUTH:新当面资金授权产品; 默认值为FACE_TO_FACE_PAYMENT。 注意:非当面付产品使用本接口时,本参数必填。请传入对应产品码。")

  public String getProductCode() {
    return productCode;
  }


  public void setProductCode(String productCode) {
    this.productCode = productCode;
  }


  public AlipayTradePayModel promoParams(PromoParam promoParams) {
    
    this.promoParams = promoParams;
    return this;
  }

   /**
   * Get promoParams
   * @return promoParams
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public PromoParam getPromoParams() {
    return promoParams;
  }


  public void setPromoParams(PromoParam promoParams) {
    this.promoParams = promoParams;
  }


  public AlipayTradePayModel queryOptions(List queryOptions) {
    
    this.queryOptions = queryOptions;
    return this;
  }

  public AlipayTradePayModel addQueryOptionsItem(String queryOptionsItem) {
    if (this.queryOptions == null) {
      this.queryOptions = new ArrayList<>();
    }
    this.queryOptions.add(queryOptionsItem);
    return this;
  }

   /**
   * 返回参数选项。 商户通过传递该参数来定制同步需要额外返回的信息字段,数组格式。包括但不限于:[\"fund_bill_list\",\"voucher_detail_list\",\"enterprise_pay_info\",\"discount_goods_detail\",\"discount_amount\",\"mdiscount_amount\"]
   * @return queryOptions
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "[\"voucher_detail_list\"]", value = "返回参数选项。 商户通过传递该参数来定制同步需要额外返回的信息字段,数组格式。包括但不限于:[\"fund_bill_list\",\"voucher_detail_list\",\"enterprise_pay_info\",\"discount_goods_detail\",\"discount_amount\",\"mdiscount_amount\"]")

  public List getQueryOptions() {
    return queryOptions;
  }


  public void setQueryOptions(List queryOptions) {
    this.queryOptions = queryOptions;
  }


  public AlipayTradePayModel requestOrgPid(String requestOrgPid) {
    
    this.requestOrgPid = requestOrgPid;
    return this;
  }

   /**
   * 收单机构(例如银行)的标识,填写该机构在支付宝的pid。只在机构间联场景下传递该值。
   * @return requestOrgPid
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2088201916734621", value = "收单机构(例如银行)的标识,填写该机构在支付宝的pid。只在机构间联场景下传递该值。")

  public String getRequestOrgPid() {
    return requestOrgPid;
  }


  public void setRequestOrgPid(String requestOrgPid) {
    this.requestOrgPid = requestOrgPid;
  }


  public AlipayTradePayModel royaltyInfo(RoyaltyInfo royaltyInfo) {
    
    this.royaltyInfo = royaltyInfo;
    return this;
  }

   /**
   * Get royaltyInfo
   * @return royaltyInfo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public RoyaltyInfo getRoyaltyInfo() {
    return royaltyInfo;
  }


  public void setRoyaltyInfo(RoyaltyInfo royaltyInfo) {
    this.royaltyInfo = royaltyInfo;
  }


  public AlipayTradePayModel scene(String scene) {
    
    this.scene = scene;
    return this;
  }

   /**
   * 支付场景。枚举值: bar_code:当面付条码支付场景; security_code:当面付刷脸支付场景,对应的auth_code为fp开头的刷脸标识串; 周期扣款或代扣场景无需传入,协议号通过agreement_params参数传递;  支付宝预授权和新当面资金授权场景无需传入,授权订单号通过 auth_no字段传入。 默认值为bar_code。
   * @return scene
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "bar_code", value = "支付场景。枚举值: bar_code:当面付条码支付场景; security_code:当面付刷脸支付场景,对应的auth_code为fp开头的刷脸标识串; 周期扣款或代扣场景无需传入,协议号通过agreement_params参数传递;  支付宝预授权和新当面资金授权场景无需传入,授权订单号通过 auth_no字段传入。 默认值为bar_code。")

  public String getScene() {
    return scene;
  }


  public void setScene(String scene) {
    this.scene = scene;
  }


  public AlipayTradePayModel sellerId(String sellerId) {
    
    this.sellerId = sellerId;
    return this;
  }

   /**
   * 卖家支付宝用户ID。 当需要指定收款账号时,通过该参数传入,如果该值为空,则默认为商户签约账号对应的支付宝用户ID。 收款账号优先级规则:门店绑定的收款账户>请求传入的seller_id>商户签约账号对应的支付宝用户ID; 注:直付通和机构间联场景下seller_id无需传入或者保持跟pid一致; 如果传入的seller_id与pid不一致,需要联系支付宝小二配置收款关系; 支付宝预授权和新当面资金授权场景下必填。
   * @return sellerId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2088102146225135", value = "卖家支付宝用户ID。 当需要指定收款账号时,通过该参数传入,如果该值为空,则默认为商户签约账号对应的支付宝用户ID。 收款账号优先级规则:门店绑定的收款账户>请求传入的seller_id>商户签约账号对应的支付宝用户ID; 注:直付通和机构间联场景下seller_id无需传入或者保持跟pid一致; 如果传入的seller_id与pid不一致,需要联系支付宝小二配置收款关系; 支付宝预授权和新当面资金授权场景下必填。")

  public String getSellerId() {
    return sellerId;
  }


  public void setSellerId(String sellerId) {
    this.sellerId = sellerId;
  }


  public AlipayTradePayModel settleCurrency(String settleCurrency) {
    
    this.settleCurrency = settleCurrency;
    return this;
  }

   /**
   * 商户指定的结算币种,支持英镑:GBP、港币:HKD、美元:USD、新加坡元:SGD、日元:JPY、加拿大元:CAD、澳元:AUD、欧元:EUR、新西兰元:NZD、韩元:KRW、泰铢:THB、瑞士法郎:CHF、瑞典克朗:SEK、丹麦克朗:DKK、挪威克朗:NOK、马来西亚林吉特:MYR、印尼卢比:IDR、菲律宾比索:PHP、毛里求斯卢比:MUR、以色列新谢克尔:ILS、斯里兰卡卢比:LKR、俄罗斯卢布:RUB、阿联酋迪拉姆:AED、捷克克朗:CZK、南非兰特:ZAR、人民币:CNY
   * @return settleCurrency
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "USD", value = "商户指定的结算币种,支持英镑:GBP、港币:HKD、美元:USD、新加坡元:SGD、日元:JPY、加拿大元:CAD、澳元:AUD、欧元:EUR、新西兰元:NZD、韩元:KRW、泰铢:THB、瑞士法郎:CHF、瑞典克朗:SEK、丹麦克朗:DKK、挪威克朗:NOK、马来西亚林吉特:MYR、印尼卢比:IDR、菲律宾比索:PHP、毛里求斯卢比:MUR、以色列新谢克尔:ILS、斯里兰卡卢比:LKR、俄罗斯卢布:RUB、阿联酋迪拉姆:AED、捷克克朗:CZK、南非兰特:ZAR、人民币:CNY")

  public String getSettleCurrency() {
    return settleCurrency;
  }


  public void setSettleCurrency(String settleCurrency) {
    this.settleCurrency = settleCurrency;
  }


  public AlipayTradePayModel settleInfo(SettleInfo settleInfo) {
    
    this.settleInfo = settleInfo;
    return this;
  }

   /**
   * Get settleInfo
   * @return settleInfo
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public SettleInfo getSettleInfo() {
    return settleInfo;
  }


  public void setSettleInfo(SettleInfo settleInfo) {
    this.settleInfo = settleInfo;
  }


  public AlipayTradePayModel storeId(String storeId) {
    
    this.storeId = storeId;
    return this;
  }

   /**
   * 商户门店编号。 指商户创建门店时输入的门店编号。
   * @return storeId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "NJ_001", value = "商户门店编号。 指商户创建门店时输入的门店编号。")

  public String getStoreId() {
    return storeId;
  }


  public void setStoreId(String storeId) {
    this.storeId = storeId;
  }


  public AlipayTradePayModel subMerchant(SubMerchant subMerchant) {
    
    this.subMerchant = subMerchant;
    return this;
  }

   /**
   * Get subMerchant
   * @return subMerchant
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public SubMerchant getSubMerchant() {
    return subMerchant;
  }


  public void setSubMerchant(SubMerchant subMerchant) {
    this.subMerchant = subMerchant;
  }


  public AlipayTradePayModel subject(String subject) {
    
    this.subject = subject;
    return this;
  }

   /**
   * 订单标题。 注意:不可使用特殊字符,如 /,=,& 等。
   * @return subject
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "Iphone6 16G", value = "订单标题。 注意:不可使用特殊字符,如 /,=,& 等。")

  public String getSubject() {
    return subject;
  }


  public void setSubject(String subject) {
    this.subject = subject;
  }


  public AlipayTradePayModel terminalId(String terminalId) {
    
    this.terminalId = terminalId;
    return this;
  }

   /**
   * 商户机具终端编号。
   * @return terminalId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "NJ_T_001", value = "商户机具终端编号。")

  public String getTerminalId() {
    return terminalId;
  }


  public void setTerminalId(String terminalId) {
    this.terminalId = terminalId;
  }


  public AlipayTradePayModel terminalParams(String terminalParams) {
    
    this.terminalParams = terminalParams;
    return this;
  }

   /**
   * IOT设备信息。 通过集成IOTSDK的机具发起的交易时传入,取值为IOTSDK生成的业务签名值。
   * @return terminalParams
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "{\"terminalType\":\"IOT\",\"signature\":\"EXXXX\",\"apdidToken\":\"iBfdgYbXXX\",\"hardToken\":\"06014698AEFXXX\",\"time\":\"1533061133\",\"bizCode\":\"11002200020\",\"bizTid\":\"0100200mWXXX\",\"signedKeys\":\"authCode,totalAmount,apdidToken,hardToken,time,bizCode,bizTid\"}", value = "IOT设备信息。 通过集成IOTSDK的机具发起的交易时传入,取值为IOTSDK生成的业务签名值。")

  public String getTerminalParams() {
    return terminalParams;
  }


  public void setTerminalParams(String terminalParams) {
    this.terminalParams = terminalParams;
  }


  public AlipayTradePayModel timeExpire(String timeExpire) {
    
    this.timeExpire = timeExpire;
    return this;
  }

   /**
   * 订单绝对超时时间。 格式为yyyy-MM-dd HH:mm:ss。超时时间范围:1m~15d。 注:time_expire和timeout_express两者只需传入一个或者都不传,如果两者都传,优先使用time_expire。
   * @return timeExpire
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2021-12-31 10:05:00", value = "订单绝对超时时间。 格式为yyyy-MM-dd HH:mm:ss。超时时间范围:1m~15d。 注:time_expire和timeout_express两者只需传入一个或者都不传,如果两者都传,优先使用time_expire。")

  public String getTimeExpire() {
    return timeExpire;
  }


  public void setTimeExpire(String timeExpire) {
    this.timeExpire = timeExpire;
  }


  public AlipayTradePayModel timeoutExpress(String timeoutExpress) {
    
    this.timeoutExpress = timeoutExpress;
    return this;
  }

   /**
   * 订单相对超时时间。从交易创建时间开始计算。  该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m。  当面付场景默认值为3h;  其它场景默认值为15d;
   * @return timeoutExpress
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "90m", value = "订单相对超时时间。从交易创建时间开始计算。  该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m。  当面付场景默认值为3h;  其它场景默认值为15d;")

  public String getTimeoutExpress() {
    return timeoutExpress;
  }


  public void setTimeoutExpress(String timeoutExpress) {
    this.timeoutExpress = timeoutExpress;
  }


  public AlipayTradePayModel totalAmount(String totalAmount) {
    
    this.totalAmount = totalAmount;
    return this;
  }

   /**
   * 订单总金额。 单位为元,精确到小数点后两位,取值范围:[0.01,100000000] 。
   * @return totalAmount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "88.88", value = "订单总金额。 单位为元,精确到小数点后两位,取值范围:[0.01,100000000] 。")

  public String getTotalAmount() {
    return totalAmount;
  }


  public void setTotalAmount(String totalAmount) {
    this.totalAmount = totalAmount;
  }


  public AlipayTradePayModel transCurrency(String transCurrency) {
    
    this.transCurrency = transCurrency;
    return this;
  }

   /**
   * 标价币种,  total_amount 对应的币种单位。支持英镑:GBP、港币:HKD、美元:USD、新加坡元:SGD、日元:JPY、加拿大元:CAD、澳元:AUD、欧元:EUR、新西兰元:NZD、韩元:KRW、泰铢:THB、瑞士法郎:CHF、瑞典克朗:SEK、丹麦克朗:DKK、挪威克朗:NOK、马来西亚林吉特:MYR、印尼卢比:IDR、菲律宾比索:PHP、毛里求斯卢比:MUR、以色列新谢克尔:ILS、斯里兰卡卢比:LKR、俄罗斯卢布:RUB、阿联酋迪拉姆:AED、捷克克朗:CZK、南非兰特:ZAR、人民币:CNY
   * @return transCurrency
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "USD", value = "标价币种,  total_amount 对应的币种单位。支持英镑:GBP、港币:HKD、美元:USD、新加坡元:SGD、日元:JPY、加拿大元:CAD、澳元:AUD、欧元:EUR、新西兰元:NZD、韩元:KRW、泰铢:THB、瑞士法郎:CHF、瑞典克朗:SEK、丹麦克朗:DKK、挪威克朗:NOK、马来西亚林吉特:MYR、印尼卢比:IDR、菲律宾比索:PHP、毛里求斯卢比:MUR、以色列新谢克尔:ILS、斯里兰卡卢比:LKR、俄罗斯卢布:RUB、阿联酋迪拉姆:AED、捷克克朗:CZK、南非兰特:ZAR、人民币:CNY")

  public String getTransCurrency() {
    return transCurrency;
  }


  public void setTransCurrency(String transCurrency) {
    this.transCurrency = transCurrency;
  }


  public AlipayTradePayModel undiscountableAmount(String undiscountableAmount) {
    
    this.undiscountableAmount = undiscountableAmount;
    return this;
  }

   /**
   * 不可打折金额。 不参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]。  如果同时传入了【可打折金额】、【不可打折金额】和【订单总金额】,则必须满足如下条件:【订单总金额】=【可打折金额】+【不可打折金额】。 如果订单金额全部参与优惠计算,则【可打折金额】和【不可打折金额】都无需传入。
   * @return undiscountableAmount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "8.88", value = "不可打折金额。 不参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]。  如果同时传入了【可打折金额】、【不可打折金额】和【订单总金额】,则必须满足如下条件:【订单总金额】=【可打折金额】+【不可打折金额】。 如果订单金额全部参与优惠计算,则【可打折金额】和【不可打折金额】都无需传入。")

  public String getUndiscountableAmount() {
    return undiscountableAmount;
  }


  public void setUndiscountableAmount(String undiscountableAmount) {
    this.undiscountableAmount = undiscountableAmount;
  }

  /**
   * A container for additional, undeclared properties.
   * This is a holder for any undeclared properties as specified with
   * the 'additionalProperties' keyword in the OAS document.
   */
  private Map additionalProperties;

  /**
   * Set the additional (undeclared) property with the specified name and value.
   * If the property does not already exist, create it otherwise replace it.
   *
   * @param key name of the property
   * @param value value of the property
   * @return the AlipayTradePayModel instance itself
   */
  public AlipayTradePayModel putAdditionalProperty(String key, Object value) {
    if (this.additionalProperties == null) {
        this.additionalProperties = new HashMap();
    }
    this.additionalProperties.put(key, value);
    return this;
  }

  /**
   * Return the additional (undeclared) property.
   *
   * @return a map of objects
   */
  public Map getAdditionalProperties() {
    return additionalProperties;
  }

  /**
   * Return the additional (undeclared) property with the specified name.
   *
   * @param key name of the property
   * @return an object
   */
  public Object getAdditionalProperty(String key) {
    if (this.additionalProperties == null) {
        return null;
    }
    return this.additionalProperties.get(key);
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AlipayTradePayModel alipayTradePayModel = (AlipayTradePayModel) o;
    return Objects.equals(this.advancePaymentType, alipayTradePayModel.advancePaymentType) &&
        Objects.equals(this.agreementParams, alipayTradePayModel.agreementParams) &&
        Objects.equals(this.alipayStoreId, alipayTradePayModel.alipayStoreId) &&
        Objects.equals(this.authCode, alipayTradePayModel.authCode) &&
        Objects.equals(this.authConfirmMode, alipayTradePayModel.authConfirmMode) &&
        Objects.equals(this.authNo, alipayTradePayModel.authNo) &&
        Objects.equals(this.bkagentReqInfo, alipayTradePayModel.bkagentReqInfo) &&
        Objects.equals(this.body, alipayTradePayModel.body) &&
        Objects.equals(this.businessParams, alipayTradePayModel.businessParams) &&
        Objects.equals(this.buyerId, alipayTradePayModel.buyerId) &&
        Objects.equals(this.buyerOpenId, alipayTradePayModel.buyerOpenId) &&
        Objects.equals(this.disablePayChannels, alipayTradePayModel.disablePayChannels) &&
        Objects.equals(this.discountableAmount, alipayTradePayModel.discountableAmount) &&
        Objects.equals(this.extUserInfo, alipayTradePayModel.extUserInfo) &&
        Objects.equals(this.extendParams, alipayTradePayModel.extendParams) &&
        Objects.equals(this.goodsDetail, alipayTradePayModel.goodsDetail) &&
        Objects.equals(this.isAsyncPay, alipayTradePayModel.isAsyncPay) &&
        Objects.equals(this.merchantOrderNo, alipayTradePayModel.merchantOrderNo) &&
        Objects.equals(this.notifyUrl, alipayTradePayModel.notifyUrl) &&
        Objects.equals(this.operatorId, alipayTradePayModel.operatorId) &&
        Objects.equals(this.outTradeNo, alipayTradePayModel.outTradeNo) &&
        Objects.equals(this.passbackParams, alipayTradePayModel.passbackParams) &&
        Objects.equals(this.payParams, alipayTradePayModel.payParams) &&
        Objects.equals(this.productCode, alipayTradePayModel.productCode) &&
        Objects.equals(this.promoParams, alipayTradePayModel.promoParams) &&
        Objects.equals(this.queryOptions, alipayTradePayModel.queryOptions) &&
        Objects.equals(this.requestOrgPid, alipayTradePayModel.requestOrgPid) &&
        Objects.equals(this.royaltyInfo, alipayTradePayModel.royaltyInfo) &&
        Objects.equals(this.scene, alipayTradePayModel.scene) &&
        Objects.equals(this.sellerId, alipayTradePayModel.sellerId) &&
        Objects.equals(this.settleCurrency, alipayTradePayModel.settleCurrency) &&
        Objects.equals(this.settleInfo, alipayTradePayModel.settleInfo) &&
        Objects.equals(this.storeId, alipayTradePayModel.storeId) &&
        Objects.equals(this.subMerchant, alipayTradePayModel.subMerchant) &&
        Objects.equals(this.subject, alipayTradePayModel.subject) &&
        Objects.equals(this.terminalId, alipayTradePayModel.terminalId) &&
        Objects.equals(this.terminalParams, alipayTradePayModel.terminalParams) &&
        Objects.equals(this.timeExpire, alipayTradePayModel.timeExpire) &&
        Objects.equals(this.timeoutExpress, alipayTradePayModel.timeoutExpress) &&
        Objects.equals(this.totalAmount, alipayTradePayModel.totalAmount) &&
        Objects.equals(this.transCurrency, alipayTradePayModel.transCurrency) &&
        Objects.equals(this.undiscountableAmount, alipayTradePayModel.undiscountableAmount)&&
        Objects.equals(this.additionalProperties, alipayTradePayModel.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(advancePaymentType, agreementParams, alipayStoreId, authCode, authConfirmMode, authNo, bkagentReqInfo, body, businessParams, buyerId, buyerOpenId, disablePayChannels, discountableAmount, extUserInfo, extendParams, goodsDetail, isAsyncPay, merchantOrderNo, notifyUrl, operatorId, outTradeNo, passbackParams, payParams, productCode, promoParams, queryOptions, requestOrgPid, royaltyInfo, scene, sellerId, settleCurrency, settleInfo, storeId, subMerchant, subject, terminalId, terminalParams, timeExpire, timeoutExpress, totalAmount, transCurrency, undiscountableAmount, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AlipayTradePayModel {\n");
    sb.append("    advancePaymentType: ").append(toIndentedString(advancePaymentType)).append("\n");
    sb.append("    agreementParams: ").append(toIndentedString(agreementParams)).append("\n");
    sb.append("    alipayStoreId: ").append(toIndentedString(alipayStoreId)).append("\n");
    sb.append("    authCode: ").append(toIndentedString(authCode)).append("\n");
    sb.append("    authConfirmMode: ").append(toIndentedString(authConfirmMode)).append("\n");
    sb.append("    authNo: ").append(toIndentedString(authNo)).append("\n");
    sb.append("    bkagentReqInfo: ").append(toIndentedString(bkagentReqInfo)).append("\n");
    sb.append("    body: ").append(toIndentedString(body)).append("\n");
    sb.append("    businessParams: ").append(toIndentedString(businessParams)).append("\n");
    sb.append("    buyerId: ").append(toIndentedString(buyerId)).append("\n");
    sb.append("    buyerOpenId: ").append(toIndentedString(buyerOpenId)).append("\n");
    sb.append("    disablePayChannels: ").append(toIndentedString(disablePayChannels)).append("\n");
    sb.append("    discountableAmount: ").append(toIndentedString(discountableAmount)).append("\n");
    sb.append("    extUserInfo: ").append(toIndentedString(extUserInfo)).append("\n");
    sb.append("    extendParams: ").append(toIndentedString(extendParams)).append("\n");
    sb.append("    goodsDetail: ").append(toIndentedString(goodsDetail)).append("\n");
    sb.append("    isAsyncPay: ").append(toIndentedString(isAsyncPay)).append("\n");
    sb.append("    merchantOrderNo: ").append(toIndentedString(merchantOrderNo)).append("\n");
    sb.append("    notifyUrl: ").append(toIndentedString(notifyUrl)).append("\n");
    sb.append("    operatorId: ").append(toIndentedString(operatorId)).append("\n");
    sb.append("    outTradeNo: ").append(toIndentedString(outTradeNo)).append("\n");
    sb.append("    passbackParams: ").append(toIndentedString(passbackParams)).append("\n");
    sb.append("    payParams: ").append(toIndentedString(payParams)).append("\n");
    sb.append("    productCode: ").append(toIndentedString(productCode)).append("\n");
    sb.append("    promoParams: ").append(toIndentedString(promoParams)).append("\n");
    sb.append("    queryOptions: ").append(toIndentedString(queryOptions)).append("\n");
    sb.append("    requestOrgPid: ").append(toIndentedString(requestOrgPid)).append("\n");
    sb.append("    royaltyInfo: ").append(toIndentedString(royaltyInfo)).append("\n");
    sb.append("    scene: ").append(toIndentedString(scene)).append("\n");
    sb.append("    sellerId: ").append(toIndentedString(sellerId)).append("\n");
    sb.append("    settleCurrency: ").append(toIndentedString(settleCurrency)).append("\n");
    sb.append("    settleInfo: ").append(toIndentedString(settleInfo)).append("\n");
    sb.append("    storeId: ").append(toIndentedString(storeId)).append("\n");
    sb.append("    subMerchant: ").append(toIndentedString(subMerchant)).append("\n");
    sb.append("    subject: ").append(toIndentedString(subject)).append("\n");
    sb.append("    terminalId: ").append(toIndentedString(terminalId)).append("\n");
    sb.append("    terminalParams: ").append(toIndentedString(terminalParams)).append("\n");
    sb.append("    timeExpire: ").append(toIndentedString(timeExpire)).append("\n");
    sb.append("    timeoutExpress: ").append(toIndentedString(timeoutExpress)).append("\n");
    sb.append("    totalAmount: ").append(toIndentedString(totalAmount)).append("\n");
    sb.append("    transCurrency: ").append(toIndentedString(transCurrency)).append("\n");
    sb.append("    undiscountableAmount: ").append(toIndentedString(undiscountableAmount)).append("\n");
    sb.append("    additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }


  public static HashSet openapiFields;
  public static HashSet openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet();
    openapiFields.add("advance_payment_type");
    openapiFields.add("agreement_params");
    openapiFields.add("alipay_store_id");
    openapiFields.add("auth_code");
    openapiFields.add("auth_confirm_mode");
    openapiFields.add("auth_no");
    openapiFields.add("bkagent_req_info");
    openapiFields.add("body");
    openapiFields.add("business_params");
    openapiFields.add("buyer_id");
    openapiFields.add("buyer_open_id");
    openapiFields.add("disable_pay_channels");
    openapiFields.add("discountable_amount");
    openapiFields.add("ext_user_info");
    openapiFields.add("extend_params");
    openapiFields.add("goods_detail");
    openapiFields.add("is_async_pay");
    openapiFields.add("merchant_order_no");
    openapiFields.add("notify_url");
    openapiFields.add("operator_id");
    openapiFields.add("out_trade_no");
    openapiFields.add("passback_params");
    openapiFields.add("pay_params");
    openapiFields.add("product_code");
    openapiFields.add("promo_params");
    openapiFields.add("query_options");
    openapiFields.add("request_org_pid");
    openapiFields.add("royalty_info");
    openapiFields.add("scene");
    openapiFields.add("seller_id");
    openapiFields.add("settle_currency");
    openapiFields.add("settle_info");
    openapiFields.add("store_id");
    openapiFields.add("sub_merchant");
    openapiFields.add("subject");
    openapiFields.add("terminal_id");
    openapiFields.add("terminal_params");
    openapiFields.add("time_expire");
    openapiFields.add("timeout_express");
    openapiFields.add("total_amount");
    openapiFields.add("trans_currency");
    openapiFields.add("undiscountable_amount");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet();
  }

 /**
  * Validates the JSON Object and throws an exception if issues found
  *
  * @param jsonObj JSON Object
  * @throws IOException if the JSON Object is invalid with respect to AlipayTradePayModel
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (AlipayTradePayModel.openapiRequiredFields.isEmpty()) {
          return;
        } else { // has required fields
          throw new IllegalArgumentException(String.format("The required field(s) %s in AlipayTradePayModel is not found in the empty JSON string", AlipayTradePayModel.openapiRequiredFields.toString()));
        }
      }
      if (jsonObj.get("advance_payment_type") != null && !jsonObj.get("advance_payment_type").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `advance_payment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("advance_payment_type").toString()));
      }
      // validate the optional field `agreement_params`
      if (jsonObj.getAsJsonObject("agreement_params") != null) {
        AgreementParams.validateJsonObject(jsonObj.getAsJsonObject("agreement_params"));
      }
      if (jsonObj.get("alipay_store_id") != null && !jsonObj.get("alipay_store_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `alipay_store_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alipay_store_id").toString()));
      }
      if (jsonObj.get("auth_code") != null && !jsonObj.get("auth_code").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `auth_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auth_code").toString()));
      }
      if (jsonObj.get("auth_confirm_mode") != null && !jsonObj.get("auth_confirm_mode").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `auth_confirm_mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auth_confirm_mode").toString()));
      }
      if (jsonObj.get("auth_no") != null && !jsonObj.get("auth_no").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `auth_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auth_no").toString()));
      }
      // validate the optional field `bkagent_req_info`
      if (jsonObj.getAsJsonObject("bkagent_req_info") != null) {
        BkAgentReqInfo.validateJsonObject(jsonObj.getAsJsonObject("bkagent_req_info"));
      }
      if (jsonObj.get("body") != null && !jsonObj.get("body").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
      }
      // validate the optional field `business_params`
      if (jsonObj.getAsJsonObject("business_params") != null) {
        BusinessParams.validateJsonObject(jsonObj.getAsJsonObject("business_params"));
      }
      if (jsonObj.get("buyer_id") != null && !jsonObj.get("buyer_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `buyer_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("buyer_id").toString()));
      }
      if (jsonObj.get("buyer_open_id") != null && !jsonObj.get("buyer_open_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `buyer_open_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("buyer_open_id").toString()));
      }
      if (jsonObj.get("disable_pay_channels") != null && !jsonObj.get("disable_pay_channels").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `disable_pay_channels` to be a primitive type in the JSON string but got `%s`", jsonObj.get("disable_pay_channels").toString()));
      }
      if (jsonObj.get("discountable_amount") != null && !jsonObj.get("discountable_amount").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `discountable_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("discountable_amount").toString()));
      }
      // validate the optional field `ext_user_info`
      if (jsonObj.getAsJsonObject("ext_user_info") != null) {
        ExtUserInfo.validateJsonObject(jsonObj.getAsJsonObject("ext_user_info"));
      }
      // validate the optional field `extend_params`
      if (jsonObj.getAsJsonObject("extend_params") != null) {
        ExtendParams.validateJsonObject(jsonObj.getAsJsonObject("extend_params"));
      }
      JsonArray jsonArraygoodsDetail = jsonObj.getAsJsonArray("goods_detail");
      if (jsonArraygoodsDetail != null) {
        // ensure the json data is an array
        if (!jsonObj.get("goods_detail").isJsonArray()) {
          throw new IllegalArgumentException(String.format("Expected the field `goods_detail` to be an array in the JSON string but got `%s`", jsonObj.get("goods_detail").toString()));
        }

        // validate the optional field `goods_detail` (array)
        for (int i = 0; i < jsonArraygoodsDetail.size(); i++) {
          GoodsDetail.validateJsonObject(jsonArraygoodsDetail.get(i).getAsJsonObject());
        };
      }
      if (jsonObj.get("merchant_order_no") != null && !jsonObj.get("merchant_order_no").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `merchant_order_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchant_order_no").toString()));
      }
      if (jsonObj.get("notify_url") != null && !jsonObj.get("notify_url").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `notify_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notify_url").toString()));
      }
      if (jsonObj.get("operator_id") != null && !jsonObj.get("operator_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `operator_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator_id").toString()));
      }
      if (jsonObj.get("out_trade_no") != null && !jsonObj.get("out_trade_no").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `out_trade_no` to be a primitive type in the JSON string but got `%s`", jsonObj.get("out_trade_no").toString()));
      }
      if (jsonObj.get("passback_params") != null && !jsonObj.get("passback_params").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `passback_params` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passback_params").toString()));
      }
      // validate the optional field `pay_params`
      if (jsonObj.getAsJsonObject("pay_params") != null) {
        PayParams.validateJsonObject(jsonObj.getAsJsonObject("pay_params"));
      }
      if (jsonObj.get("product_code") != null && !jsonObj.get("product_code").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `product_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("product_code").toString()));
      }
      // validate the optional field `promo_params`
      if (jsonObj.getAsJsonObject("promo_params") != null) {
        PromoParam.validateJsonObject(jsonObj.getAsJsonObject("promo_params"));
      }
      // ensure the json data is an array
      if (jsonObj.get("query_options") != null && !jsonObj.get("query_options").isJsonArray()) {
        throw new IllegalArgumentException(String.format("Expected the field `query_options` to be an array in the JSON string but got `%s`", jsonObj.get("query_options").toString()));
      }
      if (jsonObj.get("request_org_pid") != null && !jsonObj.get("request_org_pid").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `request_org_pid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("request_org_pid").toString()));
      }
      // validate the optional field `royalty_info`
      if (jsonObj.getAsJsonObject("royalty_info") != null) {
        RoyaltyInfo.validateJsonObject(jsonObj.getAsJsonObject("royalty_info"));
      }
      if (jsonObj.get("scene") != null && !jsonObj.get("scene").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `scene` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scene").toString()));
      }
      if (jsonObj.get("seller_id") != null && !jsonObj.get("seller_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `seller_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("seller_id").toString()));
      }
      if (jsonObj.get("settle_currency") != null && !jsonObj.get("settle_currency").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `settle_currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("settle_currency").toString()));
      }
      // validate the optional field `settle_info`
      if (jsonObj.getAsJsonObject("settle_info") != null) {
        SettleInfo.validateJsonObject(jsonObj.getAsJsonObject("settle_info"));
      }
      if (jsonObj.get("store_id") != null && !jsonObj.get("store_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `store_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store_id").toString()));
      }
      // validate the optional field `sub_merchant`
      if (jsonObj.getAsJsonObject("sub_merchant") != null) {
        SubMerchant.validateJsonObject(jsonObj.getAsJsonObject("sub_merchant"));
      }
      if (jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
      }
      if (jsonObj.get("terminal_id") != null && !jsonObj.get("terminal_id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `terminal_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal_id").toString()));
      }
      if (jsonObj.get("terminal_params") != null && !jsonObj.get("terminal_params").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `terminal_params` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal_params").toString()));
      }
      if (jsonObj.get("time_expire") != null && !jsonObj.get("time_expire").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `time_expire` to be a primitive type in the JSON string but got `%s`", jsonObj.get("time_expire").toString()));
      }
      if (jsonObj.get("timeout_express") != null && !jsonObj.get("timeout_express").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `timeout_express` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeout_express").toString()));
      }
      if (jsonObj.get("total_amount") != null && !jsonObj.get("total_amount").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `total_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("total_amount").toString()));
      }
      if (jsonObj.get("trans_currency") != null && !jsonObj.get("trans_currency").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `trans_currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trans_currency").toString()));
      }
      if (jsonObj.get("undiscountable_amount") != null && !jsonObj.get("undiscountable_amount").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `undiscountable_amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("undiscountable_amount").toString()));
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public  TypeAdapter create(Gson gson, TypeToken type) {
       if (!AlipayTradePayModel.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'AlipayTradePayModel' and its subtypes
       }
       final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(AlipayTradePayModel.class));

       return (TypeAdapter) new TypeAdapter() {
           @Override
           public void write(JsonWriter out, AlipayTradePayModel value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             obj.remove("additionalProperties");
             // serialize additonal properties
             if (value.getAdditionalProperties() != null) {
               for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
                 if (entry.getValue() instanceof String)
                   obj.addProperty(entry.getKey(), (String) entry.getValue());
                 else if (entry.getValue() instanceof Number)
                   obj.addProperty(entry.getKey(), (Number) entry.getValue());
                 else if (entry.getValue() instanceof Boolean)
                   obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
                 else if (entry.getValue() instanceof Character)
                   obj.addProperty(entry.getKey(), (Character) entry.getValue());
                 else {
                   obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
                 }
               }
             }
             elementAdapter.write(out, obj);
           }

           @Override
           public AlipayTradePayModel read(JsonReader in) throws IOException {
             JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
             validateJsonObject(jsonObj);
             // store additional fields in the deserialized instance
             AlipayTradePayModel instance = thisAdapter.fromJsonTree(jsonObj);
             for (Map.Entry entry : jsonObj.entrySet()) {
               if (!openapiFields.contains(entry.getKey())) {
                 if (entry.getValue().isJsonPrimitive()) { // primitive type
                   if (entry.getValue().getAsJsonPrimitive().isString())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
                   else if (entry.getValue().getAsJsonPrimitive().isNumber())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
                   else if (entry.getValue().getAsJsonPrimitive().isBoolean())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
                   else
                     throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
                 } else { // non-primitive type
                   instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
                 }
               }
             }
             return instance;
           }

       }.nullSafe();
    }
  }

 /**
  * Create an instance of AlipayTradePayModel given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of AlipayTradePayModel
  * @throws IOException if the JSON string is invalid with respect to AlipayTradePayModel
  */
  public static AlipayTradePayModel fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, AlipayTradePayModel.class);
  }

 /**
  * Convert an instance of AlipayTradePayModel to an JSON string
  *
  * @return JSON string
  */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy