lib/moip-assinaturas/plan.rb in moip-assinaturas-0.1.1 vs lib/moip-assinaturas/plan.rb in moip-assinaturas-0.1.2
- old
+ new
@@ -52,8 +52,23 @@
else
raise(WebServerResponseError, "Ocorreu um erro no retorno do webservice")
end
end
+ def update(plan)
+ response = Moip::Assinaturas::Client.update_plan(plan)
+
+ # in the current implementation the Moip signatures API only
+ # returns response code 200 with an empty body even if the update fails
+ case response.code
+ when 200
+ return {
+ success: true
+ }
+ else
+ raise(WebServerResponseError, "Ocorreu um erro no retorno do webservice")
+ end
+ end
+
end
end
end
\ No newline at end of file