Class: Chargify::Subscription::Transaction

Inherits:
Base
  • Object
show all
Defined in:
lib/chargify_api_ares/resources/subscription.rb

Instance Method Summary collapse

Methods inherited from Base

element_name, #to_xml

Instance Method Details

#full_refund(attrs = {}) ⇒ Object



158
159
160
161
162
163
# File 'lib/chargify_api_ares/resources/subscription.rb', line 158

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



165
166
167
168
169
170
# File 'lib/chargify_api_ares/resources/subscription.rb', line 165

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

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