|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Stripe; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class SubscriptionSchedule |
|
7
|
|
|
* |
|
8
|
|
|
* @property string $id |
|
9
|
|
|
* @property string $object |
|
10
|
|
|
* @property string $billing |
|
11
|
|
|
* @property mixed $billing_thresholds |
|
12
|
|
|
* @property int $canceled_at |
|
13
|
|
|
* @property int $completed_at |
|
14
|
|
|
* @property int $created |
|
15
|
|
|
* @property mixed $current_phase |
|
16
|
|
|
* @property string $customer |
|
17
|
|
|
* @property mixed $invoice_settings |
|
18
|
|
|
* @property boolean $livemode |
|
19
|
|
|
* @property StripeObject $metadata |
|
20
|
|
|
* @property mixed $phases |
|
21
|
|
|
* @property int $released_at |
|
22
|
|
|
* @property string $released_subscription |
|
23
|
|
|
* @property string $renewal_behavior |
|
24
|
|
|
* @property mixed $renewal_interval |
|
25
|
|
|
* @property string $revision |
|
26
|
|
|
* @property string $status |
|
27
|
|
|
* @property string $subscription |
|
28
|
|
|
* |
|
29
|
|
|
* @package Stripe |
|
30
|
|
|
*/ |
|
31
|
|
|
class SubscriptionSchedule extends ApiResource |
|
32
|
|
|
{ |
|
33
|
|
|
|
|
34
|
|
|
const OBJECT_NAME = "subscription_schedule"; |
|
35
|
|
|
|
|
36
|
|
|
use ApiOperations\All; |
|
37
|
|
|
use ApiOperations\Create; |
|
38
|
|
|
use ApiOperations\Retrieve; |
|
39
|
|
|
use ApiOperations\Update; |
|
40
|
|
|
use ApiOperations\NestedResource; |
|
41
|
|
|
|
|
42
|
|
|
const PATH_REVISIONS = '/revisions'; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* @param array|null $params |
|
46
|
|
|
* @param array|string|null $opts |
|
47
|
|
|
* |
|
48
|
|
|
* @return SubscriptionSchedule The canceled subscription schedule. |
|
49
|
|
|
*/ |
|
50
|
|
|
public function cancel($params = null, $opts = null) |
|
51
|
|
|
{ |
|
52
|
|
|
$url = $this->instanceUrl() . '/cancel'; |
|
53
|
|
|
list($response, $opts) = $this->_request('post', $url, $params, $opts); |
|
|
|
|
|
|
54
|
|
|
$this->refreshFrom($response, $opts); |
|
55
|
|
|
return $this; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @param array|null $params |
|
60
|
|
|
* @param array|string|null $opts |
|
61
|
|
|
* |
|
62
|
|
|
* @return SubscriptionSchedule The released subscription schedule. |
|
63
|
|
|
*/ |
|
64
|
|
|
public function release($params = null, $opts = null) |
|
65
|
|
|
{ |
|
66
|
|
|
$url = $this->instanceUrl() . '/release'; |
|
67
|
|
|
list($response, $opts) = $this->_request('post', $url, $params, $opts); |
|
|
|
|
|
|
68
|
|
|
$this->refreshFrom($response, $opts); |
|
69
|
|
|
return $this; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* @param array|null $params |
|
74
|
|
|
* @param array|string|null $options |
|
75
|
|
|
* |
|
76
|
|
|
* @return Collection The list of subscription schedule revisions. |
|
77
|
|
|
*/ |
|
78
|
|
|
public function revisions($params = null, $options = null) |
|
79
|
|
|
{ |
|
80
|
|
|
$url = $this->instanceUrl() . '/revisions'; |
|
81
|
|
|
list($response, $opts) = $this->_request('get', $url, $params, $options); |
|
|
|
|
|
|
82
|
|
|
$obj = Util\Util::convertToStripeObject($response, $opts); |
|
83
|
|
|
$obj->setLastResponse($response); |
|
84
|
|
|
return $obj; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* @param array|null $id The ID of the subscription schedule to which the person belongs. |
|
89
|
|
|
* @param array|null $personId The ID of the person to retrieve. |
|
90
|
|
|
* @param array|null $params |
|
91
|
|
|
* @param array|string|null $opts |
|
92
|
|
|
* |
|
93
|
|
|
* @return Revision |
|
94
|
|
|
*/ |
|
95
|
|
|
public static function retrieveRevision($id, $personId, $params = null, $opts = null) |
|
96
|
|
|
{ |
|
97
|
|
|
return self::_retrieveNestedResource($id, static::PATH_REVISIONS, $personId, $params, $opts); |
|
|
|
|
|
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* @param array|null $id The ID of the subscription schedule on which to retrieve the persons. |
|
102
|
|
|
* @param array|null $params |
|
103
|
|
|
* @param array|string|null $opts |
|
104
|
|
|
* |
|
105
|
|
|
* @return Collection The list of revisions. |
|
106
|
|
|
*/ |
|
107
|
|
|
public static function allRevisions($id, $params = null, $opts = null) |
|
108
|
|
|
{ |
|
109
|
|
|
return self::_allNestedResources($id, static::PATH_REVISIONS, $params, $opts); |
|
|
|
|
|
|
110
|
|
|
} |
|
111
|
|
|
} |
|
112
|
|
|
|
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.