Class: Chargify::Transaction

Inherits:
Base show all
Defined in:
lib/chargify_api_ares.rb

Instance Method Summary collapse

Methods inherited from Base

element_name, #to_xml

Methods inherited from ActiveResource::Base

#save

Instance Method Details

#full_refund(attrs = {}) ⇒ Object



251
252
253
254
255
256
# File 'lib/chargify_api_ares.rb', line 251

def full_refund(attrs = {})
  return false if self.transaction_type != 'payment'

  attrs.merge!(:amount_in_cents => self.amount_in_cents)
  self.refund(attrs)
end

#refund(attrs = {}) ⇒ Object



258
259
260
261
262
263
# File 'lib/chargify_api_ares.rb', line 258

def refund(attrs = {})
  return false if self.transaction_type != 'payment'

  attrs.merge!(:payment_id => self.id)
  Subscription.find(self.subscription_id).refund(attrs)
end