moneytree-rails 0.1.0 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +63 -30
  4. data/Rakefile +30 -4
  5. data/app/assets/config/moneytree_manifest.js +1 -0
  6. data/app/assets/stylesheets/moneytree/application.css +15 -0
  7. data/app/controllers/moneytree/application_controller.rb +9 -0
  8. data/app/controllers/moneytree/oauth/square_controller.rb +14 -0
  9. data/app/controllers/moneytree/oauth/stripe_controller.rb +44 -0
  10. data/app/controllers/moneytree/webhooks/square_controller.rb +9 -0
  11. data/app/controllers/moneytree/webhooks/stripe_controller.rb +67 -0
  12. data/app/jobs/moneytree/application_job.rb +4 -0
  13. data/app/mailers/moneytree/application_mailer.rb +6 -0
  14. data/app/models/moneytree/application_record.rb +5 -0
  15. data/app/models/moneytree/payment.rb +23 -0
  16. data/app/models/moneytree/payment_gateway.rb +47 -0
  17. data/app/models/moneytree/refund.rb +46 -0
  18. data/app/models/moneytree/transaction.rb +30 -0
  19. data/app/views/layouts/moneytree/application.html.erb +15 -0
  20. data/config/routes.rb +8 -0
  21. data/db/migrate/20200914151648_create_moneytree_payment_gateways.rb +11 -0
  22. data/db/migrate/20201008161617_create_moneytree_transactions.rb +18 -0
  23. data/lib/moneytree-rails.rb +1 -0
  24. data/lib/moneytree.rb +16 -16
  25. data/lib/moneytree/account.rb +4 -34
  26. data/lib/moneytree/engine.rb +5 -0
  27. data/lib/moneytree/order.rb +15 -0
  28. data/lib/moneytree/payment_provider/base.rb +5 -2
  29. data/lib/moneytree/payment_provider/stripe.rb +80 -0
  30. data/lib/moneytree/transaction_response.rb +15 -0
  31. data/lib/moneytree/version.rb +1 -1
  32. data/lib/tasks/moneytree_tasks.rake +4 -0
  33. metadata +45 -33
  34. data/.github/workflows/ruby.yml +0 -33
  35. data/.gitignore +0 -12
  36. data/.rspec +0 -3
  37. data/.travis.yml +0 -6
  38. data/CHANGELOG.md +0 -7
  39. data/CODE_OF_CONDUCT.md +0 -74
  40. data/Gemfile +0 -15
  41. data/Gemfile.lock +0 -248
  42. data/Guardfile +0 -70
  43. data/LICENSE.txt +0 -21
  44. data/app/controllers/moneytree/oauth_controller.rb +0 -18
  45. data/bin/console +0 -14
  46. data/bin/setup +0 -8
  47. data/config.ru +0 -9
  48. data/lib/generators/moneytree/activerecord_generator.rb +0 -41
  49. data/lib/generators/moneytree/base_generator.rb +0 -13
  50. data/lib/generators/moneytree/install_generator.rb +0 -43
  51. data/lib/generators/moneytree/templates/active_record_event_model.rb.tt +0 -10
  52. data/lib/generators/moneytree/templates/active_record_migration.rb.tt +0 -62
  53. data/lib/generators/moneytree/templates/active_record_visit_model.rb.tt +0 -6
  54. data/lib/generators/moneytree/templates/base_store_initializer.rb.tt +0 -20
  55. data/lib/generators/moneytree/templates/moneytree_initializer.rb.tt +0 -15
  56. data/lib/moneytree/transaction.rb +0 -9
  57. data/moneytree.gemspec +0 -29
@@ -1,33 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: build
9
-
10
- on:
11
- push:
12
- branches: [ master ]
13
- pull_request:
14
- branches: [ master ]
15
-
16
- jobs:
17
- test:
18
-
19
- runs-on: ubuntu-latest
20
-
21
- steps:
22
- - uses: actions/checkout@v2
23
- - name: Set up Ruby
24
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
25
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
26
- # uses: ruby/setup-ruby@v1
27
- uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
28
- with:
29
- ruby-version: 2.6
30
- - name: Install dependencies
31
- run: bundle install
32
- - name: Run tests
33
- run: bundle exec rake
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
- /spec/internal/db/combustion_test.sqlite
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.0
6
- before_install: gem install bundler -v 2.1.4
@@ -1,7 +0,0 @@
1
- ## Master
2
-
3
- -
4
-
5
- ## 0.1.0 (2020-06-07)
6
-
7
- -
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at kieranklaassen@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,15 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in moneytree.gemspec
4
- gemspec
5
-
6
- # Dev dependencies
7
- gem "rails", "~> 6.0"
8
- gem "rake", "~> 12.0"
9
- gem 'rspec-rails', '~> 3.4'
10
- gem "rubocop", "~> 0.89.1"
11
- gem "combustion", "~> 1.3"
12
- gem "sqlite3", "~> 1.4"
13
- gem 'guard-rspec', require: false
14
- gem 'square.rb', '~> 6.3'
15
- gem "pry", "~> 0.13.1"
@@ -1,248 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- moneytree-rails (0.1.0)
5
- rails (>= 4.2)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actioncable (6.0.3.2)
11
- actionpack (= 6.0.3.2)
12
- nio4r (~> 2.0)
13
- websocket-driver (>= 0.6.1)
14
- actionmailbox (6.0.3.2)
15
- actionpack (= 6.0.3.2)
16
- activejob (= 6.0.3.2)
17
- activerecord (= 6.0.3.2)
18
- activestorage (= 6.0.3.2)
19
- activesupport (= 6.0.3.2)
20
- mail (>= 2.7.1)
21
- actionmailer (6.0.3.2)
22
- actionpack (= 6.0.3.2)
23
- actionview (= 6.0.3.2)
24
- activejob (= 6.0.3.2)
25
- mail (~> 2.5, >= 2.5.4)
26
- rails-dom-testing (~> 2.0)
27
- actionpack (6.0.3.2)
28
- actionview (= 6.0.3.2)
29
- activesupport (= 6.0.3.2)
30
- rack (~> 2.0, >= 2.0.8)
31
- rack-test (>= 0.6.3)
32
- rails-dom-testing (~> 2.0)
33
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
- actiontext (6.0.3.2)
35
- actionpack (= 6.0.3.2)
36
- activerecord (= 6.0.3.2)
37
- activestorage (= 6.0.3.2)
38
- activesupport (= 6.0.3.2)
39
- nokogiri (>= 1.8.5)
40
- actionview (6.0.3.2)
41
- activesupport (= 6.0.3.2)
42
- builder (~> 3.1)
43
- erubi (~> 1.4)
44
- rails-dom-testing (~> 2.0)
45
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
- activejob (6.0.3.2)
47
- activesupport (= 6.0.3.2)
48
- globalid (>= 0.3.6)
49
- activemodel (6.0.3.2)
50
- activesupport (= 6.0.3.2)
51
- activerecord (6.0.3.2)
52
- activemodel (= 6.0.3.2)
53
- activesupport (= 6.0.3.2)
54
- activestorage (6.0.3.2)
55
- actionpack (= 6.0.3.2)
56
- activejob (= 6.0.3.2)
57
- activerecord (= 6.0.3.2)
58
- marcel (~> 0.3.1)
59
- activesupport (6.0.3.2)
60
- concurrent-ruby (~> 1.0, >= 1.0.2)
61
- i18n (>= 0.7, < 2)
62
- minitest (~> 5.1)
63
- tzinfo (~> 1.1)
64
- zeitwerk (~> 2.2, >= 2.2.2)
65
- ast (2.4.1)
66
- builder (3.2.4)
67
- certifi (2018.01.18)
68
- coderay (1.1.3)
69
- combustion (1.3.0)
70
- activesupport (>= 3.0.0)
71
- railties (>= 3.0.0)
72
- thor (>= 0.14.6)
73
- concurrent-ruby (1.1.7)
74
- crass (1.0.6)
75
- diff-lcs (1.4.4)
76
- erubi (1.9.0)
77
- faraday (0.17.3)
78
- multipart-post (>= 1.2, < 3)
79
- faraday-http-cache (2.2.0)
80
- faraday (>= 0.8)
81
- faraday_middleware (0.14.0)
82
- faraday (>= 0.7.4, < 1.0)
83
- ffi (1.13.1)
84
- formatador (0.2.5)
85
- globalid (0.4.2)
86
- activesupport (>= 4.2.0)
87
- guard (2.16.2)
88
- formatador (>= 0.2.4)
89
- listen (>= 2.7, < 4.0)
90
- lumberjack (>= 1.0.12, < 2.0)
91
- nenv (~> 0.1)
92
- notiffany (~> 0.0)
93
- pry (>= 0.9.12)
94
- shellany (~> 0.0)
95
- thor (>= 0.18.1)
96
- guard-compat (1.2.1)
97
- guard-rspec (4.7.3)
98
- guard (~> 2.1)
99
- guard-compat (~> 1.1)
100
- rspec (>= 2.99.0, < 4.0)
101
- i18n (1.8.5)
102
- concurrent-ruby (~> 1.0)
103
- listen (3.2.1)
104
- rb-fsevent (~> 0.10, >= 0.10.3)
105
- rb-inotify (~> 0.9, >= 0.9.10)
106
- little-plugger (1.1.4)
107
- logging (2.3.0)
108
- little-plugger (~> 1.1)
109
- multi_json (~> 1.14)
110
- loofah (2.6.0)
111
- crass (~> 1.0.2)
112
- nokogiri (>= 1.5.9)
113
- lumberjack (1.2.7)
114
- mail (2.7.1)
115
- mini_mime (>= 0.1.1)
116
- marcel (0.3.3)
117
- mimemagic (~> 0.3.2)
118
- method_source (1.0.0)
119
- mimemagic (0.3.5)
120
- mini_mime (1.0.2)
121
- mini_portile2 (2.4.0)
122
- minitest (5.14.1)
123
- multi_json (1.15.0)
124
- multipart-post (2.1.1)
125
- nenv (0.3.0)
126
- nio4r (2.5.2)
127
- nokogiri (1.10.10)
128
- mini_portile2 (~> 2.4.0)
129
- notiffany (0.1.3)
130
- nenv (~> 0.1)
131
- shellany (~> 0.0)
132
- parallel (1.19.2)
133
- parser (2.7.1.4)
134
- ast (~> 2.4.1)
135
- pry (0.13.1)
136
- coderay (~> 1.1)
137
- method_source (~> 1.0)
138
- rack (2.2.3)
139
- rack-test (1.1.0)
140
- rack (>= 1.0, < 3)
141
- rails (6.0.3.2)
142
- actioncable (= 6.0.3.2)
143
- actionmailbox (= 6.0.3.2)
144
- actionmailer (= 6.0.3.2)
145
- actionpack (= 6.0.3.2)
146
- actiontext (= 6.0.3.2)
147
- actionview (= 6.0.3.2)
148
- activejob (= 6.0.3.2)
149
- activemodel (= 6.0.3.2)
150
- activerecord (= 6.0.3.2)
151
- activestorage (= 6.0.3.2)
152
- activesupport (= 6.0.3.2)
153
- bundler (>= 1.3.0)
154
- railties (= 6.0.3.2)
155
- sprockets-rails (>= 2.0.0)
156
- rails-dom-testing (2.0.3)
157
- activesupport (>= 4.2.0)
158
- nokogiri (>= 1.6)
159
- rails-html-sanitizer (1.3.0)
160
- loofah (~> 2.3)
161
- railties (6.0.3.2)
162
- actionpack (= 6.0.3.2)
163
- activesupport (= 6.0.3.2)
164
- method_source
165
- rake (>= 0.8.7)
166
- thor (>= 0.20.3, < 2.0)
167
- rainbow (3.0.0)
168
- rake (12.3.3)
169
- rb-fsevent (0.10.4)
170
- rb-inotify (0.10.1)
171
- ffi (~> 1.0)
172
- regexp_parser (1.7.1)
173
- rexml (3.2.4)
174
- rspec (3.9.0)
175
- rspec-core (~> 3.9.0)
176
- rspec-expectations (~> 3.9.0)
177
- rspec-mocks (~> 3.9.0)
178
- rspec-core (3.9.2)
179
- rspec-support (~> 3.9.3)
180
- rspec-expectations (3.9.2)
181
- diff-lcs (>= 1.2.0, < 2.0)
182
- rspec-support (~> 3.9.0)
183
- rspec-mocks (3.9.1)
184
- diff-lcs (>= 1.2.0, < 2.0)
185
- rspec-support (~> 3.9.0)
186
- rspec-rails (3.9.1)
187
- actionpack (>= 3.0)
188
- activesupport (>= 3.0)
189
- railties (>= 3.0)
190
- rspec-core (~> 3.9.0)
191
- rspec-expectations (~> 3.9.0)
192
- rspec-mocks (~> 3.9.0)
193
- rspec-support (~> 3.9.0)
194
- rspec-support (3.9.3)
195
- rubocop (0.89.1)
196
- parallel (~> 1.10)
197
- parser (>= 2.7.1.1)
198
- rainbow (>= 2.2.2, < 4.0)
199
- regexp_parser (>= 1.7)
200
- rexml
201
- rubocop-ast (>= 0.3.0, < 1.0)
202
- ruby-progressbar (~> 1.7)
203
- unicode-display_width (>= 1.4.0, < 2.0)
204
- rubocop-ast (0.3.0)
205
- parser (>= 2.7.1.4)
206
- ruby-progressbar (1.10.1)
207
- shellany (0.0.1)
208
- sprockets (4.0.2)
209
- concurrent-ruby (~> 1.0)
210
- rack (> 1, < 3)
211
- sprockets-rails (3.2.1)
212
- actionpack (>= 4.0)
213
- activesupport (>= 4.0)
214
- sprockets (>= 3.0.0)
215
- sqlite3 (1.4.2)
216
- square.rb (6.3.0.20200826)
217
- certifi (~> 2018.1)
218
- faraday (~> 0.15)
219
- faraday-http-cache (~> 2.0)
220
- faraday_middleware (~> 0.13)
221
- logging (~> 2.2)
222
- thor (1.0.1)
223
- thread_safe (0.3.6)
224
- tzinfo (1.2.7)
225
- thread_safe (~> 0.1)
226
- unicode-display_width (1.7.0)
227
- websocket-driver (0.7.3)
228
- websocket-extensions (>= 0.1.0)
229
- websocket-extensions (0.1.5)
230
- zeitwerk (2.4.0)
231
-
232
- PLATFORMS
233
- ruby
234
-
235
- DEPENDENCIES
236
- combustion (~> 1.3)
237
- guard-rspec
238
- moneytree-rails!
239
- pry (~> 0.13.1)
240
- rails (~> 6.0)
241
- rake (~> 12.0)
242
- rspec-rails (~> 3.4)
243
- rubocop (~> 0.89.1)
244
- sqlite3 (~> 1.4)
245
- square.rb (~> 6.3)
246
-
247
- BUNDLED WITH
248
- 2.2.0.rc.1
data/Guardfile DELETED
@@ -1,70 +0,0 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- ## Uncomment and set this to only include directories you want to watch
5
- # directories %w(app lib config test spec features) \
6
- # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
-
8
- ## Note: if you are using the `directories` clause above and you are not
9
- ## watching the project directory ('.'), then you will want to move
10
- ## the Guardfile to a watched dir and symlink it back, e.g.
11
- #
12
- # $ mkdir config
13
- # $ mv Guardfile config/
14
- # $ ln -s config/Guardfile .
15
- #
16
- # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
-
18
- # Note: The cmd option is now required due to the increasing number of ways
19
- # rspec may be run, below are examples of the most common uses.
20
- # * bundler: 'bundle exec rspec'
21
- # * bundler binstubs: 'bin/rspec'
22
- # * spring: 'bin/rspec' (This will use spring if running and you have
23
- # installed the spring binstubs per the docs)
24
- # * zeus: 'zeus rspec' (requires the server to be started separately)
25
- # * 'just' rspec: 'rspec'
26
-
27
- guard :rspec, cmd: "bundle exec rspec" do
28
- require "guard/rspec/dsl"
29
- dsl = Guard::RSpec::Dsl.new(self)
30
-
31
- # Feel free to open issues for suggestions and improvements
32
-
33
- # RSpec files
34
- rspec = dsl.rspec
35
- watch(rspec.spec_helper) { rspec.spec_dir }
36
- watch(rspec.spec_support) { rspec.spec_dir }
37
- watch(rspec.spec_files)
38
-
39
- # Ruby files
40
- ruby = dsl.ruby
41
- dsl.watch_spec_files_for(ruby.lib_files)
42
-
43
- # Rails files
44
- rails = dsl.rails(view_extensions: %w(erb haml slim))
45
- dsl.watch_spec_files_for(rails.app_files)
46
- dsl.watch_spec_files_for(rails.views)
47
-
48
- watch(rails.controllers) do |m|
49
- [
50
- rspec.spec.call("routing/#{m[1]}_routing"),
51
- rspec.spec.call("controllers/#{m[1]}_controller"),
52
- rspec.spec.call("acceptance/#{m[1]}")
53
- ]
54
- end
55
-
56
- # Rails config changes
57
- watch(rails.spec_helper) { rspec.spec_dir }
58
- watch(rails.routes) { "#{rspec.spec_dir}/routing" }
59
- watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
60
-
61
- # Capybara features specs
62
- watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
63
- watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
64
-
65
- # Turnip features and steps
66
- watch(%r{^spec/acceptance/(.+)\.feature$})
67
- watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
68
- Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
69
- end
70
- end