stripe-rails 0.2.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7790f65ab8bfe36fbf31047548b4fcff0bfd5fe5
4
+ data.tar.gz: 92c7f09f3630fe66adfc067e8e4bdfccd29800bc
5
+ SHA512:
6
+ metadata.gz: b339d2c6f0b45b8cd8dba33eeec647aa55816f91125cff77819f307982d46cf11948144c831739164a4ce2b53d81190d84adf9c2c54b6dcfe710e499cb209be1
7
+ data.tar.gz: 18437c4443284797186f842b63180d86fc4355a6cc99d8ffde3eb0241b6110f9a45d5e997473e53c66b1e74a08d48bbc420dc91481a842c3215dcc79c6778c5d
@@ -1,3 +1,6 @@
1
+ ## 0.3.0 (2014-04-29)
2
+ * Rename api_key to secret_key
3
+
1
4
  ## 0.2.6 (2013-10-17)
2
5
  * add `auto_mount` option to allow for manually mounting the webhook endpoints
3
6
 
data/Gemfile CHANGED
@@ -7,3 +7,4 @@ gem "bundler", ">= 1.3.0"
7
7
  gem "rake"
8
8
  gem 'tzinfo'
9
9
  gem 'mocha'
10
+ gem 'pry'
data/README.md CHANGED
@@ -46,22 +46,22 @@ config.stripe.debug_js = false # use stripe.js
46
46
 
47
47
  You will need to configure your application to authenticate with stripe.com
48
48
  using [your api key][1]. There are two methods to do this, you can either set the environment
49
- variable `STRIPE_API_KEY`:
49
+ variable `STRIPE_SECRET_KEY`:
50
50
 
51
51
  ```sh
52
- export STRIPE_API_KEY=sk_test_xxyyzz
52
+ export STRIPE_SECRET_KEY=sk_test_xxyyzz
53
53
  ```
54
54
 
55
55
  or if you are on heroku:
56
56
 
57
57
  ```sh
58
- heroku config:add STRIPE_API_KEY=sk_test_xxyyzz
58
+ heroku config:add STRIPE_SECRET_KEY=sk_test_xxyyzz
59
59
  ```
60
60
 
61
61
  You can also set this value from inside ruby configuration code:
62
62
 
63
63
  ```ruby
64
- config.stripe.api_key = "sk_test_xxyyzz"
64
+ config.stripe.secret_key = "sk_test_xxyyzz"
65
65
  ```
66
66
 
67
67
  In either case, it is recommended that you *not* check in this value into source control.
@@ -8,11 +8,16 @@ module Stripe
8
8
  attr_accessor :testing
9
9
  end
10
10
 
11
- config.stripe = Struct.new(:api_base, :api_key, :verify_ssl_certs, :publishable_key, :endpoint, :debug_js, :auto_mount).new
11
+ stripe_config = config.stripe = Struct.new(:api_base, :secret_key, :verify_ssl_certs, :publishable_key, :endpoint, :debug_js, :auto_mount).new
12
+
13
+ def stripe_config.api_key=(key)
14
+ warn "[DEPRECATION] to align with stripe nomenclature, stripe.api_key has been renamed to config.stripe.secret_key"
15
+ self.secret_key = key
16
+ end
12
17
 
13
18
  initializer 'stripe.configure.defaults', :before => 'stripe.configure' do |app|
14
19
  stripe = app.config.stripe
15
- stripe.api_key ||= ENV['STRIPE_API_KEY']
20
+ stripe.secret_key ||= ENV['STRIPE_SECRET_KEY']
16
21
  stripe.endpoint ||= '/stripe'
17
22
  stripe.auto_mount = true if stripe.auto_mount.nil?
18
23
  if stripe.debug_js.nil?
@@ -21,14 +26,16 @@ module Stripe
21
26
  end
22
27
 
23
28
  initializer 'stripe.configure' do |app|
24
- [:api_base, :api_key, :verify_ssl_certs].each do |key|
29
+ [:api_base, :verify_ssl_certs].each do |key|
25
30
  value = app.config.stripe.send(key)
26
31
  Stripe.send("#{key}=", value) unless value.nil?
27
32
  end
33
+ secret_key = app.config.stripe.secret_key
34
+ Stripe.api_key = secret_key unless secret_key.nil?
28
35
  $stderr.puts <<-MSG unless Stripe.api_key
29
36
  No stripe.com API key was configured for environment #{::Rails.env}! this application will be
30
37
  unable to interact with stripe.com. You can set your API key with either the environment
31
- variable `STRIPE_API_KEY` (recommended) or by setting `config.stripe.api_key` in your
38
+ variable `STRIPE_SECRET_KEY` (recommended) or by setting `config.stripe.secret_key` in your
32
39
  environment file directly.
33
40
  MSG
34
41
  end
@@ -50,4 +57,4 @@ environment file directly.
50
57
  load 'stripe/rails/tasks.rake'
51
58
  end
52
59
  end
53
- end
60
+ end
@@ -1,5 +1,5 @@
1
1
  module Stripe
2
2
  module Rails
3
- VERSION = "0.2.6"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # Configure Rails Environment
2
2
  ENV["RAILS_ENV"] = "test"
3
- ENV['STRIPE_API_KEY'] = 'XYZ'
3
+ ENV['STRIPE_SECRET_KEY'] = 'XYZ'
4
4
 
5
5
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
6
6
  require "rails/test_help"
@@ -16,4 +16,4 @@ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
16
16
  end
17
17
 
18
18
  Stripe::Engine.testing = true
19
- require 'mocha/setup'
19
+ require 'mocha/setup'
metadata CHANGED
@@ -1,60 +1,50 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: stripe-rails
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 6
10
- version: 0.2.6
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - rubygeek
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-10-17 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2014-04-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: rails
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 5
29
- segments:
30
- - 3
31
- version: "3"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
32
20
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: stripe
36
21
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: stripe
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
46
34
  type: :runtime
47
- version_requirements: *id002
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
48
41
  description: A gem to integrate stripe into your rails app
49
- email:
42
+ email:
50
43
  - nola@rubygeek.com
51
44
  executables: []
52
-
53
45
  extensions: []
54
-
55
46
  extra_rdoc_files: []
56
-
57
- files:
47
+ files:
58
48
  - .gitignore
59
49
  - .travis.yml
60
50
  - Changelog.md
@@ -125,40 +115,30 @@ files:
125
115
  - test/plan_builder_spec.rb
126
116
  - test/spec_helper.rb
127
117
  - test/stripe_rails_spec.rb
128
- homepage: ""
118
+ homepage: ''
129
119
  licenses: []
130
-
120
+ metadata: {}
131
121
  post_install_message:
132
122
  rdoc_options: []
133
-
134
- require_paths:
123
+ require_paths:
135
124
  - lib
136
- required_ruby_version: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- hash: 3
142
- segments:
143
- - 0
144
- version: "0"
145
- required_rubygems_version: !ruby/object:Gem::Requirement
146
- none: false
147
- requirements:
148
- - - ">="
149
- - !ruby/object:Gem::Version
150
- hash: 3
151
- segments:
152
- - 0
153
- version: "0"
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - '>='
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - '>='
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
154
135
  requirements: []
155
-
156
136
  rubyforge_project:
157
- rubygems_version: 1.8.24
137
+ rubygems_version: 2.0.3
158
138
  signing_key:
159
- specification_version: 3
139
+ specification_version: 4
160
140
  summary: A gem to integrate stripe into your rails app
161
- test_files:
141
+ test_files:
162
142
  - test/.DS_Store
163
143
  - test/all.rb
164
144
  - test/callbacks_spec.rb