Package com.stripe.model.testhelpers
Class TestClock
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.testhelpers.TestClock
- All Implemented Interfaces:
HasId,StripeActiveObject,StripeObjectInterface
A test clock enables deterministic control over objects in testmode. With a test clock, you can
create objects at a frozen time in the past or future, and advance to a specific future time to
observe webhooks and state changes. After the clock advances, you can either validate the current
state of your scenario (and test your assumptions), change the current state of your scenario
(and test more complex scenarios), or keep advancing forward in time.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about StatusDetails, 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 TypeMethodDescriptionadvance(TestClockAdvanceParams params) Starts advancing a test clock to a specified time in the future.advance(TestClockAdvanceParams params, RequestOptions options) Starts advancing a test clock to a specified time in the future.Starts advancing a test clock to a specified time in the future.advance(Map<String, Object> params, RequestOptions options) Starts advancing a test clock to a specified time in the future.protected booleanstatic TestClockcreate(TestClockCreateParams params) Creates a new test clock that can be attached to new customers and quotes.static TestClockcreate(TestClockCreateParams params, RequestOptions options) Creates a new test clock that can be attached to new customers and quotes.static TestClockCreates a new test clock that can be attached to new customers and quotes.static TestClockcreate(Map<String, Object> params, RequestOptions options) Creates a new test clock that can be attached to new customers and quotes.delete()Deletes a test clock.delete(RequestOptions options) Deletes a test clock.Deletes a test clock.delete(Map<String, Object> params, RequestOptions options) Deletes a test clock.booleanTime at which the object was created.Always true for a deleted object.Time at which this clock is scheduled to auto delete.Time at which all objects belonging to this clock are frozen.getId()Unique identifier for the object.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.getName()The custom name supplied at creation.String representing the object's type.The status of the Test Clock.inthashCode()static TestClockCollectionlist(TestClockListParams params) Returns a list of your test clocks.static TestClockCollectionlist(TestClockListParams params, RequestOptions options) Returns a list of your test clocks.static TestClockCollectionReturns a list of your test clocks.static TestClockCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of your test clocks.static TestClockRetrieves a test clock.static TestClockretrieve(String testClock, RequestOptions options) Retrieves a test clock.static TestClockretrieve(String testClock, TestClockRetrieveParams params, RequestOptions options) Retrieves a test clock.static TestClockRetrieves a test clock.voidsetCreated(Long created) Time at which the object was created.voidsetDeleted(Boolean deleted) Always true for a deleted object.voidsetDeletesAfter(Long deletesAfter) Time at which this clock is scheduled to auto delete.voidsetFrozenTime(Long frozenTime) Time at which all objects belonging to this clock are frozen.voidUnique identifier for the object.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidThe custom name supplied at creation.voidString representing the object's type.voidsetResponseGetter(StripeResponseGetter responseGetter) Thefrozen_timethat the Test Clock is advancing towards.voidThe status of the Test Clock.voidsetStatusDetails(TestClock.StatusDetails statusDetails) 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, 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
-
TestClock
public TestClock()
-
-
Method Details
-
advance
Starts advancing a test clock to a specified time in the future. Advancement is done when status changes toReady.- Throws:
StripeException
-
advance
Starts advancing a test clock to a specified time in the future. Advancement is done when status changes toReady.- Throws:
StripeException
-
advance
Starts advancing a test clock to a specified time in the future. Advancement is done when status changes toReady.- Throws:
StripeException
-
advance
public TestClock advance(TestClockAdvanceParams params, RequestOptions options) throws StripeException Starts advancing a test clock to a specified time in the future. Advancement is done when status changes toReady.- Throws:
StripeException
-
create
Creates a new test clock that can be attached to new customers and quotes.- Throws:
StripeException
-
create
public static TestClock create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a new test clock that can be attached to new customers and quotes.- Throws:
StripeException
-
create
Creates a new test clock that can be attached to new customers and quotes.- Throws:
StripeException
-
create
public static TestClock create(TestClockCreateParams params, RequestOptions options) throws StripeException Creates a new test clock that can be attached to new customers and quotes.- Throws:
StripeException
-
delete
Deletes a test clock.- Throws:
StripeException
-
delete
Deletes a test clock.- Throws:
StripeException
-
delete
Deletes a test clock.- Throws:
StripeException
-
delete
Deletes a test clock.- Throws:
StripeException
-
list
Returns a list of your test clocks.- Throws:
StripeException
-
list
public static TestClockCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of your test clocks.- Throws:
StripeException
-
list
Returns a list of your test clocks.- Throws:
StripeException
-
list
public static TestClockCollection list(TestClockListParams params, RequestOptions options) throws StripeException Returns a list of your test clocks.- Throws:
StripeException
-
retrieve
Retrieves a test clock.- Throws:
StripeException
-
retrieve
Retrieves a test clock.- Throws:
StripeException
-
retrieve
public static TestClock retrieve(String testClock, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves a test clock.- Throws:
StripeException
-
retrieve
public static TestClock retrieve(String testClock, TestClockRetrieveParams params, RequestOptions options) throws StripeException Retrieves a test clock.- Throws:
StripeException
-
setResponseGetter
Thefrozen_timethat the Test Clock is advancing towards.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getDeleted
Always true for a deleted object. -
getDeletesAfter
Time at which this clock is scheduled to auto delete. -
getFrozenTime
Time at which all objects belonging to this clock are frozen. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getName
The custom name supplied at creation. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
test_helpers.test_clock. -
getStatus
The status of the Test Clock.One of
advancing,internal_failure, orready. -
getStatusDetails
-
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setDeleted
Always true for a deleted object. -
setDeletesAfter
Time at which this clock is scheduled to auto delete. -
setFrozenTime
Time at which all objects belonging to this clock are frozen. -
setId
Unique identifier for the object. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setName
The custom name supplied at creation. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
test_helpers.test_clock. -
setStatus
The status of the Test Clock.One of
advancing,internal_failure, orready. -
setStatusDetails
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object.
-