Skip to content

Commit

Permalink
Support items on subs
Browse files Browse the repository at this point in the history
  • Loading branch information
joannasese committed Jun 23, 2020
1 parent f99ee21 commit 3ce9028
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/recurly/plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @property string $usage_percentage If add_on_type = usage and usage_type = percentage, you must set a usage_percentage. Must be between 0.0000 and 100.0000.
* @property boolean $trial_requires_billing_info Setting to determine if subscriptions to this plan will always require billing info or will only require it when either not in a trial or when money is due, defaults to true.
* @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.
*/
class Recurly_Plan extends Recurly_Resource
{
Expand Down Expand Up @@ -98,7 +99,7 @@ protected function getWriteableAttributes() {
'trial_interval_unit', 'unit_amount_in_cents', 'setup_fee_in_cents',
'total_billing_cycles', 'accounting_code', 'setup_fee_accounting_code',
'revenue_schedule_type', 'setup_fee_revenue_schedule_type',
'tax_exempt', 'tax_code', 'trial_requires_billing_info', 'auto_renew'
'tax_exempt', 'tax_code', 'trial_requires_billing_info', 'auto_renew', 'allow_any_item_on_subscriptions'
);
}
}
3 changes: 3 additions & 0 deletions lib/recurly/subscription_addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* @property int $quantity Optionally override the default quantity of 1.
* @property float $usage_percentage If add_on_type = usage and usage_type = percentage, you can set a custom usage_percentage for the subscription add-on. Must be between 0.0000 and 100.0000.
* @property string $revenue_schedule_type Optional field for setting a revenue schedule type. This will determine how revenue for the associated Subscription Add-On should be recognized. When creating a Subscription Add-On, available schedule types are: [never, evenly, at_range_start, at_range_end]. If no revenue_schedule_type is set, the Subscription Add-On will inherit the revenue_schedule_type from its Plan Add-On.
* @property string $add_on_source Used to determine where the associated add-on data is pulled from. If this value is set to `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then the associated add-on data will be pulled from the site's item catalog.
*/
class Recurly_SubscriptionAddOn extends Recurly_Resource
{
Expand All @@ -24,6 +26,7 @@ protected function getWriteableAttributes() {
'usage_type',
'usage_percentage',
'revenue_schedule_type',
'add_on_source',
);
}

Expand Down

0 comments on commit 3ce9028

Please sign in to comment.