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 revenue_schedule_type support #257

Merged
merged 1 commit into from
Aug 1, 2016
Merged

Add revenue_schedule_type support #257

merged 1 commit into from
Aug 1, 2016

Conversation

drewish
Copy link

@drewish drewish commented Aug 1, 2016

// Set the schedule types on a plan
$plan = Recurly_Plan::get('gold');
$plan->revenue_schedule_type = 'at_range_end';
$plan->setup_fee_revenue_schedule_type = 'at_range_start';
$plan->update();
// Set the schedule type on an add-on
$add_on = Recurly_Addon::get('gold', 'ipaddresses');
$add_on->revenue_schedule_type = 'never';
$add_on->update();
// Set the schedule type on a new adjustment
$charge = new Recurly_Adjustment();
$charge->account_code = '1';
$charge->description = 'Charge for extra bandwidth';
$charge->unit_amount_in_cents = 5000;
$charge->currency = 'USD';
$charge->revenue_schedule_type = 'at_range_start';
$charge->create();
// Set the schedule on an subscription and add-on
$subscription = new Recurly_Subscription();
$subscription->plan_code = 'gold';
$subscription->currency = 'USD';
// Override the plan's value:
$subscription->revenue_schedule_type = 'at_range_end';
$addon = new Recurly_SubscriptionAddOn();
$addon->add_on_code = 'ipaddresses';
$addon->quantity = 3;
$addon->unit_amount_in_cents = 100;
// Override the add-on's value:
$addon->revenue_schedule_type = 'evenly';
$subscription->subscription_add_ons = array($addon);
$account = new Recurly_Account();
$account->account_code = '1';
$subscription->account = $account;
$subscription->create();

@bhelx
Copy link
Contributor

bhelx commented Aug 1, 2016

👍

@bhelx bhelx merged commit ddcf220 into api-2.3 Aug 1, 2016
@bhelx bhelx deleted the rev-rev branch August 1, 2016 21:45
@drewish drewish mentioned this pull request Aug 1, 2016
@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants