Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Atualização do README, adicionado generator para instalação e atualiz…
Browse files Browse the repository at this point in the history
…ação da versão
  • Loading branch information
tinogomes committed Aug 9, 2011
1 parent 02bbb83 commit e80c5b3
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 10 deletions.
32 changes: 23 additions & 9 deletions README.md
Expand Up @@ -2,22 +2,36 @@


rbraspag gem to use Braspag gateway 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) ### Add on your Gemfile
your_merchant_id = '{12341234-1234-1234-1234-123412341234}'
connection = Braspag::Connection.new your_merchant_id gem "rbraspag"
Braspag::Bill.new(connection , {
### 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, :order_id => 1,
:amount => 3, :amount => 3,
:payment_method => 10 :payment_method => 10
}) })
@response = @bill.generate



# License # License


Expand Down
15 changes: 15 additions & 0 deletions 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
17 changes: 17 additions & 0 deletions 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"
2 changes: 1 addition & 1 deletion lib/rbraspag/version.rb
@@ -1,3 +1,3 @@
module Braspag module Braspag
VERSION = "0.0.12" VERSION = "0.0.13"
end end

0 comments on commit e80c5b3

Please sign in to comment.