Sha256: 4db13d10d49e3d8a28485062a27a33544debfe7967f85c79f40593c12105fb71
Contents?: true
Size: 1.16 KB
Versions: 5
Compression:
Stored size: 1.16 KB
Contents
require File.join(File.dirname(__FILE__), '.', 'lib/pagarme') PagarMe.api_key = "4f0907cdfaf855b83a5d4a83a247772f" PagarMe.live = true begin transaction = PagarMe::Transaction.new transaction.card_number = "0000000000000000" transaction.card_holder_name = "Test User" transaction.card_expiracy_month = "12" transaction.card_expiracy_year = "15" transaction.card_cvv = "314" transaction.amount = 1000 transaction.charge transaction.chargeback chargebacked_transaction = PagarMe::Transaction.find_by_id(transaction.id) puts chargebacked_transaction.id == transaction.id puts chargebacked_transaction.status == transaction.status puts chargebacked_transaction.inspect puts "\n\n" hash_transaction = PagarMe::Transaction.new({ :card_number => "0000000000000000", :card_holder_name => "Test User", :card_expiracy_month => "12", :card_expiracy_year => "13", :card_cvv => "314", :amount => 10000, :installments => 5 }) hash_transaction.charge puts hash_transaction.inspect puts hash_transaction.status puts "\n\n" transactions = PagarMe::Transaction.all puts transactions.inspect rescue PagarMe::PagarMeError => e puts "Error: #{e}" end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
pagarme-0.15 | pagarme.rb |
pagarme-0.14 | pagarme.rb |
pagarme-0.13 | pagarme.rb |
pagarme-0.12 | pagarme.rb |
pagarme-0.11 | pagarme.rb |