<?php
/**
 * AlipayTradePayModel
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  Alipay\OpenAPISDK
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * 支付宝开放平台API
 *
 * 支付宝开放平台v3协议文档
 *
 * The version of the OpenAPI document: 2023-12-20
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.2.1
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Alipay\OpenAPISDK\Model;

use \ArrayAccess;
use \Alipay\OpenAPISDK\ObjectSerializer;

/**
 * AlipayTradePayModel Class Doc Comment
 *
 * @category Class
 * @package  Alipay\OpenAPISDK
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class AlipayTradePayModel implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $openAPIModelName = 'AlipayTradePayModel';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'advancePaymentType' => 'string',
        'agreementParams' => '\Alipay\OpenAPISDK\Model\AgreementParams',
        'alipayStoreId' => 'string',
        'authCode' => 'string',
        'authConfirmMode' => 'string',
        'authNo' => 'string',
        'bkagentReqInfo' => '\Alipay\OpenAPISDK\Model\BkAgentReqInfo',
        'body' => 'string',
        'businessParams' => '\Alipay\OpenAPISDK\Model\BusinessParams',
        'buyerId' => 'string',
        'buyerOpenId' => 'string',
        'disablePayChannels' => 'string',
        'discountableAmount' => 'string',
        'extUserInfo' => '\Alipay\OpenAPISDK\Model\ExtUserInfo',
        'extendParams' => '\Alipay\OpenAPISDK\Model\ExtendParams',
        'goodsDetail' => '\Alipay\OpenAPISDK\Model\GoodsDetail[]',
        'isAsyncPay' => 'bool',
        'merchantOrderNo' => 'string',
        'notifyUrl' => 'string',
        'operatorId' => 'string',
        'outTradeNo' => 'string',
        'passbackParams' => 'string',
        'payParams' => '\Alipay\OpenAPISDK\Model\PayParams',
        'productCode' => 'string',
        'promoParams' => '\Alipay\OpenAPISDK\Model\PromoParam',
        'queryOptions' => 'string[]',
        'requestOrgPid' => 'string',
        'royaltyInfo' => '\Alipay\OpenAPISDK\Model\RoyaltyInfo',
        'scene' => 'string',
        'sellerId' => 'string',
        'settleCurrency' => 'string',
        'settleInfo' => '\Alipay\OpenAPISDK\Model\SettleInfo',
        'storeId' => 'string',
        'subMerchant' => '\Alipay\OpenAPISDK\Model\SubMerchant',
        'subject' => 'string',
        'terminalId' => 'string',
        'terminalParams' => 'string',
        'timeExpire' => 'string',
        'timeoutExpress' => 'string',
        'totalAmount' => 'string',
        'transCurrency' => 'string',
        'undiscountableAmount' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'advancePaymentType' => null,
        'agreementParams' => null,
        'alipayStoreId' => null,
        'authCode' => null,
        'authConfirmMode' => null,
        'authNo' => null,
        'bkagentReqInfo' => null,
        'body' => null,
        'businessParams' => null,
        'buyerId' => null,
        'buyerOpenId' => null,
        'disablePayChannels' => null,
        'discountableAmount' => null,
        'extUserInfo' => null,
        'extendParams' => null,
        'goodsDetail' => null,
        'isAsyncPay' => null,
        'merchantOrderNo' => null,
        'notifyUrl' => null,
        'operatorId' => null,
        'outTradeNo' => null,
        'passbackParams' => null,
        'payParams' => null,
        'productCode' => null,
        'promoParams' => null,
        'queryOptions' => null,
        'requestOrgPid' => null,
        'royaltyInfo' => null,
        'scene' => null,
        'sellerId' => null,
        'settleCurrency' => null,
        'settleInfo' => null,
        'storeId' => null,
        'subMerchant' => null,
        'subject' => null,
        'terminalId' => null,
        'terminalParams' => null,
        'timeExpire' => null,
        'timeoutExpress' => null,
        'totalAmount' => null,
        'transCurrency' => null,
        'undiscountableAmount' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'advancePaymentType' => 'advance_payment_type',
        'agreementParams' => 'agreement_params',
        'alipayStoreId' => 'alipay_store_id',
        'authCode' => 'auth_code',
        'authConfirmMode' => 'auth_confirm_mode',
        'authNo' => 'auth_no',
        'bkagentReqInfo' => 'bkagent_req_info',
        'body' => 'body',
        'businessParams' => 'business_params',
        'buyerId' => 'buyer_id',
        'buyerOpenId' => 'buyer_open_id',
        'disablePayChannels' => 'disable_pay_channels',
        'discountableAmount' => 'discountable_amount',
        'extUserInfo' => 'ext_user_info',
        'extendParams' => 'extend_params',
        'goodsDetail' => 'goods_detail',
        'isAsyncPay' => 'is_async_pay',
        'merchantOrderNo' => 'merchant_order_no',
        'notifyUrl' => 'notify_url',
        'operatorId' => 'operator_id',
        'outTradeNo' => 'out_trade_no',
        'passbackParams' => 'passback_params',
        'payParams' => 'pay_params',
        'productCode' => 'product_code',
        'promoParams' => 'promo_params',
        'queryOptions' => 'query_options',
        'requestOrgPid' => 'request_org_pid',
        'royaltyInfo' => 'royalty_info',
        'scene' => 'scene',
        'sellerId' => 'seller_id',
        'settleCurrency' => 'settle_currency',
        'settleInfo' => 'settle_info',
        'storeId' => 'store_id',
        'subMerchant' => 'sub_merchant',
        'subject' => 'subject',
        'terminalId' => 'terminal_id',
        'terminalParams' => 'terminal_params',
        'timeExpire' => 'time_expire',
        'timeoutExpress' => 'timeout_express',
        'totalAmount' => 'total_amount',
        'transCurrency' => 'trans_currency',
        'undiscountableAmount' => 'undiscountable_amount'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'advancePaymentType' => 'setAdvancePaymentType',
        'agreementParams' => 'setAgreementParams',
        'alipayStoreId' => 'setAlipayStoreId',
        'authCode' => 'setAuthCode',
        'authConfirmMode' => 'setAuthConfirmMode',
        'authNo' => 'setAuthNo',
        'bkagentReqInfo' => 'setBkagentReqInfo',
        'body' => 'setBody',
        'businessParams' => 'setBusinessParams',
        'buyerId' => 'setBuyerId',
        'buyerOpenId' => 'setBuyerOpenId',
        'disablePayChannels' => 'setDisablePayChannels',
        'discountableAmount' => 'setDiscountableAmount',
        'extUserInfo' => 'setExtUserInfo',
        'extendParams' => 'setExtendParams',
        'goodsDetail' => 'setGoodsDetail',
        'isAsyncPay' => 'setIsAsyncPay',
        'merchantOrderNo' => 'setMerchantOrderNo',
        'notifyUrl' => 'setNotifyUrl',
        'operatorId' => 'setOperatorId',
        'outTradeNo' => 'setOutTradeNo',
        'passbackParams' => 'setPassbackParams',
        'payParams' => 'setPayParams',
        'productCode' => 'setProductCode',
        'promoParams' => 'setPromoParams',
        'queryOptions' => 'setQueryOptions',
        'requestOrgPid' => 'setRequestOrgPid',
        'royaltyInfo' => 'setRoyaltyInfo',
        'scene' => 'setScene',
        'sellerId' => 'setSellerId',
        'settleCurrency' => 'setSettleCurrency',
        'settleInfo' => 'setSettleInfo',
        'storeId' => 'setStoreId',
        'subMerchant' => 'setSubMerchant',
        'subject' => 'setSubject',
        'terminalId' => 'setTerminalId',
        'terminalParams' => 'setTerminalParams',
        'timeExpire' => 'setTimeExpire',
        'timeoutExpress' => 'setTimeoutExpress',
        'totalAmount' => 'setTotalAmount',
        'transCurrency' => 'setTransCurrency',
        'undiscountableAmount' => 'setUndiscountableAmount'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'advancePaymentType' => 'getAdvancePaymentType',
        'agreementParams' => 'getAgreementParams',
        'alipayStoreId' => 'getAlipayStoreId',
        'authCode' => 'getAuthCode',
        'authConfirmMode' => 'getAuthConfirmMode',
        'authNo' => 'getAuthNo',
        'bkagentReqInfo' => 'getBkagentReqInfo',
        'body' => 'getBody',
        'businessParams' => 'getBusinessParams',
        'buyerId' => 'getBuyerId',
        'buyerOpenId' => 'getBuyerOpenId',
        'disablePayChannels' => 'getDisablePayChannels',
        'discountableAmount' => 'getDiscountableAmount',
        'extUserInfo' => 'getExtUserInfo',
        'extendParams' => 'getExtendParams',
        'goodsDetail' => 'getGoodsDetail',
        'isAsyncPay' => 'getIsAsyncPay',
        'merchantOrderNo' => 'getMerchantOrderNo',
        'notifyUrl' => 'getNotifyUrl',
        'operatorId' => 'getOperatorId',
        'outTradeNo' => 'getOutTradeNo',
        'passbackParams' => 'getPassbackParams',
        'payParams' => 'getPayParams',
        'productCode' => 'getProductCode',
        'promoParams' => 'getPromoParams',
        'queryOptions' => 'getQueryOptions',
        'requestOrgPid' => 'getRequestOrgPid',
        'royaltyInfo' => 'getRoyaltyInfo',
        'scene' => 'getScene',
        'sellerId' => 'getSellerId',
        'settleCurrency' => 'getSettleCurrency',
        'settleInfo' => 'getSettleInfo',
        'storeId' => 'getStoreId',
        'subMerchant' => 'getSubMerchant',
        'subject' => 'getSubject',
        'terminalId' => 'getTerminalId',
        'terminalParams' => 'getTerminalParams',
        'timeExpire' => 'getTimeExpire',
        'timeoutExpress' => 'getTimeoutExpress',
        'totalAmount' => 'getTotalAmount',
        'transCurrency' => 'getTransCurrency',
        'undiscountableAmount' => 'getUndiscountableAmount'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }


    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['advancePaymentType'] = $data['advancePaymentType'] ?? null;
        $this->container['agreementParams'] = $data['agreementParams'] ?? null;
        $this->container['alipayStoreId'] = $data['alipayStoreId'] ?? null;
        $this->container['authCode'] = $data['authCode'] ?? null;
        $this->container['authConfirmMode'] = $data['authConfirmMode'] ?? null;
        $this->container['authNo'] = $data['authNo'] ?? null;
        $this->container['bkagentReqInfo'] = $data['bkagentReqInfo'] ?? null;
        $this->container['body'] = $data['body'] ?? null;
        $this->container['businessParams'] = $data['businessParams'] ?? null;
        $this->container['buyerId'] = $data['buyerId'] ?? null;
        $this->container['buyerOpenId'] = $data['buyerOpenId'] ?? null;
        $this->container['disablePayChannels'] = $data['disablePayChannels'] ?? null;
        $this->container['discountableAmount'] = $data['discountableAmount'] ?? null;
        $this->container['extUserInfo'] = $data['extUserInfo'] ?? null;
        $this->container['extendParams'] = $data['extendParams'] ?? null;
        $this->container['goodsDetail'] = $data['goodsDetail'] ?? null;
        $this->container['isAsyncPay'] = $data['isAsyncPay'] ?? null;
        $this->container['merchantOrderNo'] = $data['merchantOrderNo'] ?? null;
        $this->container['notifyUrl'] = $data['notifyUrl'] ?? null;
        $this->container['operatorId'] = $data['operatorId'] ?? null;
        $this->container['outTradeNo'] = $data['outTradeNo'] ?? null;
        $this->container['passbackParams'] = $data['passbackParams'] ?? null;
        $this->container['payParams'] = $data['payParams'] ?? null;
        $this->container['productCode'] = $data['productCode'] ?? null;
        $this->container['promoParams'] = $data['promoParams'] ?? null;
        $this->container['queryOptions'] = $data['queryOptions'] ?? null;
        $this->container['requestOrgPid'] = $data['requestOrgPid'] ?? null;
        $this->container['royaltyInfo'] = $data['royaltyInfo'] ?? null;
        $this->container['scene'] = $data['scene'] ?? null;
        $this->container['sellerId'] = $data['sellerId'] ?? null;
        $this->container['settleCurrency'] = $data['settleCurrency'] ?? null;
        $this->container['settleInfo'] = $data['settleInfo'] ?? null;
        $this->container['storeId'] = $data['storeId'] ?? null;
        $this->container['subMerchant'] = $data['subMerchant'] ?? null;
        $this->container['subject'] = $data['subject'] ?? null;
        $this->container['terminalId'] = $data['terminalId'] ?? null;
        $this->container['terminalParams'] = $data['terminalParams'] ?? null;
        $this->container['timeExpire'] = $data['timeExpire'] ?? null;
        $this->container['timeoutExpress'] = $data['timeoutExpress'] ?? null;
        $this->container['totalAmount'] = $data['totalAmount'] ?? null;
        $this->container['transCurrency'] = $data['transCurrency'] ?? null;
        $this->container['undiscountableAmount'] = $data['undiscountableAmount'] ?? null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets advancePaymentType
     *
     * @return string|null
     */
    public function getAdvancePaymentType()
    {
        return $this->container['advancePaymentType'];
    }

    /**
     * Sets advancePaymentType
     *
     * @param string|null $advancePaymentType 支付模式类型,若值为ENJOY_PAY_V2表示当前交易允许走先享后付2.0垫资
     *
     * @return self
     */
    public function setAdvancePaymentType($advancePaymentType)
    {
        $this->container['advancePaymentType'] = $advancePaymentType;

        return $this;
    }

    /**
     * Gets agreementParams
     *
     * @return \Alipay\OpenAPISDK\Model\AgreementParams|null
     */
    public function getAgreementParams()
    {
        return $this->container['agreementParams'];
    }

    /**
     * Sets agreementParams
     *
     * @param \Alipay\OpenAPISDK\Model\AgreementParams|null $agreementParams agreementParams
     *
     * @return self
     */
    public function setAgreementParams($agreementParams)
    {
        $this->container['agreementParams'] = $agreementParams;

        return $this;
    }

    /**
     * Gets alipayStoreId
     *
     * @return string|null
     */
    public function getAlipayStoreId()
    {
        return $this->container['alipayStoreId'];
    }

    /**
     * Sets alipayStoreId
     *
     * @param string|null $alipayStoreId 支付宝店铺编号。 指商户创建门店后支付宝生成的门店ID。
     *
     * @return self
     */
    public function setAlipayStoreId($alipayStoreId)
    {
        $this->container['alipayStoreId'] = $alipayStoreId;

        return $this;
    }

    /**
     * Gets authCode
     *
     * @return string|null
     */
    public function getAuthCode()
    {
        return $this->container['authCode'];
    }

    /**
     * Sets authCode
     *
     * @param string|null $authCode 支付授权码。 当面付场景传买家的付款码（25~30开头的长度为16~24位的数字，实际字符串长度以开发者获取的付款码长度为准）或者刷脸标识串（fp开头的35位字符串）； 周期扣款或代扣场景无需传入，协议号通过agreement_params参数传递；  支付宝预授权和新当面资金授权场景无需传入，授权订单号通过 auth_no字段传入。 注：交易的买家与卖家不能相同。
     *
     * @return self
     */
    public function setAuthCode($authCode)
    {
        $this->container['authCode'] = $authCode;

        return $this;
    }

    /**
     * Gets authConfirmMode
     *
     * @return string|null
     */
    public function getAuthConfirmMode()
    {
        return $this->container['authConfirmMode'];
    }

    /**
     * Sets authConfirmMode
     *
     * @param string|null $authConfirmMode 预授权确认模式。 适用于支付宝预授权和新当面资金授权场景。枚举值： COMPLETE：转交易完成后解冻剩余冻结金额； NOT_COMPLETE：转交易完成后不解冻剩余冻结金额； 默认值为NOT_COMPLETE。
     *
     * @return self
     */
    public function setAuthConfirmMode($authConfirmMode)
    {
        $this->container['authConfirmMode'] = $authConfirmMode;

        return $this;
    }

    /**
     * Gets authNo
     *
     * @return string|null
     */
    public function getAuthNo()
    {
        return $this->container['authNo'];
    }

    /**
     * Sets authNo
     *
     * @param string|null $authNo 资金预授权单号。 支付宝预授权和新当面资金授权场景下必填。
     *
     * @return self
     */
    public function setAuthNo($authNo)
    {
        $this->container['authNo'] = $authNo;

        return $this;
    }

    /**
     * Gets bkagentReqInfo
     *
     * @return \Alipay\OpenAPISDK\Model\BkAgentReqInfo|null
     */
    public function getBkagentReqInfo()
    {
        return $this->container['bkagentReqInfo'];
    }

    /**
     * Sets bkagentReqInfo
     *
     * @param \Alipay\OpenAPISDK\Model\BkAgentReqInfo|null $bkagentReqInfo bkagentReqInfo
     *
     * @return self
     */
    public function setBkagentReqInfo($bkagentReqInfo)
    {
        $this->container['bkagentReqInfo'] = $bkagentReqInfo;

        return $this;
    }

    /**
     * Gets body
     *
     * @return string|null
     */
    public function getBody()
    {
        return $this->container['body'];
    }

    /**
     * Sets body
     *
     * @param string|null $body 订单附加信息。 如果请求时传递了该参数，将在异步通知、对账单中原样返回，同时会在商户和用户的pc账单详情中作为交易描述展示
     *
     * @return self
     */
    public function setBody($body)
    {
        $this->container['body'] = $body;

        return $this;
    }

    /**
     * Gets businessParams
     *
     * @return \Alipay\OpenAPISDK\Model\BusinessParams|null
     */
    public function getBusinessParams()
    {
        return $this->container['businessParams'];
    }

    /**
     * Sets businessParams
     *
     * @param \Alipay\OpenAPISDK\Model\BusinessParams|null $businessParams businessParams
     *
     * @return self
     */
    public function setBusinessParams($businessParams)
    {
        $this->container['businessParams'] = $businessParams;

        return $this;
    }

    /**
     * Gets buyerId
     *
     * @return string|null
     */
    public function getBuyerId()
    {
        return $this->container['buyerId'];
    }

    /**
     * Sets buyerId
     *
     * @param string|null $buyerId 买家支付宝用户ID。 支付宝预授权和新当面资金授权场景下必填，其它场景不需要传入。
     *
     * @return self
     */
    public function setBuyerId($buyerId)
    {
        $this->container['buyerId'] = $buyerId;

        return $this;
    }

    /**
     * Gets buyerOpenId
     *
     * @return string|null
     */
    public function getBuyerOpenId()
    {
        return $this->container['buyerOpenId'];
    }

    /**
     * Sets buyerOpenId
     *
     * @param string|null $buyerOpenId 买家支付宝用户唯一标识
     *
     * @return self
     */
    public function setBuyerOpenId($buyerOpenId)
    {
        $this->container['buyerOpenId'] = $buyerOpenId;

        return $this;
    }

    /**
     * Gets disablePayChannels
     *
     * @return string|null
     */
    public function getDisablePayChannels()
    {
        return $this->container['disablePayChannels'];
    }

    /**
     * Sets disablePayChannels
     *
     * @param string|null $disablePayChannels 禁用支付渠道。 多个渠道以逗号分割，如同时禁用信用支付类型和积分，则传入：\"credit_group,point\"。 支持传入的值：<a target=\"_blank\" href=\"https://docs.open.alipay.com/common/wifww7\">渠道列表</a>
     *
     * @return self
     */
    public function setDisablePayChannels($disablePayChannels)
    {
        $this->container['disablePayChannels'] = $disablePayChannels;

        return $this;
    }

    /**
     * Gets discountableAmount
     *
     * @return string|null
     */
    public function getDiscountableAmount()
    {
        return $this->container['discountableAmount'];
    }

    /**
     * Sets discountableAmount
     *
     * @param string|null $discountableAmount 可打折金额。 参与优惠计算的金额，单位为元，精确到小数点后两位，取值范围[0.01,100000000]。  如果同时传入了【可打折金额】、【不可打折金额】和【订单总金额】，则必须满足如下条件：【订单总金额】=【可打折金额】+【不可打折金额】。 如果订单金额全部参与优惠计算，则【可打折金额】和【不可打折金额】都无需传入。
     *
     * @return self
     */
    public function setDiscountableAmount($discountableAmount)
    {
        $this->container['discountableAmount'] = $discountableAmount;

        return $this;
    }

    /**
     * Gets extUserInfo
     *
     * @return \Alipay\OpenAPISDK\Model\ExtUserInfo|null
     */
    public function getExtUserInfo()
    {
        return $this->container['extUserInfo'];
    }

    /**
     * Sets extUserInfo
     *
     * @param \Alipay\OpenAPISDK\Model\ExtUserInfo|null $extUserInfo extUserInfo
     *
     * @return self
     */
    public function setExtUserInfo($extUserInfo)
    {
        $this->container['extUserInfo'] = $extUserInfo;

        return $this;
    }

    /**
     * Gets extendParams
     *
     * @return \Alipay\OpenAPISDK\Model\ExtendParams|null
     */
    public function getExtendParams()
    {
        return $this->container['extendParams'];
    }

    /**
     * Sets extendParams
     *
     * @param \Alipay\OpenAPISDK\Model\ExtendParams|null $extendParams extendParams
     *
     * @return self
     */
    public function setExtendParams($extendParams)
    {
        $this->container['extendParams'] = $extendParams;

        return $this;
    }

    /**
     * Gets goodsDetail
     *
     * @return \Alipay\OpenAPISDK\Model\GoodsDetail[]|null
     */
    public function getGoodsDetail()
    {
        return $this->container['goodsDetail'];
    }

    /**
     * Sets goodsDetail
     *
     * @param \Alipay\OpenAPISDK\Model\GoodsDetail[]|null $goodsDetail 订单包含的商品列表信息，json格式。
     *
     * @return self
     */
    public function setGoodsDetail($goodsDetail)
    {
        $this->container['goodsDetail'] = $goodsDetail;

        return $this;
    }

    /**
     * Gets isAsyncPay
     *
     * @return bool|null
     */
    public function getIsAsyncPay()
    {
        return $this->container['isAsyncPay'];
    }

    /**
     * Sets isAsyncPay
     *
     * @param bool|null $isAsyncPay 是否异步支付，传入true时，表明本次期望走异步支付，会先将支付请求受理下来，再异步推进。商户可以通过交易的异步通知或者轮询交易的状态来确定最终的交易结果。 只在代扣场景下有效，其它场景无需传入。
     *
     * @return self
     */
    public function setIsAsyncPay($isAsyncPay)
    {
        $this->container['isAsyncPay'] = $isAsyncPay;

        return $this;
    }

    /**
     * Gets merchantOrderNo
     *
     * @return string|null
     */
    public function getMerchantOrderNo()
    {
        return $this->container['merchantOrderNo'];
    }

    /**
     * Sets merchantOrderNo
     *
     * @param string|null $merchantOrderNo 商户的原始订单号
     *
     * @return self
     */
    public function setMerchantOrderNo($merchantOrderNo)
    {
        $this->container['merchantOrderNo'] = $merchantOrderNo;

        return $this;
    }

    /**
     * Gets notifyUrl
     *
     * @return string|null
     */
    public function getNotifyUrl()
    {
        return $this->container['notifyUrl'];
    }

    /**
     * Sets notifyUrl
     *
     * @param string|null $notifyUrl 通知地址
     *
     * @return self
     */
    public function setNotifyUrl($notifyUrl)
    {
        $this->container['notifyUrl'] = $notifyUrl;

        return $this;
    }

    /**
     * Gets operatorId
     *
     * @return string|null
     */
    public function getOperatorId()
    {
        return $this->container['operatorId'];
    }

    /**
     * Sets operatorId
     *
     * @param string|null $operatorId 商户操作员编号。
     *
     * @return self
     */
    public function setOperatorId($operatorId)
    {
        $this->container['operatorId'] = $operatorId;

        return $this;
    }

    /**
     * Gets outTradeNo
     *
     * @return string|null
     */
    public function getOutTradeNo()
    {
        return $this->container['outTradeNo'];
    }

    /**
     * Sets outTradeNo
     *
     * @param string|null $outTradeNo 商户订单号。 由商家自定义，64个字符以内，仅支持字母、数字、下划线且需保证在商户端不重复。
     *
     * @return self
     */
    public function setOutTradeNo($outTradeNo)
    {
        $this->container['outTradeNo'] = $outTradeNo;

        return $this;
    }

    /**
     * Gets passbackParams
     *
     * @return string|null
     */
    public function getPassbackParams()
    {
        return $this->container['passbackParams'];
    }

    /**
     * Sets passbackParams
     *
     * @param string|null $passbackParams 公用回传参数。 如果请求时传递了该参数，支付宝会在异步通知时将该参数原样返回。
     *
     * @return self
     */
    public function setPassbackParams($passbackParams)
    {
        $this->container['passbackParams'] = $passbackParams;

        return $this;
    }

    /**
     * Gets payParams
     *
     * @return \Alipay\OpenAPISDK\Model\PayParams|null
     */
    public function getPayParams()
    {
        return $this->container['payParams'];
    }

    /**
     * Sets payParams
     *
     * @param \Alipay\OpenAPISDK\Model\PayParams|null $payParams payParams
     *
     * @return self
     */
    public function setPayParams($payParams)
    {
        $this->container['payParams'] = $payParams;

        return $this;
    }

    /**
     * Gets productCode
     *
     * @return string|null
     */
    public function getProductCode()
    {
        return $this->container['productCode'];
    }

    /**
     * Sets productCode
     *
     * @param string|null $productCode 产品码。 商家和支付宝签约的产品码。 枚举值（点击查看签约情况）： <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 self
     */
    public function setProductCode($productCode)
    {
        $this->container['productCode'] = $productCode;

        return $this;
    }

    /**
     * Gets promoParams
     *
     * @return \Alipay\OpenAPISDK\Model\PromoParam|null
     */
    public function getPromoParams()
    {
        return $this->container['promoParams'];
    }

    /**
     * Sets promoParams
     *
     * @param \Alipay\OpenAPISDK\Model\PromoParam|null $promoParams promoParams
     *
     * @return self
     */
    public function setPromoParams($promoParams)
    {
        $this->container['promoParams'] = $promoParams;

        return $this;
    }

    /**
     * Gets queryOptions
     *
     * @return string[]|null
     */
    public function getQueryOptions()
    {
        return $this->container['queryOptions'];
    }

    /**
     * Sets queryOptions
     *
     * @param string[]|null $queryOptions 返回参数选项。 商户通过传递该参数来定制同步需要额外返回的信息字段，数组格式。包括但不限于：[\"fund_bill_list\",\"voucher_detail_list\",\"enterprise_pay_info\",\"discount_goods_detail\",\"discount_amount\",\"mdiscount_amount\"]
     *
     * @return self
     */
    public function setQueryOptions($queryOptions)
    {
        $this->container['queryOptions'] = $queryOptions;

        return $this;
    }

    /**
     * Gets requestOrgPid
     *
     * @return string|null
     */
    public function getRequestOrgPid()
    {
        return $this->container['requestOrgPid'];
    }

    /**
     * Sets requestOrgPid
     *
     * @param string|null $requestOrgPid 收单机构(例如银行）的标识，填写该机构在支付宝的pid。只在机构间联场景下传递该值。
     *
     * @return self
     */
    public function setRequestOrgPid($requestOrgPid)
    {
        $this->container['requestOrgPid'] = $requestOrgPid;

        return $this;
    }

    /**
     * Gets royaltyInfo
     *
     * @return \Alipay\OpenAPISDK\Model\RoyaltyInfo|null
     */
    public function getRoyaltyInfo()
    {
        return $this->container['royaltyInfo'];
    }

    /**
     * Sets royaltyInfo
     *
     * @param \Alipay\OpenAPISDK\Model\RoyaltyInfo|null $royaltyInfo royaltyInfo
     *
     * @return self
     */
    public function setRoyaltyInfo($royaltyInfo)
    {
        $this->container['royaltyInfo'] = $royaltyInfo;

        return $this;
    }

    /**
     * Gets scene
     *
     * @return string|null
     */
    public function getScene()
    {
        return $this->container['scene'];
    }

    /**
     * Sets scene
     *
     * @param string|null $scene 支付场景。枚举值： bar_code：当面付条码支付场景； security_code：当面付刷脸支付场景，对应的auth_code为fp开头的刷脸标识串； 周期扣款或代扣场景无需传入，协议号通过agreement_params参数传递；  支付宝预授权和新当面资金授权场景无需传入，授权订单号通过 auth_no字段传入。 默认值为bar_code。
     *
     * @return self
     */
    public function setScene($scene)
    {
        $this->container['scene'] = $scene;

        return $this;
    }

    /**
     * Gets sellerId
     *
     * @return string|null
     */
    public function getSellerId()
    {
        return $this->container['sellerId'];
    }

    /**
     * Sets sellerId
     *
     * @param string|null $sellerId 卖家支付宝用户ID。 当需要指定收款账号时，通过该参数传入，如果该值为空，则默认为商户签约账号对应的支付宝用户ID。 收款账号优先级规则：门店绑定的收款账户>请求传入的seller_id>商户签约账号对应的支付宝用户ID； 注：直付通和机构间联场景下seller_id无需传入或者保持跟pid一致； 如果传入的seller_id与pid不一致，需要联系支付宝小二配置收款关系； 支付宝预授权和新当面资金授权场景下必填。
     *
     * @return self
     */
    public function setSellerId($sellerId)
    {
        $this->container['sellerId'] = $sellerId;

        return $this;
    }

    /**
     * Gets settleCurrency
     *
     * @return string|null
     */
    public function getSettleCurrency()
    {
        return $this->container['settleCurrency'];
    }

    /**
     * Sets settleCurrency
     *
     * @param string|null $settleCurrency 商户指定的结算币种，支持英镑：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 self
     */
    public function setSettleCurrency($settleCurrency)
    {
        $this->container['settleCurrency'] = $settleCurrency;

        return $this;
    }

    /**
     * Gets settleInfo
     *
     * @return \Alipay\OpenAPISDK\Model\SettleInfo|null
     */
    public function getSettleInfo()
    {
        return $this->container['settleInfo'];
    }

    /**
     * Sets settleInfo
     *
     * @param \Alipay\OpenAPISDK\Model\SettleInfo|null $settleInfo settleInfo
     *
     * @return self
     */
    public function setSettleInfo($settleInfo)
    {
        $this->container['settleInfo'] = $settleInfo;

        return $this;
    }

    /**
     * Gets storeId
     *
     * @return string|null
     */
    public function getStoreId()
    {
        return $this->container['storeId'];
    }

    /**
     * Sets storeId
     *
     * @param string|null $storeId 商户门店编号。 指商户创建门店时输入的门店编号。
     *
     * @return self
     */
    public function setStoreId($storeId)
    {
        $this->container['storeId'] = $storeId;

        return $this;
    }

    /**
     * Gets subMerchant
     *
     * @return \Alipay\OpenAPISDK\Model\SubMerchant|null
     */
    public function getSubMerchant()
    {
        return $this->container['subMerchant'];
    }

    /**
     * Sets subMerchant
     *
     * @param \Alipay\OpenAPISDK\Model\SubMerchant|null $subMerchant subMerchant
     *
     * @return self
     */
    public function setSubMerchant($subMerchant)
    {
        $this->container['subMerchant'] = $subMerchant;

        return $this;
    }

    /**
     * Gets subject
     *
     * @return string|null
     */
    public function getSubject()
    {
        return $this->container['subject'];
    }

    /**
     * Sets subject
     *
     * @param string|null $subject 订单标题。 注意：不可使用特殊字符，如 /，=，& 等。
     *
     * @return self
     */
    public function setSubject($subject)
    {
        $this->container['subject'] = $subject;

        return $this;
    }

    /**
     * Gets terminalId
     *
     * @return string|null
     */
    public function getTerminalId()
    {
        return $this->container['terminalId'];
    }

    /**
     * Sets terminalId
     *
     * @param string|null $terminalId 商户机具终端编号。
     *
     * @return self
     */
    public function setTerminalId($terminalId)
    {
        $this->container['terminalId'] = $terminalId;

        return $this;
    }

    /**
     * Gets terminalParams
     *
     * @return string|null
     */
    public function getTerminalParams()
    {
        return $this->container['terminalParams'];
    }

    /**
     * Sets terminalParams
     *
     * @param string|null $terminalParams IOT设备信息。 通过集成IOTSDK的机具发起的交易时传入，取值为IOTSDK生成的业务签名值。
     *
     * @return self
     */
    public function setTerminalParams($terminalParams)
    {
        $this->container['terminalParams'] = $terminalParams;

        return $this;
    }

    /**
     * Gets timeExpire
     *
     * @return string|null
     */
    public function getTimeExpire()
    {
        return $this->container['timeExpire'];
    }

    /**
     * Sets timeExpire
     *
     * @param string|null $timeExpire 订单绝对超时时间。 格式为yyyy-MM-dd HH:mm:ss。超时时间范围：1m~15d。 注：time_expire和timeout_express两者只需传入一个或者都不传，如果两者都传，优先使用time_expire。
     *
     * @return self
     */
    public function setTimeExpire($timeExpire)
    {
        $this->container['timeExpire'] = $timeExpire;

        return $this;
    }

    /**
     * Gets timeoutExpress
     *
     * @return string|null
     */
    public function getTimeoutExpress()
    {
        return $this->container['timeoutExpress'];
    }

    /**
     * Sets timeoutExpress
     *
     * @param string|null $timeoutExpress 订单相对超时时间。从交易创建时间开始计算。  该笔订单允许的最晚付款时间，逾期将关闭交易。取值范围：1m～15d。m-分钟，h-小时，d-天，1c-当天（1c-当天的情况下，无论交易何时创建，都在0点关闭）。 该参数数值不接受小数点， 如 1.5h，可转换为 90m。  当面付场景默认值为3h；  其它场景默认值为15d;
     *
     * @return self
     */
    public function setTimeoutExpress($timeoutExpress)
    {
        $this->container['timeoutExpress'] = $timeoutExpress;

        return $this;
    }

    /**
     * Gets totalAmount
     *
     * @return string|null
     */
    public function getTotalAmount()
    {
        return $this->container['totalAmount'];
    }

    /**
     * Sets totalAmount
     *
     * @param string|null $totalAmount 订单总金额。 单位为元，精确到小数点后两位，取值范围：[0.01,100000000] 。
     *
     * @return self
     */
    public function setTotalAmount($totalAmount)
    {
        $this->container['totalAmount'] = $totalAmount;

        return $this;
    }

    /**
     * Gets transCurrency
     *
     * @return string|null
     */
    public function getTransCurrency()
    {
        return $this->container['transCurrency'];
    }

    /**
     * Sets transCurrency
     *
     * @param string|null $transCurrency 标价币种,  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 self
     */
    public function setTransCurrency($transCurrency)
    {
        $this->container['transCurrency'] = $transCurrency;

        return $this;
    }

    /**
     * Gets undiscountableAmount
     *
     * @return string|null
     */
    public function getUndiscountableAmount()
    {
        return $this->container['undiscountableAmount'];
    }

    /**
     * Sets undiscountableAmount
     *
     * @param string|null $undiscountableAmount 不可打折金额。 不参与优惠计算的金额，单位为元，精确到小数点后两位，取值范围[0.01,100000000]。  如果同时传入了【可打折金额】、【不可打折金额】和【订单总金额】，则必须满足如下条件：【订单总金额】=【可打折金额】+【不可打折金额】。 如果订单金额全部参与优惠计算，则【可打折金额】和【不可打折金额】都无需传入。
     *
     * @return self
     */
    public function setUndiscountableAmount($undiscountableAmount)
    {
        $this->container['undiscountableAmount'] = $undiscountableAmount;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param int|null $offset Offset
     * @param mixed    $value  Value to be set
     *
     * @return void
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


