Skip to content

Commit 49b7eff

Browse files
committed
Send plan_identifier as url param
1 parent f74a137 commit 49b7eff

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/iugu/subscription.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,18 @@ def activate
4242
end
4343

4444
def change_plan(plan_identifier, options = {})
45-
copy Iugu::Factory.create_from_response(self.class.object_type, APIRequest.request("POST", "#{self.class.url(self.id)}/change_plan/#{plan_identifier}", options))
45+
options.merge!({ plan_identifier: plan_identifier })
46+
copy Iugu::Factory.create_from_response(self.class.object_type, APIRequest.request("POST", "#{self.class.url(self.id)}/change_plan", options))
4647
self.errors = nil
4748
true
4849
rescue Iugu::RequestWithErrors => ex
4950
self.errors = ex.errors
5051
false
5152
end
5253

53-
def change_plan_simulation(plan_identifier)
54-
Iugu::Factory.create_from_response(self.class.object_type, APIRequest.request("GET", "#{self.class.url(self.id)}/change_plan_simulation/#{plan_identifier}"))
54+
def change_plan_simulation(plan_identifier, options = {})
55+
options.merge!({ plan_identifier: plan_identifier })
56+
Iugu::Factory.create_from_response(self.class.object_type, APIRequest.request("GET", "#{self.class.url(self.id)}/change_plan_simulation", options))
5557
end
5658

5759
def customer

0 commit comments

Comments
 (0)