Package com.stripe.model.productcatalog
Class TrialOffer
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.productcatalog.TrialOffer
- All Implemented Interfaces:
HasId,StripeActiveObject,StripeObjectInterface
Trial offers let you define free or paid introductory pricing for a subscription item. A
TrialOffer specifies the price to charge during the trial, how many billing intervals the trial
lasts, and what price the subscription item transitions to when the trial ends. You attach a
TrialOffer to a subscription item using
items[current_trial][trial_offer] when creating
or updating a subscription.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about Duration, please refer to the API Reference.static classFor more details about EndBehavior, please refer to the API Reference.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic TrialOffercreate(TrialOfferCreateParams params) Creates a trial offer.static TrialOffercreate(TrialOfferCreateParams params, RequestOptions options) Creates a trial offer.static TrialOfferCreates a trial offer.static TrialOffercreate(Map<String, Object> params, RequestOptions options) Creates a trial offer.booleanWhether the trial offer is active.getId()Unique identifier for the object.If the object exists in live mode, the value istrue.A brief description of the trial offer, hidden from customers.String representing the object's type.getPrice()Get ID of expandablepriceobject.Get expandedprice.inthashCode()static TrialOfferCollectionlist(TrialOfferListParams params) Returns a list of trial offers.static TrialOfferCollectionlist(TrialOfferListParams params, RequestOptions options) Returns a list of trial offers.static TrialOfferCollectionReturns a list of trial offers.static TrialOfferCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of trial offers.static TrialOfferRetrieves the trial offer with the given ID.static TrialOfferretrieve(String id, RequestOptions options) Retrieves the trial offer with the given ID.static TrialOfferretrieve(String id, TrialOfferRetrieveParams params, RequestOptions options) Retrieves the trial offer with the given ID.static TrialOfferRetrieves the trial offer with the given ID.voidWhether the trial offer is active.voidsetDuration(TrialOffer.Duration duration) voidsetEndBehavior(TrialOffer.EndBehavior endBehavior) voidUnique identifier for the object.voidsetLivemode(Boolean livemode) If the object exists in live mode, the value istrue.voidsetNickname(String nickname) A brief description of the trial offer, hidden from customers.voidString representing the object's type.voidvoidsetPriceObject(Price expandableObject) voidsetResponseGetter(StripeResponseGetter responseGetter) Get expandedprice.update(TrialOfferUpdateParams params) Updates the specified trial offer by setting the values of the parameters passed.update(TrialOfferUpdateParams params, RequestOptions options) Updates the specified trial offer by setting the values of the parameters passed.Updates the specified trial offer by setting the values of the parameters passed.update(Map<String, Object> params, RequestOptions options) Updates the specified trial offer by setting the values of the parameters passed.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
TrialOffer
public TrialOffer()
-
-
Method Details
-
getPrice
Get ID of expandablepriceobject. -
setPrice
-
getPriceObject
Get expandedprice. -
setPriceObject
-
create
Creates a trial offer.- Throws:
StripeException
-
create
public static TrialOffer create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a trial offer.- Throws:
StripeException
-
create
Creates a trial offer.- Throws:
StripeException
-
create
public static TrialOffer create(TrialOfferCreateParams params, RequestOptions options) throws StripeException Creates a trial offer.- Throws:
StripeException
-
list
Returns a list of trial offers.- Throws:
StripeException
-
list
public static TrialOfferCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of trial offers.- Throws:
StripeException
-
list
Returns a list of trial offers.- Throws:
StripeException
-
list
public static TrialOfferCollection list(TrialOfferListParams params, RequestOptions options) throws StripeException Returns a list of trial offers.- Throws:
StripeException
-
retrieve
Retrieves the trial offer with the given ID.- Throws:
StripeException
-
retrieve
Retrieves the trial offer with the given ID.- Throws:
StripeException
-
retrieve
public static TrialOffer retrieve(String id, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the trial offer with the given ID.- Throws:
StripeException
-
retrieve
public static TrialOffer retrieve(String id, TrialOfferRetrieveParams params, RequestOptions options) throws StripeException Retrieves the trial offer with the given ID.- Throws:
StripeException
-
update
Updates the specified trial offer by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Throws:
StripeException
-
update
Updates the specified trial offer by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Throws:
StripeException
-
update
Updates the specified trial offer by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Throws:
StripeException
-
update
public TrialOffer update(TrialOfferUpdateParams params, RequestOptions options) throws StripeException Updates the specified trial offer by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Throws:
StripeException
-
setResponseGetter
Get expandedprice.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getActive
Whether the trial offer is active. Set to false to archive the trial offer. -
getDuration
-
getEndBehavior
-
getLivemode
If the object exists in live mode, the value istrue. If the object exists in test mode, the value isfalse. -
getNickname
A brief description of the trial offer, hidden from customers. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
product_catalog.trial_offer. -
setActive
Whether the trial offer is active. Set to false to archive the trial offer. -
setDuration
-
setEndBehavior
-
setId
Unique identifier for the object. -
setLivemode
If the object exists in live mode, the value istrue. If the object exists in test mode, the value isfalse. -
setNickname
A brief description of the trial offer, hidden from customers. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
product_catalog.trial_offer. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object.
-