diff --git a/init.php b/init.php index e893cfcda..052439996 100644 --- a/init.php +++ b/init.php @@ -122,7 +122,6 @@ require(dirname(__FILE__) . '/lib/Subscription.php'); require(dirname(__FILE__) . '/lib/SubscriptionItem.php'); require(dirname(__FILE__) . '/lib/SubscriptionSchedule.php'); -require(dirname(__FILE__) . '/lib/SubscriptionScheduleRevision.php'); require(dirname(__FILE__) . '/lib/TaxId.php'); require(dirname(__FILE__) . '/lib/TaxRate.php'); require(dirname(__FILE__) . '/lib/Terminal/ConnectionToken.php'); diff --git a/lib/SubscriptionSchedule.php b/lib/SubscriptionSchedule.php index a1c663201..e41f279a0 100644 --- a/lib/SubscriptionSchedule.php +++ b/lib/SubscriptionSchedule.php @@ -38,8 +38,6 @@ class SubscriptionSchedule extends ApiResource use ApiOperations\Update; use ApiOperations\NestedResource; - const PATH_REVISIONS = '/revisions'; - /** * @param array|null $params * @param array|string|null $opts @@ -67,44 +65,4 @@ public function release($params = null, $opts = null) $this->refreshFrom($response, $opts); return $this; } - - /** - * @param array|null $params - * @param array|string|null $options - * - * @return Collection The list of subscription schedule revisions. - */ - public function revisions($params = null, $options = null) - { - $url = $this->instanceUrl() . '/revisions'; - list($response, $opts) = $this->_request('get', $url, $params, $options); - $obj = Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - return $obj; - } - - /** - * @param array|null $id The ID of the subscription schedule to which the person belongs. - * @param array|null $personId The ID of the person to retrieve. - * @param array|null $params - * @param array|string|null $opts - * - * @return Revision - */ - public static function retrieveRevision($id, $personId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_REVISIONS, $personId, $params, $opts); - } - - /** - * @param array|null $id The ID of the subscription schedule on which to retrieve the persons. - * @param array|null $params - * @param array|string|null $opts - * - * @return Collection The list of revisions. - */ - public static function allRevisions($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_REVISIONS, $params, $opts); - } } diff --git a/lib/SubscriptionScheduleRevision.php b/lib/SubscriptionScheduleRevision.php deleted file mode 100644 index 2818b1e1f..000000000 --- a/lib/SubscriptionScheduleRevision.php +++ /dev/null @@ -1,76 +0,0 @@ -retrieveRevision('revision_id') instead."; - throw new Error\InvalidRequest($msg, null); - } - - /** - * @param array|string $_id - * @param array|string|null $_opts - * - * @throws \Stripe\Error\InvalidRequest - */ - public static function all($params = null, $opts = null) - { - $msg = "Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. " . - "List those using \$schedule->allRevisions('revision_id') instead."; - throw new Error\InvalidRequest($msg, null); - } -} diff --git a/lib/Util/Util.php b/lib/Util/Util.php index f9f154400..dd8677aa0 100644 --- a/lib/Util/Util.php +++ b/lib/Util/Util.php @@ -135,7 +135,6 @@ public static function convertToStripeObject($resp, $opts) \Stripe\Subscription::OBJECT_NAME => 'Stripe\\Subscription', \Stripe\SubscriptionItem::OBJECT_NAME => 'Stripe\\SubscriptionItem', \Stripe\SubscriptionSchedule::OBJECT_NAME => 'Stripe\\SubscriptionSchedule', - \Stripe\SubscriptionScheduleRevision::OBJECT_NAME => 'Stripe\\SubscriptionScheduleRevision', \Stripe\TaxId::OBJECT_NAME => 'Stripe\\TaxId', \Stripe\TaxRate::OBJECT_NAME => 'Stripe\\TaxRate', \Stripe\ThreeDSecure::OBJECT_NAME => 'Stripe\\ThreeDSecure', diff --git a/tests/Stripe/SubscriptionScheduleRevisionTest.php b/tests/Stripe/SubscriptionScheduleRevisionTest.php deleted file mode 100644 index a3607363d..000000000 --- a/tests/Stripe/SubscriptionScheduleRevisionTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertSame( - "/v1/subscription_schedules/" . self::TEST_SCHEDULE_ID . "/revisions/" . self::TEST_RESOURCE_ID, - $resource->instanceUrl() - ); - } - - /** - * @expectedException \Stripe\Error\InvalidRequest - */ - public function testIsNotDirectlyRetrievable() - { - SubscriptionScheduleRevision::retrieve(self::TEST_RESOURCE_ID); - } - - /** - * @expectedException \Stripe\Error\InvalidRequest - */ - public function testIsNotDirectlyAll() - { - SubscriptionScheduleRevision::all(); - } -} diff --git a/tests/Stripe/SubscriptionScheduleTest.php b/tests/Stripe/SubscriptionScheduleTest.php index c6b20cc6d..85de1c08e 100644 --- a/tests/Stripe/SubscriptionScheduleTest.php +++ b/tests/Stripe/SubscriptionScheduleTest.php @@ -93,36 +93,4 @@ public function testIsReleaseable() $resource->release([]); $this->assertInstanceOf("Stripe\\SubscriptionSchedule", $resource); } - - public function testRevisions() - { - $schedule = SubscriptionSchedule::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'get', - '/v1/subscription_schedules/' . $schedule->id . '/revisions' - ); - $revisions = $schedule->revisions(); - $this->assertTrue(is_array($revisions->data)); - $this->assertInstanceOf("Stripe\\SubscriptionScheduleRevision", $revisions->data[0]); - } - - public function testCanRetrieveRevision() - { - $this->expectsRequest( - 'get', - '/v1/subscription_schedules/' . self::TEST_RESOURCE_ID . '/revisions/' . self::TEST_REVISION_ID - ); - $resource = SubscriptionSchedule::retrieveRevision(self::TEST_RESOURCE_ID, self::TEST_REVISION_ID); - $this->assertInstanceOf("Stripe\\SubscriptionScheduleRevision", $resource); - } - - public function testCanListRevisions() - { - $this->expectsRequest( - 'get', - '/v1/subscription_schedules/' . self::TEST_RESOURCE_ID . '/revisions' - ); - $resources = SubscriptionSchedule::allRevisions(self::TEST_RESOURCE_ID); - $this->assertTrue(is_array($resources->data)); - } }