lib/pagarme/transaction.rb in pagarme-1.10.0 vs lib/pagarme/transaction.rb in pagarme-2.0.0

- old
+ new

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