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

[V2] Add starting_on and ending_on to subscription ramps #776

Merged
merged 2 commits into from
Jul 26, 2023
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
4 changes: 4 additions & 0 deletions Tests/Recurly/Subscription_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@ public function testGetSubscriptionWithRampIntervals()
$this->assertEquals(1, $ramp1->starting_billing_cycle);
$this->assertEquals(123, $ramp1->unit_amount_in_cents);
$this->assertEquals(2, $ramp1->remaining_billing_cycles);
$this->assertInstanceOf('DateTime', $ramp1->starting_on);
$this->assertInstanceOf('DateTime', $ramp1->ending_on);

$ramp2 = $subscription->ramp_intervals[1];
$this->assertInstanceOf('Recurly_SubscriptionRampInterval', $ramp2);
$this->assertEquals(4, $ramp2->starting_billing_cycle);
$this->assertEquals(456, $ramp2->unit_amount_in_cents);
$this->assertEmpty($ramp2->remaining_billing_cycles);
$this->assertInstanceOf('DateTime', $ramp1->starting_on);
$this->assertEmpty($ramp2->ending_on);
}

public function testCreateManualCollectionSubscriptionXml() {
Expand Down
4 changes: 4 additions & 0 deletions Tests/fixtures/subscriptions/show-200-ramp-intervals.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ Content-Type: application/xml; charset=utf-8
<starting_billing_cycle type="integer">1</starting_billing_cycle>,
<unit_amount_in_cents type="integer">123</unit_amount_in_cents>
<remaining_billing_cycles type="integer">2</remaining_billing_cycles>
<starting_on type="datetime">2023-10-12T15:38:05Z</starting_on>
<ending_on type="datetime">2024-01-12T15:38:05Z</ending_on>
</ramp_interval>
<ramp_interval>
<starting_billing_cycle type="integer">4</starting_billing_cycle>
<unit_amount_in_cents type="integer">456</unit_amount_in_cents>
<remaining_billing_cycles nil="nil"></remaining_billing_cycles>
<starting_on type="datetime">2024-01-12T15:38:05Z</starting_on>
<ending_on nil="nil"></ending_on>
</ramp_interval>
</ramp_intervals>
<a name="cancel" href="https://api.recurly.com/v2/subscriptions/32558dd8a07smo471fbe6642d3a422f4/cancel" method="put"/>
Expand Down
2 changes: 2 additions & 0 deletions lib/recurly/subscription_ramp_interval.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* @property number $starting_billing_cycle
* @property number $unit_amount_in_cents
* @property number $remaining_billing_cycles
* @property datetime $starting_on
* @property datetime $ending_on
*/
class Recurly_SubscriptionRampInterval extends Recurly_RampInterval
{
Expand Down
Loading