Class: PagarMe::TransactionCommon

Inherits:
Model show all
Defined in:
lib/pagarme/transaction_common.rb

Direct Known Subclasses

Card, Subscription, Transaction

Constant Summary

Constants inherited from PagarMeObject

PagarMeObject::RESOURCES

Instance Attribute Summary

Attributes inherited from PagarMeObject

#attributes

Instance Method Summary collapse

Methods inherited from Model

all, class_name, create, extract_page_count_or_params, find_by, find_by_id, underscored_class_name, url, #url

Methods inherited from PagarMeObject

#==, #[]=, convert, #empty?, #respond_to?, #to_hash, #to_s, #unsaved_attributes

Constructor Details

#initialize(response = {}) ⇒ TransactionCommon

Returns a new instance of TransactionCommon.



4
5
6
7
8
9
10
# File 'lib/pagarme/transaction_common.rb', line 4

def initialize(response = {})
  super(response)

  self.payment_method ||= 'credit_card'
  self.installments   ||= 1
  self.status         ||= 'local'
end

Dynamic Method Handling

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

Instance Method Details

#createObject



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

def create
  check_card_object
  super
end

#saveObject



17
18
19
20
# File 'lib/pagarme/transaction_common.rb', line 17

def save
  check_card_object
  super
end