lib/pagseguro/rake.rb in pagseguro-0.1.3 vs lib/pagseguro/rake.rb in pagseguro-0.1.4
- old
+ new
@@ -2,11 +2,10 @@
module Rake
extend self
def run
require "digest/md5"
- require "faker"
# Not running in developer mode? Exit!
unless PagSeguro.developer?
puts "=> [PagSeguro] Can only notify development URLs"
puts "=> [PagSeguro] Double check your config/pagseguro.yml file"
@@ -36,18 +35,21 @@
puts "=> [PagSeguro] The order #{ENV['ID'].inspect} could not be found. Exiting now!"
exit 1
end
# Set the client's info
- order["CliNome"] = ENV["NAME"] || Faker::Name.name
- order["CliEmail"] = ENV["EMAIL"] || Faker::Internet.email
- order["CliEndereco"] = Faker::Address.street_name
+ name = ENV["NAME"] || Faker.name
+ email = ENV["EMAIL"] || Faker.email(name)
+
+ order["CliNome"] = name
+ order["CliEmail"] = email
+ order["CliEndereco"] = Faker.street_name
order["CliNumero"] = rand(1000)
- order["CliComplemento"] = Faker::Address.secondary_address
- order["CliBairro"] = Faker::Address.city
- order["CliCidade"] = Faker::Address.city
- order["CliCEP"] = "12345678"
- order["CliTelefone"] = "11 12345678"
+ order["CliComplemento"] = Faker.secondary_address
+ order["CliBairro"] = Faker.city
+ order["CliCidade"] = Faker.city
+ order["CliCEP"] = Faker.zipcode
+ order["CliTelefone"] = Faker.phone_number
# Set the transaction date
order["DataTransacao"] = Time.now.strftime("%d/%m/%Y %H:%M:%S")
# Replace the order id to the correct name