Class PromotionCode

    • Constructor Detail

      • PromotionCode

        public PromotionCode()
    • Method Detail

      • getCustomer

        public java.lang.String getCustomer()
        Get ID of expandable customer object.
      • setCustomer

        public void setCustomer​(java.lang.String id)
      • getCustomerObject

        public Customer getCustomerObject()
        Get expanded customer.
      • setCustomerObject

        public void setCustomerObject​(Customer expandableObject)
      • retrieve

        public static PromotionCode retrieve​(java.lang.String promotionCode)
                                      throws StripeException
        Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use list with the desired code .
        Throws:
        StripeException
      • retrieve

        public static PromotionCode retrieve​(java.lang.String promotionCode,
                                             java.util.Map<java.lang.String,​java.lang.Object> params,
                                             RequestOptions options)
                                      throws StripeException
        Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use list with the desired code .
        Throws:
        StripeException
      • create

        public static PromotionCode create​(java.util.Map<java.lang.String,​java.lang.Object> params)
                                    throws StripeException
        A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
        Throws:
        StripeException
      • create

        public static PromotionCode create​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                           RequestOptions options)
                                    throws StripeException
        A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
        Throws:
        StripeException
      • getActive

        public java.lang.Boolean getActive()
        Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid.
      • getCode

        public java.lang.String getCode()
        The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer.
      • getCoupon

        public Coupon getCoupon()
        A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to invoices or orders. Coupons do not work with conventional one-off charges.
      • getCreated

        public java.lang.Long getCreated()
        Time at which the object was created. Measured in seconds since the Unix epoch.
      • getExpiresAt

        public java.lang.Long getExpiresAt()
        Date at which the promotion code can no longer be redeemed.
      • getLivemode

        public java.lang.Boolean getLivemode()
        Has the value true if the object exists in live mode or the value false if the object exists in test mode.
      • getMaxRedemptions

        public java.lang.Long getMaxRedemptions()
        Maximum number of times this promotion code can be redeemed.
      • getObject

        public java.lang.String getObject()
        String representing the object's type. Objects of the same type share the same value.

        Equal to promotion_code.

      • getTimesRedeemed

        public java.lang.Long getTimesRedeemed()
        Number of times this promotion code has been used.
      • setActive

        public void setActive​(java.lang.Boolean active)
        Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid.
      • setCode

        public void setCode​(java.lang.String code)
        The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer.
      • setCoupon

        public void setCoupon​(Coupon coupon)
        A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to invoices or orders. Coupons do not work with conventional one-off charges.
      • setCreated

        public void setCreated​(java.lang.Long created)
        Time at which the object was created. Measured in seconds since the Unix epoch.
      • setExpiresAt

        public void setExpiresAt​(java.lang.Long expiresAt)
        Date at which the promotion code can no longer be redeemed.
      • setId

        public void setId​(java.lang.String id)
        Unique identifier for the object.
      • setLivemode

        public void setLivemode​(java.lang.Boolean livemode)
        Has the value true if the object exists in live mode or the value false if the object exists in test mode.
      • setMaxRedemptions

        public void setMaxRedemptions​(java.lang.Long maxRedemptions)
        Maximum number of times this promotion code can be redeemed.
      • setMetadata

        public void setMetadata​(java.util.Map<java.lang.String,​java.lang.String> metadata)
        Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
      • setObject

        public void setObject​(java.lang.String object)
        String representing the object's type. Objects of the same type share the same value.

        Equal to promotion_code.

      • setTimesRedeemed

        public void setTimesRedeemed​(java.lang.Long timesRedeemed)
        Number of times this promotion code has been used.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getId

        public java.lang.String getId()
        Unique identifier for the object.
        Specified by:
        getId in interface HasId
      • getMetadata

        public java.util.Map<java.lang.String,​java.lang.String> getMetadata()
        Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
        Specified by:
        getMetadata in interface MetadataStore<PromotionCode>