reji 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +73 -0
  4. data/.rubocop_todo.yml +31 -0
  5. data/Appraisals +2 -0
  6. data/Gemfile +1 -1
  7. data/README.md +41 -17
  8. data/Rakefile +8 -2
  9. data/app/controllers/reji/payment_controller.rb +4 -4
  10. data/app/controllers/reji/webhook_controller.rb +51 -62
  11. data/app/views/payment.html.erb +4 -4
  12. data/app/views/receipt.html.erb +16 -16
  13. data/config/routes.rb +2 -0
  14. data/gemfiles/rails_5.0.gemfile +9 -9
  15. data/gemfiles/rails_5.1.gemfile +7 -9
  16. data/gemfiles/rails_5.2.gemfile +7 -9
  17. data/gemfiles/rails_6.0.gemfile +7 -9
  18. data/lib/generators/reji/install/install_generator.rb +20 -24
  19. data/lib/generators/reji/install/templates/reji.rb +2 -2
  20. data/lib/reji.rb +12 -8
  21. data/lib/reji/concerns/manages_customer.rb +25 -29
  22. data/lib/reji/concerns/manages_invoices.rb +37 -44
  23. data/lib/reji/concerns/manages_payment_methods.rb +45 -62
  24. data/lib/reji/concerns/manages_subscriptions.rb +13 -13
  25. data/lib/reji/concerns/performs_charges.rb +7 -7
  26. data/lib/reji/concerns/prorates.rb +1 -1
  27. data/lib/reji/configuration.rb +2 -2
  28. data/lib/reji/engine.rb +2 -0
  29. data/lib/reji/errors.rb +9 -9
  30. data/lib/reji/invoice.rb +57 -56
  31. data/lib/reji/invoice_line_item.rb +21 -23
  32. data/lib/reji/payment.rb +9 -5
  33. data/lib/reji/payment_method.rb +8 -4
  34. data/lib/reji/subscription.rb +165 -183
  35. data/lib/reji/subscription_builder.rb +41 -49
  36. data/lib/reji/subscription_item.rb +26 -26
  37. data/lib/reji/tax.rb +8 -10
  38. data/lib/reji/version.rb +1 -1
  39. data/reji.gemspec +5 -4
  40. data/spec/dummy/app/models/user.rb +3 -7
  41. data/spec/dummy/application.rb +3 -7
  42. data/spec/dummy/db/schema.rb +3 -4
  43. data/spec/feature/charges_spec.rb +1 -1
  44. data/spec/feature/customer_spec.rb +1 -1
  45. data/spec/feature/invoices_spec.rb +6 -6
  46. data/spec/feature/multiplan_subscriptions_spec.rb +51 -53
  47. data/spec/feature/payment_methods_spec.rb +25 -25
  48. data/spec/feature/pending_updates_spec.rb +26 -26
  49. data/spec/feature/subscriptions_spec.rb +78 -78
  50. data/spec/feature/webhooks_spec.rb +72 -72
  51. data/spec/spec_helper.rb +2 -2
  52. data/spec/support/feature_helpers.rb +6 -12
  53. data/spec/unit/customer_spec.rb +13 -13
  54. data/spec/unit/invoice_line_item_spec.rb +12 -14
  55. data/spec/unit/invoice_spec.rb +7 -9
  56. data/spec/unit/payment_spec.rb +3 -3
  57. data/spec/unit/subscription_spec.rb +29 -30
  58. metadata +26 -11
  59. data/Gemfile.lock +0 -133
@@ -1,133 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- reji (1.0.0)
5
- actionmailer (>= 5.0)
6
- activerecord (>= 5.0)
7
- money (>= 6.0)
8
- railties (>= 5.0)
9
- stripe (>= 5.0)
10
- wicked_pdf
11
- wkhtmltopdf-binary
12
-
13
- GEM
14
- remote: https://rubygems.org/
15
- specs:
16
- actionmailer (6.0.3.2)
17
- actionpack (= 6.0.3.2)
18
- actionview (= 6.0.3.2)
19
- activejob (= 6.0.3.2)
20
- mail (~> 2.5, >= 2.5.4)
21
- rails-dom-testing (~> 2.0)
22
- actionpack (6.0.3.2)
23
- actionview (= 6.0.3.2)
24
- activesupport (= 6.0.3.2)
25
- rack (~> 2.0, >= 2.0.8)
26
- rack-test (>= 0.6.3)
27
- rails-dom-testing (~> 2.0)
28
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
29
- actionview (6.0.3.2)
30
- activesupport (= 6.0.3.2)
31
- builder (~> 3.1)
32
- erubi (~> 1.4)
33
- rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
35
- activejob (6.0.3.2)
36
- activesupport (= 6.0.3.2)
37
- globalid (>= 0.3.6)
38
- activemodel (6.0.3.2)
39
- activesupport (= 6.0.3.2)
40
- activerecord (6.0.3.2)
41
- activemodel (= 6.0.3.2)
42
- activesupport (= 6.0.3.2)
43
- activesupport (6.0.3.2)
44
- concurrent-ruby (~> 1.0, >= 1.0.2)
45
- i18n (>= 0.7, < 2)
46
- minitest (~> 5.1)
47
- tzinfo (~> 1.1)
48
- zeitwerk (~> 2.2, >= 2.2.2)
49
- appraisal (2.3.0)
50
- bundler
51
- rake
52
- thor (>= 0.14.0)
53
- builder (3.2.4)
54
- coderay (1.1.3)
55
- concurrent-ruby (1.1.7)
56
- crass (1.0.6)
57
- diff-lcs (1.4.4)
58
- erubi (1.9.0)
59
- globalid (0.4.2)
60
- activesupport (>= 4.2.0)
61
- i18n (1.8.5)
62
- concurrent-ruby (~> 1.0)
63
- loofah (2.7.0)
64
- crass (~> 1.0.2)
65
- nokogiri (>= 1.5.9)
66
- mail (2.7.1)
67
- mini_mime (>= 0.1.1)
68
- method_source (1.0.0)
69
- mini_mime (1.0.2)
70
- mini_portile2 (2.4.0)
71
- minitest (5.14.2)
72
- money (6.13.8)
73
- i18n (>= 0.6.4, <= 2)
74
- nokogiri (1.10.10)
75
- mini_portile2 (~> 2.4.0)
76
- pry (0.13.1)
77
- coderay (~> 1.1)
78
- method_source (~> 1.0)
79
- rack (2.2.3)
80
- rack-test (1.1.0)
81
- rack (>= 1.0, < 3)
82
- rails-dom-testing (2.0.3)
83
- activesupport (>= 4.2.0)
84
- nokogiri (>= 1.6)
85
- rails-html-sanitizer (1.3.0)
86
- loofah (~> 2.3)
87
- railties (6.0.3.2)
88
- actionpack (= 6.0.3.2)
89
- activesupport (= 6.0.3.2)
90
- method_source
91
- rake (>= 0.8.7)
92
- thor (>= 0.20.3, < 2.0)
93
- rake (13.0.1)
94
- rspec-core (3.9.2)
95
- rspec-support (~> 3.9.3)
96
- rspec-expectations (3.9.2)
97
- diff-lcs (>= 1.2.0, < 2.0)
98
- rspec-support (~> 3.9.0)
99
- rspec-mocks (3.9.1)
100
- diff-lcs (>= 1.2.0, < 2.0)
101
- rspec-support (~> 3.9.0)
102
- rspec-rails (4.0.1)
103
- actionpack (>= 4.2)
104
- activesupport (>= 4.2)
105
- railties (>= 4.2)
106
- rspec-core (~> 3.9)
107
- rspec-expectations (~> 3.9)
108
- rspec-mocks (~> 3.9)
109
- rspec-support (~> 3.9)
110
- rspec-support (3.9.3)
111
- sqlite3 (1.4.2)
112
- stripe (5.25.0)
113
- thor (1.0.1)
114
- thread_safe (0.3.6)
115
- tzinfo (1.2.7)
116
- thread_safe (~> 0.1)
117
- wicked_pdf (2.1.0)
118
- activesupport
119
- wkhtmltopdf-binary (0.12.6.3)
120
- zeitwerk (2.4.0)
121
-
122
- PLATFORMS
123
- ruby
124
-
125
- DEPENDENCIES
126
- appraisal
127
- pry
128
- reji!
129
- rspec-rails (~> 4.0.1)
130
- sqlite3 (~> 1.4.2)
131
-
132
- BUNDLED WITH
133
- 2.1.4