Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SubscriptionScheduleRevision #688

Merged
merged 1 commit into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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
Expand Down Expand Up @@ -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);
}
}
76 changes: 0 additions & 76 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));
}
}