PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.0
GiveWP – Donation Plugin and Fundraising Platform v4.15.0
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / vendor / stripe / stripe-php / lib / TestHelpers / TestClock.php

TestClock.php in GiveWP – Donation Plugin and Fundraising Platform 4.15.0, at vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php

54 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // File generated from our OpenAPI spec
4
5 namespace Stripe\TestHelpers;
6
7 /**
8 * A test clock enables deterministic control over objects in testmode. With a test
9 * clock, you can create objects at a frozen time in the past or future, and
10 * advance to a specific future time to observe webhooks and state changes. After
11 * the clock advances, you can either validate the current state of your scenario
12 * (and test your assumptions), change the current state of your scenario (and test
13 * more complex scenarios), or keep advancing forward in time.
14 *
15 * @property string $id Unique identifier for the object.
16 * @property string $object String representing the object's type. Objects of the same type share the same value.
17 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
18 * @property int $deletes_after Time at which this clock is scheduled to auto delete.
19 * @property int $frozen_time Time at which all objects belonging to this clock are frozen.
20 * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
21 * @property null|string $name The custom name supplied at creation.
22 * @property string $status The status of the Test Clock.
23 */
24 class TestClock extends \Stripe\ApiResource
25 {
26 const OBJECT_NAME = 'test_helpers.test_clock';
27
28 use \Stripe\ApiOperations\All;
29 use \Stripe\ApiOperations\Create;
30 use \Stripe\ApiOperations\Delete;
31 use \Stripe\ApiOperations\Retrieve;
32
33 const STATUS_ADVANCING = 'advancing';
34 const STATUS_INTERNAL_FAILURE = 'internal_failure';
35 const STATUS_READY = 'ready';
36
37 /**
38 * @param null|array $params
39 * @param null|array|string $opts
40 *
41 * @throws \Stripe\Exception\ApiErrorException if the request fails
42 *
43 * @return \Stripe\TestHelpers\TestClock the advanced test clock
44 */
45 public function advance($params = null, $opts = null)
46 {
47 $url = $this->instanceUrl() . '/advance';
48 list($response, $opts) = $this->_request('post', $url, $params, $opts);
49 $this->refreshFrom($response, $opts);
50
51 return $this;
52 }
53 }
54