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

Add revrec attributes to plans #795

Merged
merged 1 commit into from
Feb 13, 2024
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
6 changes: 6 additions & 0 deletions Tests/Recurly/Plan_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public function testGetPlan() {
$this->assertTrue($plan->tax_exempt);
$this->assertEquals('1234abcd', $plan->dunning_campaign_id);
$this->assertEquals('fixed', $plan->pricing_model);
$this->assertEquals('twrbsq39zvo5', $plan->liability_gl_account_id);
$this->assertEquals('bwrks63lznoi', $plan->revenue_gl_account_id);
$this->assertEquals('rkslzn', $plan->performance_obligation_id);
$this->assertEquals('twrisqjjzvo5', $plan->setup_fee_liability_gl_account_id);
$this->assertEquals('dlrk123lzabc', $plan->setup_fee_revenue_gl_account_id);
$this->assertEquals('bks6noi', $plan->setup_fee_performance_obligation_id);
}

public function testGetPlanWithRamps() {
Expand Down
6 changes: 6 additions & 0 deletions Tests/fixtures/plans/show-200.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ Content-Type: application/xml; charset=utf-8
<EUR type="integer">400</EUR>
</setup_fee_in_cents>
<dunning_campaign_id>1234abcd</dunning_campaign_id>
<liability_gl_account_id>twrbsq39zvo5</liability_gl_account_id>
<revenue_gl_account_id>bwrks63lznoi</revenue_gl_account_id>
<performance_obligation_id>rkslzn</performance_obligation_id>
<setup_fee_liability_gl_account_id>twrisqjjzvo5</setup_fee_liability_gl_account_id>
<setup_fee_revenue_gl_account_id>dlrk123lzabc</setup_fee_revenue_gl_account_id>
<setup_fee_performance_obligation_id>bks6noi</setup_fee_performance_obligation_id>
<pricing_model>fixed</pricing_model>
<custom_fields type="array">
<custom_field>
Expand Down
12 changes: 12 additions & 0 deletions lib/recurly/plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
* @property boolean $auto_renew Determines whether subscriptions to this plan should auto-renew term at the end of the current term or expire. Defaults to true.
* @property boolean $allow_any_item_on_subscriptions Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used.
* @property string $dunning_campaign_id Unique ID to identify the dunning campaign used when dunning the invoice.
* @property string $liability_gl_account_id The ID of the liability general ledger account associated with the plan.
* @property string $revenue_gl_account_id The ID of the revenue general ledger account associated with the plan.
* @property string $setup_fee_liability_gl_account_id The ID of the liability general ledger account associated with the plan setup fee.
* @property string $setup_fee_revenue_gl_account_id The ID of the revenue general ledger account associated with the plan setup fee.
* @property string $performance_obligation_id The ID of the performance obligation associated with the plan.
* @property string $setup_fee_performance_obligation_id The ID of the performance obligation associated with the plan setup fee.
*/
class Recurly_Plan extends Recurly_Resource
{
Expand Down Expand Up @@ -125,16 +131,22 @@ protected function getWriteableAttributes() {
'display_phone_number',
'display_quantity',
'dunning_campaign_id',
'liability_gl_account_id',
'name',
'payment_page_tos_link',
'performance_obligation_id',
'plan_code',
'plan_interval_length',
'plan_interval_unit',
'pricing_model',
'ramp_intervals',
'revenue_gl_account_id',
'revenue_schedule_type',
'setup_fee_accounting_code',
'setup_fee_in_cents',
'setup_fee_liability_gl_account_id',
'setup_fee_performance_obligation_id',
'setup_fee_revenue_gl_account_id',
'setup_fee_revenue_schedule_type',
'success_url',
'tax_code',
Expand Down
Loading