pay 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pay might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 026eec665e0972815526e10a0f8082c9dc7de99c8df6dfe890aa34630f902828
4
- data.tar.gz: 44a6a608fcc55f9d235191716b78a55b1d3f595e8e9233f630ecdd1b3ca0d3e8
3
+ metadata.gz: 6b8ee10da017b8876cf39df8679d26cf1c18de43201809065693d1c59a4d687f
4
+ data.tar.gz: e522b86563b6d6f1770d589f9d3f608168869b9dfc4adc499bb8b6c997669683
5
5
  SHA512:
6
- metadata.gz: cb4cf20991b9ff113c6cad8d86df842bae567c4dc24d0a0c8b862ef8430380d36adfda3dfaaceaa0f28e2b84904cd35ee832981ec3a71c822e0f00ac008a17ad
7
- data.tar.gz: 507a29aa827680ffb1dc36cf66142ad94d96f8aa25ead267dfb96fbbda9e431687eae4d410bd6bf7f3ecf8bc07a4d8ca4bf05441795f657a10ba713470b3c1e8
6
+ metadata.gz: d775f1b342f3202c2a11c17372e4602fb186bf0c4556ee5e3eae11be4fcd293e5dd719a540a1c3c6f310cc00df9c5802c321b0e503aa4fc102d613562012fee8
7
+ data.tar.gz: 8d8bcc8b121760e323dc11ad79db0ac344f07324d157159bb30a6e0b5bf0b55fe6a8c5f5960820031b6808cec411e50ee3abc0d6c4460ccc0c9b7372c99ae250
data/README.md CHANGED
@@ -13,6 +13,8 @@ Pay is a payments engine for Ruby on Rails 4.2 and higher.
13
13
 
14
14
  Want to add a new payment provider? Contributions are welcome and the instructions [are here](https://github.com/jasoncharnes/pay/wiki/New-Payment-Provider).
15
15
 
16
+ **Check the CHANGELOG for any required migrations or changes needed if you're upgrading from a previous version of Pay.**
17
+
16
18
  ## Tutorial
17
19
 
18
20
  Want to see how Pay works? Check out our video getting started guide.
@@ -43,37 +45,21 @@ And then execute:
43
45
  bundle
44
46
  ```
45
47
 
46
- Or install it yourself as:
47
-
48
- ```bash
49
- gem install pay
50
- ```
51
-
52
- ## Setup
53
-
54
- ### Migrations
55
-
56
- This engine will create a subscription model and the neccessary migrations for the model you want to make "billable." The most common use case for the billable model is a User.
48
+ #### Migrations
57
49
 
58
50
  To add the migrations to your application, run the following migration:
59
51
 
60
- `$ bin/rails pay:install:migrations`
52
+ `bin/rails pay:install:migrations`
61
53
 
62
- This will install three migrations:
54
+ We also need to run migrations to add Pay to the User, Account, Team, etc models that we want to make payments in our app.
63
55
 
64
- - db/migrate/create_subscriptions.pay.rb
65
- - db/migrate/create_charges.pay.rb
66
- - db/migrate/add_status_to_subscriptions.pay.rb
56
+ `bin/rails g pay User`
67
57
 
68
- You'll also need a model that can make payments. This is called a
69
- `Billable` model. The `pay` generator will add fields to the model and
70
- add the `Pay::Billable` module to it.
58
+ This will generate a migration to add Pay fields to our User model and automatically includes the `Pay::Billable` module in our `User` model. Repeat this for all the models you want to make payments in your app.
71
59
 
72
- `$ bin/rails g pay User`
60
+ Finally, run the migrations
73
61
 
74
- #### Run the Migrations
75
-
76
- Finally, run the migrations with `$ rake db:migrate`
62
+ `rake db:migrate`
77
63
 
78
64
  #### Getting NoMethodError?
79
65
 
@@ -545,6 +531,7 @@ If a user's email is updated and they have a `processor_id` set, Pay will enqueu
545
531
 
546
532
  It's important you set a queue_adapter for this to happen. If you don't, the code will be executed immediately upon user update. [More information here](https://guides.rubyonrails.org/v4.2/active_job_basics.html#backends)
547
533
 
534
+
548
535
  ## Contributors
549
536
 
550
537
  - [Jason Charnes](https://twitter.com/jmcharnes)
data/Rakefile CHANGED
@@ -1,40 +1,34 @@
1
1
  begin
2
- require "bundler/setup"
2
+ require 'bundler/setup'
3
3
  rescue LoadError
4
- puts "You must `gem install bundler` and `bundle install` to run rake tasks"
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
5
  end
6
6
 
7
- require "rdoc/task"
7
+ require 'rdoc/task'
8
8
 
9
9
  RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = "rdoc"
11
- rdoc.title = "Pay"
12
- rdoc.options << "--line-numbers"
13
- rdoc.rdoc_files.include("README.md")
14
- rdoc.rdoc_files.include("lib/**/*.rb")
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Pay'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
- APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
17
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
18
+ load 'rails/tasks/engine.rake'
18
19
 
19
- load "rails/tasks/engine.rake"
20
- load "rails/tasks/statistics.rake"
20
+ load 'rails/tasks/statistics.rake'
21
21
 
22
- require "bundler/gem_tasks"
23
- require "rake/testtask"
22
+ unless Rails.env.test?
23
+ require "bundler/gem_tasks"
24
+ end
25
+
26
+ require 'rake/testtask'
24
27
 
25
28
  Rake::TestTask.new(:test) do |t|
26
- t.libs << "lib"
27
- t.libs << "test"
28
- t.pattern = "test/**/*_test.rb"
29
+ t.libs << 'test'
30
+ t.pattern = 'test/**/*_test.rb'
29
31
  t.verbose = false
30
32
  end
31
33
 
32
34
  task default: :test
33
-
34
- task :console do
35
- require "irb"
36
- require "irb/completion"
37
- require "pay"
38
- ARGV.clear
39
- IRB.start
40
- end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AddPayTo<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
3
+ class AddPayBillableTo<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
4
4
  def change
5
5
  change_table :<%= table_name %> do |t|
6
6
  <%= migration_data -%>
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Charnes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-03-28 00:00:00.000000000 Z
12
+ date: 2020-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -73,20 +73,6 @@ dependencies:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.3'
76
- - !ruby/object:Gem::Dependency
77
- name: bundler
78
- requirement: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- type: :development
84
- prerelease: false
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
76
  - !ruby/object:Gem::Dependency
91
77
  name: byebug
92
78
  requirement: !ruby/object:Gem::Requirement
@@ -233,7 +219,6 @@ files:
233
219
  - config/locales/en.yml
234
220
  - config/routes.rb
235
221
  - db/migrate/20170205020145_create_pay_subscriptions.rb
236
- - db/migrate/20170503131610_add_fields_to_billable.rb
237
222
  - db/migrate/20170727235816_create_pay_charges.rb
238
223
  - db/migrate/20190816015720_add_status_to_pay_subscriptions.rb
239
224
  - lib/generators/active_record/pay_generator.rb
@@ -288,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
273
  - !ruby/object:Gem::Version
289
274
  version: '0'
290
275
  requirements: []
291
- rubygems_version: 3.0.3
276
+ rubygems_version: 3.1.2
292
277
  signing_key:
293
278
  specification_version: 4
294
279
  summary: A Ruby on Rails subscription engine.
@@ -1,16 +0,0 @@
1
- class AddFieldsToBillable < ActiveRecord::Migration[4.2]
2
- def change
3
- unless ActiveRecord::Base.connection.table_exists?(Pay.billable_table)
4
- create_table Pay.billable_table.to_sym
5
- end
6
-
7
- add_column Pay.billable_table, :processor, :string
8
- add_column Pay.billable_table, :processor_id, :string
9
- add_column Pay.billable_table, :trial_ends_at, :datetime
10
- add_column Pay.billable_table, :card_type, :string
11
- add_column Pay.billable_table, :card_last4, :string
12
- add_column Pay.billable_table, :card_exp_month, :string
13
- add_column Pay.billable_table, :card_exp_year, :string
14
- add_column Pay.billable_table, :extra_billing_info, :text
15
- end
16
- end