Class: PagarMe::Transaction

Inherits:
TransactionCommon show all
Defined in:
lib/pagarme/transaction.rb

Instance Method Summary collapse

Methods inherited from TransactionCommon

#card_data_parameters, #create, #format_amount, #generate_card_hash, #initialize, #is_valid_credit_card, #unset_creditcard_information, #validate

Methods inherited from Model

all, class_name, #create, find_by, find_by_id, #save, url, #url

Methods inherited from PagarMeObject

#[], #[]=, build, #each, #initialize, #to_hash, #unsaved_values, #update

Constructor Details

This class inherits a constructor from PagarMe::TransactionCommon

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PagarMe::PagarMeObject

Instance Method Details

#chargeObject



8
9
10
# File 'lib/pagarme/transaction.rb', line 8

def charge
 	create
end

#refundObject



12
13
14
15
16
# File 'lib/pagarme/transaction.rb', line 12

def refund
  request = PagarMe::Request.new(self.url + '/refund', 'POST')
  response = request.run
  update(response)
end