Sha256: cc2d3a76235236d54b90b419048a3688b6b69c4e3f181a2f8799a927e63e14f5

Contents?: true

Size: 434 Bytes

Versions: 14

Compression:

Stored size: 434 Bytes

Contents

module Chargify
  class Transaction < Base
    def full_refund(attrs = {})
      return false if self.transaction_type != 'payment'

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

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

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
chargify_api_ares-1.1.0 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-1.1.0.pre lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-1.0.5 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-1.0.4 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-1.0.3 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-1.0.2 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-1.0.1 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-1.0.0 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-0.6.1 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-0.6.0 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-0.5.4 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-0.5.2 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-0.5.1 lib/chargify_api_ares/resources/transaction.rb
chargify_api_ares-0.5.0 lib/chargify_api_ares/resources/transaction.rb