-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add RevRec POBs support #792
Merged
tilley-kyle
merged 1 commit into
add_revrec_support_to_php
from
add_performance_obligations
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
class Recurly_PerformanceObligationListTest extends Recurly_TestCase | ||
{ | ||
public function testPerformanceObligationListAll() { | ||
$this->client->addResponse( | ||
'GET', | ||
'/performance_obligations', | ||
'performance_obligations/list-200.xml' | ||
); | ||
|
||
$performance_obligations = Recurly_PerformanceObligationList::get(null, $this->client); | ||
$this->assertInstanceOf('Recurly_PerformanceObligationList', $performance_obligations); | ||
|
||
$performance_obligation = $performance_obligations->current(); | ||
$this->assertInstanceOf('Recurly_PerformanceObligation', $performance_obligation); | ||
|
||
$this->assertEquals(iterator_count($performance_obligations), 3); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
class Recurly_PerformanceObligationTest extends Recurly_TestCase | ||
{ | ||
function defaultResponses() { | ||
return array( | ||
array('GET', '/performance_obligations/6', 'performance_obligations/show-200.xml'), | ||
); | ||
} | ||
|
||
public function testPerformanceObligation() { | ||
$pob = Recurly_PerformanceObligation::get('6', $this->client); | ||
|
||
$this->assertInstanceOf('Recurly_PerformanceObligation', $pob); | ||
$this->assertEquals('Over Time (Daily)', $pob->name); | ||
$this->assertEquals('6', $pob->id); | ||
$this->assertInstanceOf('DateTime', $pob->created_at); | ||
$this->assertInstanceOf('DateTime', $pob->updated_at); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
HTTP/1.1 200 OK | ||
Content-Type: application/xml; charset=utf-8 | ||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<performance_obligations type="array"> | ||
<performance_obligation href="https://api.recurly.com/v2/performance_obligations/6"> | ||
<id>6</id> | ||
<name>Over Time (Daily)</name> | ||
<created_at type="datetime">2023-08-11T18:57:57Z</created_at> | ||
<updated_at type="datetime">2023-08-11T18:57:57Z</updated_at> | ||
</performance_obligation> | ||
<performance_obligation href="https://api.recurly.com/v2/performance_obligations/5"> | ||
<id>5</id> | ||
<name>Over Time (Partial Monthly)</name> | ||
<created_at type="datetime">2023-08-11T18:57:57Z</created_at> | ||
<updated_at type="datetime">2023-08-11T18:57:57Z</updated_at> | ||
</performance_obligation> | ||
<performance_obligation href="https://api.recurly.com/v2/performance_obligations/4"> | ||
<id>4</id> | ||
<name>Point in Time</name> | ||
<created_at type="datetime">2023-08-11T18:57:57Z</created_at> | ||
<updated_at type="datetime">2023-08-11T18:57:57Z</updated_at> | ||
</performance_obligation> | ||
</performance_obligations> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
HTTP/1.1 200 OK | ||
Content-Type: application/xml; charset=utf-8 | ||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<performance_obligation href="https://api.recurly.com/v2/performance_obligations/6"> | ||
<id>6</id> | ||
<name>Over Time (Daily)</name> | ||
<created_at type="datetime">2023-08-11T18:57:57Z</created_at> | ||
<updated_at type="datetime">2023-08-11T18:57:57Z</updated_at> | ||
</performance_obligation> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* Class Recurly PerformanceObligation | ||
* @property string $id | ||
* @property string $name The name of the POB. | ||
* @property DateTime $created_at The date and time the gla was created in Recurly. | ||
* @property DateTime $updated_at The date and time the gla was last updated. | ||
*/ | ||
|
||
class Recurly_PerformanceObligation extends Recurly_Resource | ||
{ | ||
/** | ||
* @param string $id | ||
* @param Recurly_Client $client | ||
* @return Recurly_PerformanceObligation | ||
* @throws Recurly_Error | ||
*/ | ||
public static function get($id, $client = null) { | ||
return Recurly_Base::_get(Recurly_PerformanceObligation::uriForPerformanceObligation($id), $client); | ||
} | ||
|
||
protected static function uriForPerformanceObligation($id) { | ||
return self::_safeUri(Recurly_Client::PATH_PERFORMANCE_OBLIGATIONS, $id); | ||
} | ||
|
||
protected function getNodeName() { | ||
return 'performance_obligation'; | ||
} | ||
|
||
protected function getWriteableAttributes() { | ||
return array(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
class Recurly_PerformanceObligationList extends Recurly_Pager | ||
{ | ||
public static function get($params = null, $client = null) { | ||
$uri = self::_uriWithParams(Recurly_Client::PATH_PERFORMANCE_OBLIGATIONS, $params); | ||
return new self($uri, $client); | ||
} | ||
|
||
protected function getNodeName() { | ||
return 'performance_obligations'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason you omitted testing for
updated_at
? 🤔