lib/pagarme/transaction.rb in pagarme-1.9.2 vs lib/pagarme/transaction.rb in pagarme-1.9.3

- old
+ new

@@ -3,16 +3,23 @@ require 'base64' require File.join(File.dirname(__FILE__), '..', 'pagarme') module PagarMe class Transaction < TransactionCommon - def charge - create - end + def self.calculate_installments(params) + request = PagarMe::Request.new('/transactions/calculate_installments_amount', 'GET') + request.parameters.merge!(params) + response = request.run + response + end - def refund - request = PagarMe::Request.new(self.url + '/refund', 'POST') - response = request.run - update(response) - end + def charge + create + end + + def refund + request = PagarMe::Request.new(self.url + '/refund', 'POST') + response = request.run + update(response) + end end end