Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Atualização do README, adicionado generator para instalação e atualiz…

…ação da versão
  • Loading branch information...
commit e80c5b3d34ade73e3022b72b2891f087057ae3d5 1 parent 02bbb83
@tinogomes tinogomes authored
View
32 README.md
@@ -2,22 +2,36 @@
rbraspag gem to use Braspag gateway
-# Instalation
+* This gem need RACK_ENV environment variable to identify the environment
- gem install rbraspag
+# How to install
-# Example
+## for Rails 3 app
-## Create a Bill (Boleto/Bloqueto for brazilian guys)
- your_merchant_id = '{12341234-1234-1234-1234-123412341234}'
- connection = Braspag::Connection.new your_merchant_id
- Braspag::Bill.new(connection , {
+### Add on your Gemfile
+
+ gem "rbraspag"
+
+### Create a config/braspag.yml file
+
+ $ rails generate braspag:install
+
+### Set RACK_ENV (our suggest)
+
+ # add last line in config/environment.rb
+ # ...
+ # ENV["RACK_ENV"] ||= ENV["RAILS_ENV"]
+
+### Edit config/braspag.yml with your Braspag merchant_id
+
+# Examples
+
+## to create a Bill (Boleto/Bloqueto for brazilian guys)
+ @bill = Braspag::Bill.generate({
:order_id => 1,
:amount => 3,
:payment_method => 10
})
- @response = @bill.generate
-
# License
View
15 lib/generators/braspag/install/install_generator.rb
@@ -0,0 +1,15 @@
+module Braspag
+ module Generators
+ class InstallGenerator < ::Rails::Generators::Base
+ desc "Copy braspag.yml file to your application config directory."
+
+ def self.source_root
+ @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
+ end
+
+ def copy_config_file
+ template "config/braspag.yml"
+ end
+ end
+ end
+end
View
17 lib/generators/braspag/install/templates/config/braspag.yml
@@ -0,0 +1,17 @@
+development:
+ merchant_id: "{YOUR_MERCHANT_ID_ON_BRASPAG}"
+ braspag_url: "https://homologacao.pagador.com.br"
+ crypto_url: "http://localhost:9292"
+ crypto_key: "1234561246"
+
+test:
+ merchant_id: "{YOUR_MERCHANT_ID_ON_BRASPAG}"
+ braspag_url: "https://homologacao.pagador.com.br"
+ crypto_url: "http://localhost:9292"
+ crypto_key: "1234561246"
+
+production:
+ merchant_id: "{YOUR_MERCHANT_ID_ON_BRASPAG}"
+ braspag_url: "https://www.pagador.com.br"
+ crypto_url: "http://localhost:9292"
+ crypto_key: "1234561246"
View
2  lib/rbraspag/version.rb
@@ -1,3 +1,3 @@
module Braspag
- VERSION = "0.0.12"
+ VERSION = "0.0.13"
end
Please sign in to comment.
Something went wrong with that request. Please try again.