Skip to content

Commit

Permalink
Remove SubscriptionScheduleRevision
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Aug 9, 2019
1 parent abd52ae commit 72b453f
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 187 deletions.
1 change: 0 additions & 1 deletion init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
42 changes: 0 additions & 42 deletions lib/SubscriptionSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class SubscriptionSchedule extends ApiResource
use ApiOperations\Update;
use ApiOperations\NestedResource;

const PATH_REVISIONS = '/revisions';

/**
* @param array|null $params
* @param array|string|null $opts
Expand Down Expand Up @@ -68,44 +66,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);
}
}
77 changes: 0 additions & 77 deletions lib/SubscriptionScheduleRevision.php

This file was deleted.

1 change: 0 additions & 1 deletion lib/Util/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
34 changes: 0 additions & 34 deletions tests/Stripe/SubscriptionScheduleRevisionTest.php

This file was deleted.

32 changes: 0 additions & 32 deletions tests/Stripe/SubscriptionScheduleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

0 comments on commit 72b453f

Please sign in to comment.