Skip to content

Commit 224a60d

Browse files
Merge pull request #1345 from travis-ci/release_241127
* add defer_pause to renderer and model * fix specs * fixed spec
2 parents 4e713be + f5d8f9d commit 224a60d

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

lib/travis/api/v3/models/v2_subscription.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Models::V2Subscription
44

55
attr_reader :id, :plan, :permissions, :source, :billing_info, :credit_card_info, :owner, :status, :valid_to, :canceled_at,
66
:client_secret, :payment_intent, :addons, :auto_refill, :available_standalone_addons, :created_at, :scheduled_plan_name,
7-
:cancellation_requested, :current_trial
7+
:cancellation_requested, :current_trial, :defer_pause
88

99
def initialize(attributes = {})
1010
@id = attributes.fetch('id')
@@ -20,7 +20,7 @@ def initialize(attributes = {})
2020
refill = attributes['addons'].detect { |addon| addon['addon_config_id'] === 'auto_refill' } || {"enabled" => false};
2121
default_refill = @plan.respond_to?('available_standalone_addons') ?
2222
@plan.available_standalone_addons.detect { |addon| addon['id'] === 'auto_refill' } : nil
23-
23+
2424
refill['enabled'] = attributes['auto_refill_enabled']
2525
if default_refill
2626
refill['refill_threshold'] = default_refill['refill_threshold'] unless refill.key?('refill_threshold')
@@ -37,6 +37,7 @@ def initialize(attributes = {})
3737
if current_trial
3838
@current_trial = Models::V2Trial.new(current_trial)
3939
end
40+
@defer_pause = attributes.fetch('defer_pause', false)
4041
end
4142
end
4243

lib/travis/api/v3/renderer/v2_subscription.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Travis::API::V3
22
class Renderer::V2Subscription < ModelRenderer
3-
representation(:standard, :id, :plan, :addons, :auto_refill, :status, :valid_to, :canceled_at, :source, :owner, :client_secret, :billing_info, :credit_card_info, :payment_intent, :created_at, :scheduled_plan_name, :cancellation_requested, :current_trial)
3+
representation(:standard, :id, :plan, :addons, :auto_refill, :status, :valid_to, :canceled_at, :source, :owner, :client_secret, :billing_info, :credit_card_info, :payment_intent, :created_at, :scheduled_plan_name, :cancellation_requested, :current_trial, :defer_pause)
44

55
def billing_info
66
Renderer.render_model(model.billing_info, mode: :standard) unless model.billing_info.nil?

spec/v3/services/v2_subscriptions/all_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
'scheduled_plan_name' => nil,
8787
'cancellation_requested' => false,
8888
'current_trial' => nil,
89+
'defer_pause' => false,
8990
'plan' => {
9091
'@type' => 'v2_plan_config',
9192
'@representation' => 'standard',

spec/v3/services/v2_subscriptions/create_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
'scheduled_plan_name' => nil,
212212
'cancellation_requested' => false,
213213
'current_trial' => nil,
214+
'defer_pause' => false,
214215
'plan' => {
215216
'@type' => 'v2_plan_config',
216217
'@representation' => 'standard',

0 commit comments

Comments
 (0)