lib/pagarme/resources/transaction.rb in pagarme-2.1.3 vs lib/pagarme/resources/transaction.rb in pagarme-2.1.4
- old
+ new
@@ -16,10 +16,18 @@
def postbacks
PagarMe::Request.get( url 'postbacks' ).call
end
+ def operations
+ PagarMe::Request.get( url 'operations' ).call
+ end
+
+ def events
+ PagarMe::Request.get( url 'events' ).call
+ end
+
def collect_payment(params={})
PagarMe::Request.post(url('collect_payment'), params: params).run
end
def capture(params={})
@@ -29,18 +37,18 @@
def refund(params={})
update PagarMe::Request.post(url('refund'), params: params).run
end
class << self
+ alias :charge :create
+
def calculate_installments(params)
PagarMe::Request.get(url('calculate_installments_amount'), query: params).run
end
-
- def generate_card_hash()
- raise RequestError.new('Invalid Encryption Key') if PagarMe.encryption_key.blank?
-
- PagarMe::Request.get(url('card_hash_key'), params: { encryption_key: PagarMe.encryption_key }).call
- end
- alias :charge :create
+
+ def generate_card_hash
+ raise RequestError.new('Invalid Encryption Key') if PagarMe.encryption_key.blank?
+ PagarMe::Request.get(url('card_hash_key'), params: { encryption_key: PagarMe.encryption_key }).call
+ end
end
end
end