Class OrderCreateParams.Builder

  • Enclosing class:
    OrderCreateParams

    public static class OrderCreateParams.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • build

        public OrderCreateParams build()
        Finalize and obtain parameter instance from this builder.
      • setCoupon

        public OrderCreateParams.Builder setCoupon​(java.lang.String coupon)
        A coupon code that represents a discount to be applied to this order. Must be one-time duration and in same currency as the order. An order can have multiple coupons.
      • setCustomer

        public OrderCreateParams.Builder setCustomer​(java.lang.String customer)
        The ID of an existing customer to use for this order. If provided, the customer email and shipping address will be used to create the order. Subsequently, the customer will also be charged to pay the order. If email or shipping are also provided, they will override the values retrieved from the customer object.
      • setEmail

        public OrderCreateParams.Builder setEmail​(java.lang.String email)
        The email address of the customer placing the order.
      • addExpand

        public OrderCreateParams.Builder addExpand​(java.lang.String element)
        Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See OrderCreateParams.expand for the field documentation.
      • addAllExpand

        public OrderCreateParams.Builder addAllExpand​(java.util.List<java.lang.String> elements)
        Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See OrderCreateParams.expand for the field documentation.
      • putExtraParam

        public OrderCreateParams.Builder putExtraParam​(java.lang.String key,
                                                       java.lang.Object value)
        Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See OrderCreateParams.extraParams for the field documentation.
      • putAllExtraParam

        public OrderCreateParams.Builder putAllExtraParam​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Add all map key/value pairs to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See OrderCreateParams.extraParams for the field documentation.
      • putMetadata

        public OrderCreateParams.Builder putMetadata​(java.lang.String key,
                                                     java.lang.String value)
        Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See OrderCreateParams.metadata for the field documentation.
      • putAllMetadata

        public OrderCreateParams.Builder putAllMetadata​(java.util.Map<java.lang.String,​java.lang.String> map)
        Add all map key/value pairs to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See OrderCreateParams.metadata for the field documentation.