public class Subscription extends ApiResource implements HasId, MetadataStore<Subscription>
Modifier and Type | Class and Description |
---|---|
static class |
Subscription.BillingThresholds |
static class |
Subscription.PauseCollection |
static class |
Subscription.PendingInvoiceItemInterval |
static class |
Subscription.PendingUpdate |
static class |
Subscription.TransferData |
ApiResource.RequestMethod
CHARSET, GSON
PRETTY_PRINT_GSON
Constructor and Description |
---|
Subscription() |
Modifier and Type | Method and Description |
---|---|
Subscription |
cancel()
Cancels a customer’s subscription immediately.
|
Subscription |
cancel(java.util.Map<java.lang.String,java.lang.Object> params)
Cancels a customer’s subscription immediately.
|
Subscription |
cancel(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Cancels a customer’s subscription immediately.
|
Subscription |
cancel(SubscriptionCancelParams params)
Cancels a customer’s subscription immediately.
|
Subscription |
cancel(SubscriptionCancelParams params,
RequestOptions options)
Cancels a customer’s subscription immediately.
|
protected boolean |
canEqual(java.lang.Object other) |
static Subscription |
create(java.util.Map<java.lang.String,java.lang.Object> params)
Creates a new subscription on an existing customer.
|
static Subscription |
create(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Creates a new subscription on an existing customer.
|
static Subscription |
create(SubscriptionCreateParams params)
Creates a new subscription on an existing customer.
|
static Subscription |
create(SubscriptionCreateParams params,
RequestOptions options)
Creates a new subscription on an existing customer.
|
Discount |
deleteDiscount()
Removes the currently applied discount on a subscription.
|
Discount |
deleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params)
Removes the currently applied discount on a subscription.
|
Discount |
deleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Removes the currently applied discount on a subscription.
|
boolean |
equals(java.lang.Object o) |
java.math.BigDecimal |
getApplicationFeePercent()
A non-negative decimal between 0 and 100, with at most two decimal places.
|
java.lang.Long |
getBillingCycleAnchor()
Determines the date of the first full invoice, and, for plans with
month or year intervals, the day of the month for subsequent invoices. |
Subscription.BillingThresholds |
getBillingThresholds()
Define thresholds at which an invoice will be sent, and the subscription advanced to a new
billing period.
|
java.lang.Long |
getCancelAt()
A date in the future at which the subscription will automatically get canceled.
|
java.lang.Boolean |
getCancelAtPeriodEnd()
If the subscription has been canceled with the
at_period_end flag set to true ,
cancel_at_period_end on the subscription will be true. |
java.lang.Long |
getCanceledAt()
If the subscription has been canceled, the date of that cancellation.
|
java.lang.String |
getCollectionMethod()
Either
charge_automatically , or send_invoice . |
java.lang.Long |
getCreated()
Time at which the object was created.
|
java.lang.Long |
getCurrentPeriodEnd()
End of the current period that the subscription has been invoiced for.
|
java.lang.Long |
getCurrentPeriodStart()
Start of the current period that the subscription has been invoiced for.
|
java.lang.String |
getCustomer()
Get ID of expandable
customer object. |
Customer |
getCustomerObject()
Get expanded
customer . |
java.lang.Long |
getDaysUntilDue()
Number of days a customer has to pay invoices generated by this subscription.
|
java.lang.String |
getDefaultPaymentMethod()
Get ID of expandable
defaultPaymentMethod object. |
PaymentMethod |
getDefaultPaymentMethodObject()
Get expanded
defaultPaymentMethod . |
java.lang.String |
getDefaultSource()
Get ID of expandable
defaultSource object. |
PaymentSource |
getDefaultSourceObject()
Get expanded
defaultSource . |
java.util.List<TaxRate> |
getDefaultTaxRates()
The tax rates that will apply to any subscription item that does not have
tax_rates
set. |
Discount |
getDiscount()
Describes the current discount applied to this subscription, if there is one.
|
java.lang.Long |
getEndedAt()
If the subscription has ended, the date the subscription ended.
|
java.lang.String |
getId()
Unique identifier for the object.
|
SubscriptionItemCollection |
getItems()
List of subscription items, each with an attached plan.
|
java.lang.String |
getLatestInvoice()
Get ID of expandable
latestInvoice object. |
Invoice |
getLatestInvoiceObject()
Get expanded
latestInvoice . |
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. |
java.util.Map<java.lang.String,java.lang.String> |
getMetadata()
Set of key-value pairs that you can attach to an object.
|
java.lang.Long |
getNextPendingInvoiceItemInvoice()
Specifies the approximate timestamp on which any pending invoice items will be billed according
to the schedule provided at
pending_invoice_item_interval . |
java.lang.String |
getObject()
String representing the object's type.
|
Subscription.PauseCollection |
getPauseCollection()
If specified, payment collection for this subscription will be paused.
|
Subscription.PendingInvoiceItemInterval |
getPendingInvoiceItemInterval()
Specifies an interval for how often to bill for any pending invoice items.
|
java.lang.String |
getPendingSetupIntent()
Get ID of expandable
pendingSetupIntent object. |
SetupIntent |
getPendingSetupIntentObject()
Get expanded
pendingSetupIntent . |
Subscription.PendingUpdate |
getPendingUpdate()
If specified, pending
updates that will be applied to the subscription once the
latest_invoice has been
paid. |
Plan |
getPlan()
Hash describing the plan the customer is subscribed to.
|
java.lang.Long |
getQuantity()
The quantity of the plan to which the customer is subscribed.
|
java.lang.String |
getSchedule()
Get ID of expandable
schedule object. |
SubscriptionSchedule |
getScheduleObject()
Get expanded
schedule . |
java.lang.Long |
getStartDate()
Date when the subscription was first created.
|
java.lang.String |
getStatus()
Possible values are
incomplete , incomplete_expired , trialing , active , past_due , canceled , or unpaid . |
java.math.BigDecimal |
getTaxPercent()
If provided, each invoice created by this subscription will apply the tax rate, increasing the
amount billed to the customer.
|
Subscription.TransferData |
getTransferData()
If specified, the funds from the subscription's invoices will be transferred to the destination
and the ID of the resulting transfers will be found on the resulting charges.
|
java.lang.Long |
getTrialEnd()
If the subscription has a trial, the end of that trial.
|
java.lang.Long |
getTrialStart()
If the subscription has a trial, the beginning of that trial.
|
int |
hashCode() |
static SubscriptionCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params)
By default, returns a list of subscriptions that have not been canceled.
|
static SubscriptionCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
By default, returns a list of subscriptions that have not been canceled.
|
static SubscriptionCollection |
list(SubscriptionListParams params)
By default, returns a list of subscriptions that have not been canceled.
|
static SubscriptionCollection |
list(SubscriptionListParams params,
RequestOptions options)
By default, returns a list of subscriptions that have not been canceled.
|
static Subscription |
retrieve(java.lang.String subscriptionExposedId)
Retrieves the subscription with the given ID.
|
static Subscription |
retrieve(java.lang.String subscriptionExposedId,
java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Retrieves the subscription with the given ID.
|
static Subscription |
retrieve(java.lang.String subscriptionExposedId,
RequestOptions options)
Retrieves the subscription with the given ID.
|
static Subscription |
retrieve(java.lang.String subscriptionExposedId,
SubscriptionRetrieveParams params,
RequestOptions options)
Retrieves the subscription with the given ID.
|
void |
setApplicationFeePercent(java.math.BigDecimal applicationFeePercent)
A non-negative decimal between 0 and 100, with at most two decimal places.
|
void |
setBillingCycleAnchor(java.lang.Long billingCycleAnchor)
Determines the date of the first full invoice, and, for plans with
month or year intervals, the day of the month for subsequent invoices. |
void |
setBillingThresholds(Subscription.BillingThresholds billingThresholds)
Define thresholds at which an invoice will be sent, and the subscription advanced to a new
billing period.
|
void |
setCancelAt(java.lang.Long cancelAt)
A date in the future at which the subscription will automatically get canceled.
|
void |
setCancelAtPeriodEnd(java.lang.Boolean cancelAtPeriodEnd)
If the subscription has been canceled with the
at_period_end flag set to true ,
cancel_at_period_end on the subscription will be true. |
void |
setCanceledAt(java.lang.Long canceledAt)
If the subscription has been canceled, the date of that cancellation.
|
void |
setCollectionMethod(java.lang.String collectionMethod)
Either
charge_automatically , or send_invoice . |
void |
setCreated(java.lang.Long created)
Time at which the object was created.
|
void |
setCurrentPeriodEnd(java.lang.Long currentPeriodEnd)
End of the current period that the subscription has been invoiced for.
|
void |
setCurrentPeriodStart(java.lang.Long currentPeriodStart)
Start of the current period that the subscription has been invoiced for.
|
void |
setCustomer(java.lang.String id) |
void |
setCustomerObject(Customer expandableObject) |
void |
setDaysUntilDue(java.lang.Long daysUntilDue)
Number of days a customer has to pay invoices generated by this subscription.
|
void |
setDefaultPaymentMethod(java.lang.String id) |
void |
setDefaultPaymentMethodObject(PaymentMethod expandableObject) |
void |
setDefaultSource(java.lang.String id) |
void |
setDefaultSourceObject(PaymentSource expandableObject) |
void |
setDefaultTaxRates(java.util.List<TaxRate> defaultTaxRates)
The tax rates that will apply to any subscription item that does not have
tax_rates
set. |
void |
setDiscount(Discount discount)
Describes the current discount applied to this subscription, if there is one.
|
void |
setEndedAt(java.lang.Long endedAt)
If the subscription has ended, the date the subscription ended.
|
void |
setId(java.lang.String id)
Unique identifier for the object.
|
void |
setItems(SubscriptionItemCollection items)
List of subscription items, each with an attached plan.
|
void |
setLatestInvoice(java.lang.String id) |
void |
setLatestInvoiceObject(Invoice expandableObject) |
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. |
void |
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object.
|
void |
setNextPendingInvoiceItemInvoice(java.lang.Long nextPendingInvoiceItemInvoice)
Specifies the approximate timestamp on which any pending invoice items will be billed according
to the schedule provided at
pending_invoice_item_interval . |
void |
setObject(java.lang.String object)
String representing the object's type.
|
void |
setPauseCollection(Subscription.PauseCollection pauseCollection)
If specified, payment collection for this subscription will be paused.
|
void |
setPendingInvoiceItemInterval(Subscription.PendingInvoiceItemInterval pendingInvoiceItemInterval)
Specifies an interval for how often to bill for any pending invoice items.
|
void |
setPendingSetupIntent(java.lang.String id) |
void |
setPendingSetupIntentObject(SetupIntent expandableObject) |
void |
setPendingUpdate(Subscription.PendingUpdate pendingUpdate)
If specified, pending
updates that will be applied to the subscription once the
latest_invoice has been
paid. |
void |
setPlan(Plan plan)
Hash describing the plan the customer is subscribed to.
|
void |
setQuantity(java.lang.Long quantity)
The quantity of the plan to which the customer is subscribed.
|
void |
setSchedule(java.lang.String id) |
void |
setScheduleObject(SubscriptionSchedule expandableObject) |
void |
setStartDate(java.lang.Long startDate)
Date when the subscription was first created.
|
void |
setStatus(java.lang.String status)
Possible values are
incomplete , incomplete_expired , trialing , active , past_due , canceled , or unpaid . |
void |
setTaxPercent(java.math.BigDecimal taxPercent)
If provided, each invoice created by this subscription will apply the tax rate, increasing the
amount billed to the customer.
|
void |
setTransferData(Subscription.TransferData transferData)
If specified, the funds from the subscription's invoices will be transferred to the destination
and the ID of the resulting transfers will be found on the resulting charges.
|
void |
setTrialEnd(java.lang.Long trialEnd)
If the subscription has a trial, the end of that trial.
|
void |
setTrialStart(java.lang.Long trialStart)
If the subscription has a trial, the beginning of that trial.
|
Subscription |
update(java.util.Map<java.lang.String,java.lang.Object> params)
Updates an existing subscription on a customer to match the specified parameters.
|
Subscription |
update(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Updates an existing subscription on a customer to match the specified parameters.
|
Subscription |
update(SubscriptionUpdateParams params)
Updates an existing subscription on a customer to match the specified parameters.
|
Subscription |
update(SubscriptionUpdateParams params,
RequestOptions options)
Updates an existing subscription on a customer to match the specified parameters.
|
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
public java.lang.String getCustomer()
customer
object.public void setCustomer(java.lang.String id)
public Customer getCustomerObject()
customer
.public void setCustomerObject(Customer expandableObject)
public java.lang.String getDefaultPaymentMethod()
defaultPaymentMethod
object.public void setDefaultPaymentMethod(java.lang.String id)
public PaymentMethod getDefaultPaymentMethodObject()
defaultPaymentMethod
.public void setDefaultPaymentMethodObject(PaymentMethod expandableObject)
public java.lang.String getDefaultSource()
defaultSource
object.public void setDefaultSource(java.lang.String id)
public PaymentSource getDefaultSourceObject()
defaultSource
.public void setDefaultSourceObject(PaymentSource expandableObject)
public java.lang.String getLatestInvoice()
latestInvoice
object.public void setLatestInvoice(java.lang.String id)
public Invoice getLatestInvoiceObject()
latestInvoice
.public void setLatestInvoiceObject(Invoice expandableObject)
public java.lang.String getPendingSetupIntent()
pendingSetupIntent
object.public void setPendingSetupIntent(java.lang.String id)
public SetupIntent getPendingSetupIntentObject()
pendingSetupIntent
.public void setPendingSetupIntentObject(SetupIntent expandableObject)
public java.lang.String getSchedule()
schedule
object.public void setSchedule(java.lang.String id)
public SubscriptionSchedule getScheduleObject()
schedule
.public void setScheduleObject(SubscriptionSchedule expandableObject)
public static SubscriptionCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
status=canceled
.StripeException
public static SubscriptionCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
status=canceled
.StripeException
public static SubscriptionCollection list(SubscriptionListParams params) throws StripeException
status=canceled
.StripeException
public static SubscriptionCollection list(SubscriptionListParams params, RequestOptions options) throws StripeException
status=canceled
.StripeException
public static Subscription create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
StripeException
public static Subscription create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public static Subscription create(SubscriptionCreateParams params) throws StripeException
StripeException
public static Subscription create(SubscriptionCreateParams params, RequestOptions options) throws StripeException
StripeException
public Subscription update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
update
in interface MetadataStore<Subscription>
StripeException
public Subscription update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
update
in interface MetadataStore<Subscription>
StripeException
public Subscription update(SubscriptionUpdateParams params) throws StripeException
StripeException
public Subscription update(SubscriptionUpdateParams params, RequestOptions options) throws StripeException
StripeException
public static Subscription retrieve(java.lang.String subscriptionExposedId) throws StripeException
StripeException
public static Subscription retrieve(java.lang.String subscriptionExposedId, RequestOptions options) throws StripeException
StripeException
public static Subscription retrieve(java.lang.String subscriptionExposedId, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public static Subscription retrieve(java.lang.String subscriptionExposedId, SubscriptionRetrieveParams params, RequestOptions options) throws StripeException
StripeException
public Subscription cancel() throws StripeException
Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
StripeException
public Subscription cancel(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
StripeException
public Subscription cancel(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
StripeException
public Subscription cancel(SubscriptionCancelParams params) throws StripeException
Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
StripeException
public Subscription cancel(SubscriptionCancelParams params, RequestOptions options) throws StripeException
Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
StripeException
public Discount deleteDiscount() throws StripeException
StripeException
public Discount deleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
StripeException
public Discount deleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public java.math.BigDecimal getApplicationFeePercent()
public java.lang.Long getBillingCycleAnchor()
month
or year
intervals, the day of the month for subsequent invoices.public Subscription.BillingThresholds getBillingThresholds()
public java.lang.Long getCancelAt()
public java.lang.Boolean getCancelAtPeriodEnd()
at_period_end
flag set to true
,
cancel_at_period_end
on the subscription will be true. You can use this attribute to
determine whether a subscription that has a status of active is scheduled to be canceled at the
end of the current period.public java.lang.Long getCanceledAt()
cancel_at_period_end
, canceled_at
will still reflect the date of
the initial cancellation request, not the end of the subscription period when the subscription
is automatically moved to a canceled state.public java.lang.String getCollectionMethod()
charge_automatically
, or send_invoice
. When charging automatically,
Stripe will attempt to pay this subscription at the end of the cycle using the default source
attached to the customer. When sending an invoice, Stripe will email your customer an invoice
with payment instructions.
One of charge_automatically
, or send_invoice
.
public java.lang.Long getCreated()
public java.lang.Long getCurrentPeriodEnd()
public java.lang.Long getCurrentPeriodStart()
public java.lang.Long getDaysUntilDue()
null
for subscriptions where collection_method=charge_automatically
.public java.util.List<TaxRate> getDefaultTaxRates()
tax_rates
set. Invoices created will have their default_tax_rates
populated from the
subscription.public Discount getDiscount()
public java.lang.Long getEndedAt()
public SubscriptionItemCollection getItems()
public java.lang.Boolean getLivemode()
true
if the object exists in live mode or the value false
if the
object exists in test mode.public java.lang.Long getNextPendingInvoiceItemInvoice()
pending_invoice_item_interval
.public java.lang.String getObject()
Equal to subscription
.
public Subscription.PauseCollection getPauseCollection()
public Subscription.PendingInvoiceItemInterval getPendingInvoiceItemInterval()
public Subscription.PendingUpdate getPendingUpdate()
latest_invoice
has been
paid.public Plan getPlan()
public java.lang.Long getQuantity()
public java.lang.Long getStartDate()
created
date due to backdating.public java.lang.String getStatus()
incomplete
, incomplete_expired
, trialing
, active
, past_due
, canceled
, or unpaid
.
For collection_method=charge_automatically
a subscription moves into incomplete
if the initial payment attempt fails. A subscription in this state can only have
metadata and default_source updated. Once the first invoice is paid, the subscription moves
into an active
state. If the first invoice is not paid within 23 hours, the
subscription transitions to incomplete_expired
. This is a terminal state, the open
invoice will be voided and no further invoices will be generated.
A subscription that is currently in a trial period is trialing
and moves to active
when the trial period is over.
If subscription collection_method=charge_automatically
it becomes past_due
when payment to renew it fails and canceled
or unpaid
(depending on your
subscriptions settings) when Stripe has exhausted all payment retry attempts.
If subscription collection_method=send_invoice
it becomes past_due
when its
invoice is not paid by the due date, and canceled
or unpaid
if it is still not
paid by an additional deadline after that. Note that when a subscription has a status of unpaid
, no subsequent invoices will be attempted (invoices will be created, but then
immediately automatically closed). After receiving updated payment information from a customer,
you may choose to reopen and pay their closed invoices.
One of active
, canceled
, incomplete
, incomplete_expired
,
past_due
, trialing
, or unpaid
.
public java.math.BigDecimal getTaxPercent()
public Subscription.TransferData getTransferData()
public java.lang.Long getTrialEnd()
public java.lang.Long getTrialStart()
public void setApplicationFeePercent(java.math.BigDecimal applicationFeePercent)
public void setBillingCycleAnchor(java.lang.Long billingCycleAnchor)
month
or year
intervals, the day of the month for subsequent invoices.public void setBillingThresholds(Subscription.BillingThresholds billingThresholds)
public void setCancelAt(java.lang.Long cancelAt)
public void setCancelAtPeriodEnd(java.lang.Boolean cancelAtPeriodEnd)
at_period_end
flag set to true
,
cancel_at_period_end
on the subscription will be true. You can use this attribute to
determine whether a subscription that has a status of active is scheduled to be canceled at the
end of the current period.public void setCanceledAt(java.lang.Long canceledAt)
cancel_at_period_end
, canceled_at
will still reflect the date of
the initial cancellation request, not the end of the subscription period when the subscription
is automatically moved to a canceled state.public void setCollectionMethod(java.lang.String collectionMethod)
charge_automatically
, or send_invoice
. When charging automatically,
Stripe will attempt to pay this subscription at the end of the cycle using the default source
attached to the customer. When sending an invoice, Stripe will email your customer an invoice
with payment instructions.
One of charge_automatically
, or send_invoice
.
public void setCreated(java.lang.Long created)
public void setCurrentPeriodEnd(java.lang.Long currentPeriodEnd)
public void setCurrentPeriodStart(java.lang.Long currentPeriodStart)
public void setDaysUntilDue(java.lang.Long daysUntilDue)
null
for subscriptions where collection_method=charge_automatically
.public void setDefaultTaxRates(java.util.List<TaxRate> defaultTaxRates)
tax_rates
set. Invoices created will have their default_tax_rates
populated from the
subscription.public void setDiscount(Discount discount)
public void setEndedAt(java.lang.Long endedAt)
public void setId(java.lang.String id)
public void setItems(SubscriptionItemCollection items)
public void setLivemode(java.lang.Boolean livemode)
true
if the object exists in live mode or the value false
if the
object exists in test mode.public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
public void setNextPendingInvoiceItemInvoice(java.lang.Long nextPendingInvoiceItemInvoice)
pending_invoice_item_interval
.public void setObject(java.lang.String object)
Equal to subscription
.
public void setPauseCollection(Subscription.PauseCollection pauseCollection)
public void setPendingInvoiceItemInterval(Subscription.PendingInvoiceItemInterval pendingInvoiceItemInterval)
public void setPendingUpdate(Subscription.PendingUpdate pendingUpdate)
latest_invoice
has been
paid.public void setPlan(Plan plan)
public void setQuantity(java.lang.Long quantity)
public void setStartDate(java.lang.Long startDate)
created
date due to backdating.public void setStatus(java.lang.String status)
incomplete
, incomplete_expired
, trialing
, active
, past_due
, canceled
, or unpaid
.
For collection_method=charge_automatically
a subscription moves into incomplete
if the initial payment attempt fails. A subscription in this state can only have
metadata and default_source updated. Once the first invoice is paid, the subscription moves
into an active
state. If the first invoice is not paid within 23 hours, the
subscription transitions to incomplete_expired
. This is a terminal state, the open
invoice will be voided and no further invoices will be generated.
A subscription that is currently in a trial period is trialing
and moves to active
when the trial period is over.
If subscription collection_method=charge_automatically
it becomes past_due
when payment to renew it fails and canceled
or unpaid
(depending on your
subscriptions settings) when Stripe has exhausted all payment retry attempts.
If subscription collection_method=send_invoice
it becomes past_due
when its
invoice is not paid by the due date, and canceled
or unpaid
if it is still not
paid by an additional deadline after that. Note that when a subscription has a status of unpaid
, no subsequent invoices will be attempted (invoices will be created, but then
immediately automatically closed). After receiving updated payment information from a customer,
you may choose to reopen and pay their closed invoices.
One of active
, canceled
, incomplete
, incomplete_expired
,
past_due
, trialing
, or unpaid
.
public void setTaxPercent(java.math.BigDecimal taxPercent)
public void setTransferData(Subscription.TransferData transferData)
public void setTrialEnd(java.lang.Long trialEnd)
public void setTrialStart(java.lang.Long trialStart)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getId()
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
getMetadata
in interface MetadataStore<Subscription>