lib/pagarme/subscription.rb in pagarme-1.3 vs lib/pagarme/subscription.rb in pagarme-1.4
- old
+ new
@@ -21,9 +21,15 @@
self.plan = nil
super
end
+ def cancel
+ request = PagarMe::Request.new(self.url + '/cancel', 'POST')
+ response = request.run
+ update(response)
+ end
+
def charge(amount)
request = PagarMe::Request.new(self.url, 'POST')
request.parameters = {
:amount => amount,
}