Class SourceCreateParams.Builder

  • Enclosing class:
    SourceCreateParams

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

      • Builder

        public Builder()
    • Method Detail

      • build

        public SourceCreateParams build()
        Finalize and obtain parameter instance from this builder.
      • setAmount

        public SourceCreateParams.Builder setAmount​(java.lang.Long amount)
        Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. Not supported for receiver type sources, where charge amount may not be specified until funds land.
      • setCustomer

        public SourceCreateParams.Builder setCustomer​(java.lang.String customer)
        The Customer to whom the original source is attached to. Must be set when the original source is not a Source (e.g., Card).
      • addExpand

        public SourceCreateParams.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 SourceCreateParams.expand for the field documentation.
      • addAllExpand

        public SourceCreateParams.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 SourceCreateParams.expand for the field documentation.
      • putExtraParam

        public SourceCreateParams.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 SourceCreateParams.extraParams for the field documentation.
      • putAllExtraParam

        public SourceCreateParams.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 SourceCreateParams.extraParams for the field documentation.
      • setFlow

        public SourceCreateParams.Builder setFlow​(SourceCreateParams.Flow flow)
        The authentication flow of the source to create. flow is one of redirect, receiver, code_verification, none. It is generally inferred unless a type supports multiple flows.
      • putMetadata

        public SourceCreateParams.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 SourceCreateParams.metadata for the field documentation.
      • putAllMetadata

        public SourceCreateParams.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 SourceCreateParams.metadata for the field documentation.
      • setOriginalSource

        public SourceCreateParams.Builder setOriginalSource​(java.lang.String originalSource)
        The source to share.
      • setStatementDescriptor

        public SourceCreateParams.Builder setStatementDescriptor​(java.lang.String statementDescriptor)
        An arbitrary string to be displayed on your customer's statement. As an example, if your website is RunClub and the item you're charging for is a race ticket, you may want to specify a statement_descriptor of RunClub 5K race ticket. While many payment types will display this information, some may not display it at all.
      • setToken

        public SourceCreateParams.Builder setToken​(java.lang.String token)
        An optional token used to create the source. When passed, token properties will override source parameters.