|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Stripe; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class SubscriptionScheduleRevision |
|
7
|
|
|
* |
|
8
|
|
|
* @property string $id |
|
9
|
|
|
* @property string $object |
|
10
|
|
|
* @property int $created |
|
11
|
|
|
* @property mixed $invoice_settings |
|
12
|
|
|
* @property boolean $livemode |
|
13
|
|
|
* @property mixed $phases |
|
14
|
|
|
* @property string $previous_revision |
|
15
|
|
|
* @property string $renewal_behavior |
|
16
|
|
|
* @property mixed $renewal_interval |
|
17
|
|
|
* @property string $schedule |
|
18
|
|
|
* |
|
19
|
|
|
* @package Stripe |
|
20
|
|
|
*/ |
|
21
|
|
|
class SubscriptionScheduleRevision extends ApiResource |
|
22
|
|
|
{ |
|
23
|
|
|
|
|
24
|
|
|
const OBJECT_NAME = "subscription_schedule_revision"; |
|
25
|
|
|
|
|
26
|
|
|
use ApiOperations\All; |
|
27
|
|
|
use ApiOperations\Retrieve; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @return string The API URL for this Subscription Schedule Revision. |
|
31
|
|
|
*/ |
|
32
|
|
|
public function instanceUrl() |
|
33
|
|
|
{ |
|
34
|
|
|
$id = $this['id']; |
|
35
|
|
|
$schedule = $this['schedule']; |
|
36
|
|
|
if (!$id) { |
|
37
|
|
|
throw new Error\InvalidRequest( |
|
38
|
|
|
"Could not determine which URL to request: " . |
|
39
|
|
|
"class instance has invalid ID: $id", |
|
40
|
|
|
null |
|
41
|
|
|
); |
|
42
|
|
|
} |
|
43
|
|
|
$id = Util\Util::utf8($id); |
|
44
|
|
|
$schedule = Util\Util::utf8($schedule); |
|
45
|
|
|
|
|
46
|
|
|
$base = SubscriptionSchedule::classUrl(); |
|
47
|
|
|
$scheduleExtn = urlencode($schedule); |
|
48
|
|
|
$extn = urlencode($id); |
|
49
|
|
|
return "$base/$scheduleExtn/revisions/$extn"; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @param array|string $_id |
|
54
|
|
|
* @param array|string|null $_opts |
|
55
|
|
|
* |
|
56
|
|
|
* @throws \Stripe\Error\InvalidRequest |
|
57
|
|
|
*/ |
|
58
|
|
|
public static function retrieve($_id, $_opts = null) |
|
|
|
|
|
|
59
|
|
|
{ |
|
60
|
|
|
$msg = "Subscription Schedule Revisions cannot be accessed without a Subscription Schedule ID. " . |
|
61
|
|
|
"Retrieve one using \$schedule->retrieveRevision('revision_id') instead."; |
|
62
|
|
|
throw new Error\InvalidRequest($msg, null); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @param array|string $_id |
|
|
|
|
|
|
67
|
|
|
* @param array|string|null $_opts |
|
|
|
|
|
|
68
|
|
|
* |
|
69
|
|
|
* @throws \Stripe\Error\InvalidRequest |
|
70
|
|
|
*/ |
|
71
|
|
|
public static function all($params = null, $opts = null) |
|
|
|
|
|
|
72
|
|
|
{ |
|
73
|
|
|
$msg = "Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. " . |
|
74
|
|
|
"List those using \$schedule->allRevisions('revision_id') instead."; |
|
75
|
|
|
throw new Error\InvalidRequest($msg, null); |
|
76
|
|
|
} |
|
77
|
|
|
} |
|
78
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.