rbraspag 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbraspag (0.0.11)
4
+ rbraspag (0.0.13)
5
5
  cs-httpi (>= 0.9.5.2)
6
6
  json
7
7
  nokogiri
@@ -27,6 +27,7 @@ GEM
27
27
  ruby_core_source (>= 0.1.4)
28
28
  nokogiri (1.5.0)
29
29
  rack (1.3.0)
30
+ rake (0.9.2)
30
31
  rspec (2.6.0)
31
32
  rspec-core (~> 2.6.0)
32
33
  rspec-expectations (~> 2.6.0)
@@ -55,6 +56,7 @@ DEPENDENCIES
55
56
  fakeweb
56
57
  guard-bundler
57
58
  guard-rspec
59
+ rake
58
60
  rbraspag!
59
61
  rspec
60
62
  ruby-debug19
data/README.md CHANGED
@@ -2,22 +2,36 @@
2
2
 
3
3
  rbraspag gem to use Braspag gateway
4
4
 
5
- # Instalation
5
+ * This gem need RACK_ENV environment variable to identify the environment
6
6
 
7
- gem install rbraspag
7
+ # How to install
8
8
 
9
- # Example
9
+ ## for Rails 3 app
10
10
 
11
- ## Create a Bill (Boleto/Bloqueto for brazilian guys)
12
- your_merchant_id = '{12341234-1234-1234-1234-123412341234}'
13
- connection = Braspag::Connection.new your_merchant_id
14
- Braspag::Bill.new(connection , {
11
+ ### Add on your Gemfile
12
+
13
+ gem "rbraspag"
14
+
15
+ ### Create a config/braspag.yml file
16
+
17
+ $ rails generate braspag:install
18
+
19
+ ### Set RACK_ENV (our suggest)
20
+
21
+ # add last line in config/environment.rb
22
+ # ...
23
+ # ENV["RACK_ENV"] ||= ENV["RAILS_ENV"]
24
+
25
+ ### Edit config/braspag.yml with your Braspag merchant_id
26
+
27
+ # Examples
28
+
29
+ ## to create a Bill (Boleto/Bloqueto for brazilian guys)
30
+ @bill = Braspag::Bill.generate({
15
31
  :order_id => 1,
16
32
  :amount => 3,
17
33
  :payment_method => 10
18
34
  })
19
- @response = @bill.generate
20
-
21
35
 
22
36
  # License
23
37
 
@@ -0,0 +1,15 @@
1
+ module Braspag
2
+ module Generators
3
+ class InstallGenerator < ::Rails::Generators::Base
4
+ desc "Copy braspag.yml file to your application config directory."
5
+
6
+ def self.source_root
7
+ @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
8
+ end
9
+
10
+ def copy_config_file
11
+ template "config/braspag.yml"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ development:
2
+ merchant_id: "{YOUR_MERCHANT_ID_ON_BRASPAG}"
3
+ braspag_url: "https://homologacao.pagador.com.br"
4
+ crypto_url: "http://localhost:9292"
5
+ crypto_key: "1234561246"
6
+
7
+ test:
8
+ merchant_id: "{YOUR_MERCHANT_ID_ON_BRASPAG}"
9
+ braspag_url: "https://homologacao.pagador.com.br"
10
+ crypto_url: "http://localhost:9292"
11
+ crypto_key: "1234561246"
12
+
13
+ production:
14
+ merchant_id: "{YOUR_MERCHANT_ID_ON_BRASPAG}"
15
+ braspag_url: "https://www.pagador.com.br"
16
+ crypto_url: "http://localhost:9292"
17
+ crypto_key: "1234561246"
@@ -1,3 +1,3 @@
1
1
  module Braspag
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
data/lib/rbraspag.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  require "rbraspag/version"
2
2
 
3
- ENV["RACK_ENV"] ||= "development"
4
-
5
3
  require 'bundler'
6
4
 
7
5
  Bundler.setup
@@ -10,7 +8,7 @@ require "cs-httpi"
10
8
  require "json"
11
9
  require "nokogiri"
12
10
 
13
- Bundler.require(:default, ENV["RACK_ENV"].to_sym)
11
+ Bundler.require(:default, (ENV["RACK_ENV"] || "development").to_sym)
14
12
 
15
13
  require 'rbraspag/connection'
16
14
  require 'rbraspag/payment_method'
data/rbraspag.gemspec CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_dependency 'json'
23
23
  s.add_dependency 'nokogiri'
24
24
 
25
+ s.add_development_dependency "rake"
25
26
  s.add_development_dependency "rspec"
26
27
  s.add_development_dependency "fakeweb"
27
28
  s.add_development_dependency "shoulda-matchers"
data/spec/spec_helper.rb CHANGED
@@ -2,6 +2,8 @@ require 'rubygems'
2
2
  require 'rbraspag'
3
3
  require 'fakeweb'
4
4
 
5
+ ENV["RACK_ENV"] ||= "test"
6
+
5
7
  RSpec.configure do |config|
6
8
  config.mock_with :rspec
7
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbraspag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,12 +14,11 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2011-08-04 00:00:00.000000000 -03:00
18
- default_executable:
17
+ date: 2011-08-09 00:00:00.000000000Z
19
18
  dependencies:
20
19
  - !ruby/object:Gem::Dependency
21
20
  name: cs-httpi
22
- requirement: &85379830 !ruby/object:Gem::Requirement
21
+ requirement: &8754860 !ruby/object:Gem::Requirement
23
22
  none: false
24
23
  requirements:
25
24
  - - ! '>='
@@ -27,10 +26,10 @@ dependencies:
27
26
  version: 0.9.5.2
28
27
  type: :runtime
29
28
  prerelease: false
30
- version_requirements: *85379830
29
+ version_requirements: *8754860
31
30
  - !ruby/object:Gem::Dependency
32
31
  name: json
33
- requirement: &85379620 !ruby/object:Gem::Requirement
32
+ requirement: &8753560 !ruby/object:Gem::Requirement
34
33
  none: false
35
34
  requirements:
36
35
  - - ! '>='
@@ -38,10 +37,10 @@ dependencies:
38
37
  version: '0'
39
38
  type: :runtime
40
39
  prerelease: false
41
- version_requirements: *85379620
40
+ version_requirements: *8753560
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: nokogiri
44
- requirement: &85379390 !ruby/object:Gem::Requirement
43
+ requirement: &8751360 !ruby/object:Gem::Requirement
45
44
  none: false
46
45
  requirements:
47
46
  - - ! '>='
@@ -49,10 +48,21 @@ dependencies:
49
48
  version: '0'
50
49
  type: :runtime
51
50
  prerelease: false
52
- version_requirements: *85379390
51
+ version_requirements: *8751360
52
+ - !ruby/object:Gem::Dependency
53
+ name: rake
54
+ requirement: &8750180 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: *8750180
53
63
  - !ruby/object:Gem::Dependency
54
64
  name: rspec
55
- requirement: &85379180 !ruby/object:Gem::Requirement
65
+ requirement: &8747060 !ruby/object:Gem::Requirement
56
66
  none: false
57
67
  requirements:
58
68
  - - ! '>='
@@ -60,10 +70,10 @@ dependencies:
60
70
  version: '0'
61
71
  type: :development
62
72
  prerelease: false
63
- version_requirements: *85379180
73
+ version_requirements: *8747060
64
74
  - !ruby/object:Gem::Dependency
65
75
  name: fakeweb
66
- requirement: &85378970 !ruby/object:Gem::Requirement
76
+ requirement: &8746420 !ruby/object:Gem::Requirement
67
77
  none: false
68
78
  requirements:
69
79
  - - ! '>='
@@ -71,10 +81,10 @@ dependencies:
71
81
  version: '0'
72
82
  type: :development
73
83
  prerelease: false
74
- version_requirements: *85378970
84
+ version_requirements: *8746420
75
85
  - !ruby/object:Gem::Dependency
76
86
  name: shoulda-matchers
77
- requirement: &85378760 !ruby/object:Gem::Requirement
87
+ requirement: &8745920 !ruby/object:Gem::Requirement
78
88
  none: false
79
89
  requirements:
80
90
  - - ! '>='
@@ -82,10 +92,10 @@ dependencies:
82
92
  version: '0'
83
93
  type: :development
84
94
  prerelease: false
85
- version_requirements: *85378760
95
+ version_requirements: *8745920
86
96
  - !ruby/object:Gem::Dependency
87
97
  name: guard-rspec
88
- requirement: &85378550 !ruby/object:Gem::Requirement
98
+ requirement: &8745260 !ruby/object:Gem::Requirement
89
99
  none: false
90
100
  requirements:
91
101
  - - ! '>='
@@ -93,10 +103,10 @@ dependencies:
93
103
  version: '0'
94
104
  type: :development
95
105
  prerelease: false
96
- version_requirements: *85378550
106
+ version_requirements: *8745260
97
107
  - !ruby/object:Gem::Dependency
98
108
  name: guard-bundler
99
- requirement: &85378340 !ruby/object:Gem::Requirement
109
+ requirement: &8744620 !ruby/object:Gem::Requirement
100
110
  none: false
101
111
  requirements:
102
112
  - - ! '>='
@@ -104,10 +114,10 @@ dependencies:
104
114
  version: '0'
105
115
  type: :development
106
116
  prerelease: false
107
- version_requirements: *85378340
117
+ version_requirements: *8744620
108
118
  - !ruby/object:Gem::Dependency
109
119
  name: ruby-debug19
110
- requirement: &85378130 !ruby/object:Gem::Requirement
120
+ requirement: &8743800 !ruby/object:Gem::Requirement
111
121
  none: false
112
122
  requirements:
113
123
  - - ! '>='
@@ -115,7 +125,7 @@ dependencies:
115
125
  version: '0'
116
126
  type: :development
117
127
  prerelease: false
118
- version_requirements: *85378130
128
+ version_requirements: *8743800
119
129
  description: rbraspag gem to use Braspag gateway
120
130
  email:
121
131
  - tinorj@gmail.com
@@ -136,6 +146,8 @@ files:
136
146
  - README.md
137
147
  - Rakefile
138
148
  - config/braspag.yml
149
+ - lib/generators/braspag/install/install_generator.rb
150
+ - lib/generators/braspag/install/templates/config/braspag.yml
139
151
  - lib/rbraspag.rb
140
152
  - lib/rbraspag/bill.rb
141
153
  - lib/rbraspag/connection.rb
@@ -159,7 +171,6 @@ files:
159
171
  - spec/order_spec.rb
160
172
  - spec/spec_helper.rb
161
173
  - spec/utils_spec.rb
162
- has_rdoc: true
163
174
  homepage: http://github.com/concretesolutions/rbraspag
164
175
  licenses: []
165
176
  post_install_message:
@@ -172,15 +183,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
183
  - - ! '>='
173
184
  - !ruby/object:Gem::Version
174
185
  version: '0'
186
+ segments:
187
+ - 0
188
+ hash: -971698251668178937
175
189
  required_rubygems_version: !ruby/object:Gem::Requirement
176
190
  none: false
177
191
  requirements:
178
192
  - - ! '>='
179
193
  - !ruby/object:Gem::Version
180
194
  version: '0'
195
+ segments:
196
+ - 0
197
+ hash: -971698251668178937
181
198
  requirements: []
182
199
  rubyforge_project: rbraspag
183
- rubygems_version: 1.6.2
200
+ rubygems_version: 1.8.1
184
201
  signing_key:
185
202
  specification_version: 3
186
203
  summary: rbraspag gem to use Braspag gateway