phcdevworks_accounts_stripe 0.1.1 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/phcdevworks_accounts_stripe/admin/invoices.coffee +3 -0
- data/app/assets/stylesheets/phcdevworks_accounts_stripe/admin/invoices.scss +3 -0
- data/app/controllers/phcdevworks_accounts_stripe/admin/invoices_controller.rb +17 -0
- data/app/controllers/phcdevworks_accounts_stripe/user/invoices_controller.rb +1 -1
- data/app/controllers/phcdevworks_accounts_stripe/user/product_controller.rb +1 -1
- data/app/controllers/phcdevworks_accounts_stripe/user/subscription_controller.rb +1 -1
- data/app/helpers/phcdevworks_accounts_stripe/admin/invoices_helper.rb +4 -0
- data/app/views/layouts/phcdevworks_accounts_stripe/components/backend/sidebars/_side_menu.html.erb +41 -41
- data/app/views/phcdevworks_accounts_stripe/admin/invoices/admin_invoice_list.html.erb +89 -0
- data/config/routes.rb +1 -0
- data/lib/phcdevworks_accounts_stripe/version.rb +1 -1
- metadata +9 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82d2d39bb0348290ee38b13dc52ccd9d7f04b60036221c9fd0aa2e5e103f6bfd
|
4
|
+
data.tar.gz: 80e34a15c18d1e803600fb217334da814b684bf14b63b58a8dfeec76ff6cbc24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f04a57394cbb17bb44310e2601ac01ca3b02e99cefee26ececd5f345f857f4ebe27f2b2813edf9af9926119d9124d8ba394ff0d19eca028e2745313986d69cd4
|
7
|
+
data.tar.gz: 36908e9861afa97086eff3902b1ec0f58b7ff1c84dbeca9da58898c244e427e8867edda756786e567bddd7a228b7aea6b413590517177040d7736e8b1ee7c8f5
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require_dependency "phcdevworks_accounts_stripe/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksAccountsStripe
|
4
|
+
class Admin::InvoicesController < ApplicationController
|
5
|
+
|
6
|
+
# Filters
|
7
|
+
before_action :authenticate_user!
|
8
|
+
include PhcdevworksCore::PhcdevworksPluginsHelper
|
9
|
+
before_action :phcdevworks_accounts_admin_only
|
10
|
+
|
11
|
+
# Customers - List
|
12
|
+
def admin_invoice_list
|
13
|
+
@admin_invoice_list = Stripe::Invoice.list({limit: 100})
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -7,7 +7,7 @@ module PhcdevworksAccountsStripe
|
|
7
7
|
before_action :authenticate_user!
|
8
8
|
|
9
9
|
def user_invoice_list
|
10
|
-
@user_invoice_list = Stripe::Invoice.list({customer: current_user.
|
10
|
+
@user_invoice_list = Stripe::Invoice.list({customer: current_user.payments_customer_id})
|
11
11
|
end
|
12
12
|
|
13
13
|
def user_invoice_item
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_dependency "phcdevworks_accounts_stripe/application_controller"
|
2
2
|
|
3
3
|
module PhcdevworksAccountsStripe
|
4
|
-
class User::
|
4
|
+
class User::ProductController < ApplicationController
|
5
5
|
|
6
6
|
# Security Filters
|
7
7
|
before_action :authenticate_user!
|
@@ -7,7 +7,7 @@ module PhcdevworksAccountsStripe
|
|
7
7
|
before_action :authenticate_user!
|
8
8
|
|
9
9
|
def user_subscription_item
|
10
|
-
@user_subscription_item = Stripe::Subscription.list({customer: current_user.
|
10
|
+
@user_subscription_item = Stripe::Subscription.list({customer: current_user.payments_customer_id})
|
11
11
|
|
12
12
|
end
|
13
13
|
|
data/app/views/layouts/phcdevworks_accounts_stripe/components/backend/sidebars/_side_menu.html.erb
CHANGED
@@ -277,49 +277,49 @@
|
|
277
277
|
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Core Modules -->
|
278
278
|
<% end %>
|
279
279
|
|
280
|
-
<li class="nav-header">Administration</li>
|
281
|
-
<% if defined?phcdevworks_accounts_stripe && current_user && current_user.admin %>
|
282
|
-
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Accounts Stripe -->
|
283
|
-
<li class="has-sub">
|
284
|
-
<a href="javascript:;">
|
285
|
-
<b class="caret"></b>
|
286
|
-
<i class="fab fa-cc-stripe"></i>
|
287
|
-
<span>Subscriptions</span>
|
288
|
-
</a>
|
289
|
-
<ul class="sub-menu">
|
290
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/subscriptions#admin_subscription_list") %>"><%= link_to("Subscription Index", phcdevworks_accounts_stripe.admin_subscriptions_path) %></li>
|
291
|
-
</ul>
|
292
|
-
</li>
|
293
|
-
<li class="has-sub">
|
294
|
-
<a href="javascript:;">
|
295
|
-
<b class="caret"></b>
|
296
|
-
<i class="fad fa-money-check-alt"></i>
|
297
|
-
<span>Plans</span>
|
298
|
-
</a>
|
299
|
-
<ul class="sub-menu">
|
300
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/products#admin_products_list") %>"><%= link_to("Product List", phcdevworks_accounts_stripe.admin_products_path) %></li>
|
301
|
-
</ul>
|
302
|
-
</li>
|
303
|
-
<li class="has-sub">
|
304
|
-
<a href="javascript:;">
|
305
|
-
<b class="caret"></b>
|
306
|
-
<i class="fad fa-users"></i>
|
307
|
-
<span>Customers</span>
|
308
|
-
</a>
|
309
|
-
<ul class="sub-menu">
|
310
|
-
<li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/customers#admin_customer_list") %>"><%= link_to("Customer List", phcdevworks_accounts_stripe.admin_customers_path) %></li>
|
311
|
-
</ul>
|
312
|
-
</li>
|
313
|
-
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Accounts Stripe -->
|
314
|
-
<% end %>
|
315
|
-
|
316
280
|
<% if current_user && current_user.admin? %>
|
281
|
+
<li class="nav-header">Administration</li>
|
282
|
+
<% if defined?phcdevworks_accounts_stripe %>
|
283
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Accounts Stripe -->
|
284
|
+
<li class="has-sub">
|
285
|
+
<a href="javascript:;">
|
286
|
+
<b class="caret"></b>
|
287
|
+
<i class="fab fa-cc-visa"></i>
|
288
|
+
<span>Accounting</span>
|
289
|
+
</a>
|
290
|
+
<ul class="sub-menu">
|
291
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/subscriptions#admin_subscription_list") %>"><%= link_to("Invoices", phcdevworks_accounts_stripe.admin_invoices_path) %></li>
|
292
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/subscriptions#admin_subscription_list") %>"><%= link_to("Subscriptions", phcdevworks_accounts_stripe.admin_subscriptions_path) %></li>
|
293
|
+
</ul>
|
294
|
+
</li>
|
295
|
+
<li class="has-sub">
|
296
|
+
<a href="javascript:;">
|
297
|
+
<b class="caret"></b>
|
298
|
+
<i class="fad fa-money-check-alt"></i>
|
299
|
+
<span>Services</span>
|
300
|
+
</a>
|
301
|
+
<ul class="sub-menu">
|
302
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/products#admin_products_list") %>"><%= link_to("Product List", phcdevworks_accounts_stripe.admin_products_path) %></li>
|
303
|
+
</ul>
|
304
|
+
</li>
|
305
|
+
<li class="has-sub">
|
306
|
+
<a href="javascript:;">
|
307
|
+
<b class="caret"></b>
|
308
|
+
<i class="fad fa-users"></i>
|
309
|
+
<span>Customers</span>
|
310
|
+
</a>
|
311
|
+
<ul class="sub-menu">
|
312
|
+
<li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/customers#admin_customer_list") %>"><%= link_to("Customer List", phcdevworks_accounts_stripe.admin_customers_path) %></li>
|
313
|
+
</ul>
|
314
|
+
</li>
|
315
|
+
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Accounts Stripe -->
|
316
|
+
<% end %>
|
317
317
|
<!-- -PHC- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
|
318
318
|
<li class="has-sub">
|
319
319
|
<a href="javascript:;">
|
320
320
|
<b class="caret"></b>
|
321
|
-
<i class="fad fa-user"></i>
|
322
|
-
<span>User
|
321
|
+
<i class="fad fa-user-lock"></i>
|
322
|
+
<span>User Logins</span>
|
323
323
|
</a>
|
324
324
|
<ul class="sub-menu">
|
325
325
|
<li class="<%= phc_menu_active_controller("phcdevworks_accounts/admin/users") %>"><%= link_to "User List", phcdevworks_accounts.admin_users_all_path %></li>
|
@@ -335,7 +335,7 @@
|
|
335
335
|
<a href="javascript:;">
|
336
336
|
<b class="caret"></b>
|
337
337
|
<i class="fad fa-money-check-alt"></i>
|
338
|
-
<span>
|
338
|
+
<span>Your Subscription</span>
|
339
339
|
</a>
|
340
340
|
<ul class="sub-menu">
|
341
341
|
<li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/admin/subscriptions#admin_subscription_list") %>"><%= link_to("Your Subscription", phcdevworks_accounts_stripe.user_subscription_path) %></li>
|
@@ -346,7 +346,7 @@
|
|
346
346
|
<a href="javascript:;">
|
347
347
|
<b class="caret"></b>
|
348
348
|
<i class="fad fa-file-invoice"></i>
|
349
|
-
<span>Invoices</span>
|
349
|
+
<span>Your Invoices</span>
|
350
350
|
</a>
|
351
351
|
<ul class="sub-menu">
|
352
352
|
<li class="<%= phc_menu_active_controller("phcdevworks_accounts_stripe/user/invoices#admin_customer_list") %>"><%= link_to("Current Invoice", phcdevworks_accounts_stripe.user_invoices_path) %></li>
|
@@ -362,7 +362,7 @@
|
|
362
362
|
<a href="javascript:;">
|
363
363
|
<b class="caret"></b>
|
364
364
|
<i class="fad fa-user"></i>
|
365
|
-
<span>
|
365
|
+
<span>Login Settings</span>
|
366
366
|
</a>
|
367
367
|
<ul class="sub-menu">
|
368
368
|
<li class="<%= phc_menu_active_controller("phcdevworks_accounts/user/edit") %>"><%= link_to "Settings", phcdevworks_accounts.edit_user_registration_path %></li>
|
@@ -0,0 +1,89 @@
|
|
1
|
+
<!-- PHCTitleSEO Title Variables -->
|
2
|
+
<% phc_title "Invoice Manager" %>
|
3
|
+
<% phc_title_tagline "Stripe Invoice List" %>
|
4
|
+
<% phc_breadcrumb_one "Home" %>
|
5
|
+
<% phc_breadcrumb_two yield(:phc_title_tagline) %>
|
6
|
+
<!-- PHCTitleSEO Title Variables -->
|
7
|
+
|
8
|
+
<!-- Page Bradcrumbs -->
|
9
|
+
<ol class="breadcrumb pull-right">
|
10
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
11
|
+
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
|
12
|
+
</ol>
|
13
|
+
<!-- Page Bradcrumbs -->
|
14
|
+
|
15
|
+
<!-- Page Header -->
|
16
|
+
<h2 class="page-header"><%= yield(:phc_title) %></h2>
|
17
|
+
<!-- Page Header -->
|
18
|
+
|
19
|
+
<!-- Page Content -->
|
20
|
+
<div class="row">
|
21
|
+
<div class="col-lg-12">
|
22
|
+
|
23
|
+
<!-- Panel -->
|
24
|
+
<div class="panel panel-inverse">
|
25
|
+
|
26
|
+
<!-- Panel - Heading -->
|
27
|
+
<div class="panel-heading">
|
28
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
29
|
+
</div>
|
30
|
+
<!-- Panel - Heading -->
|
31
|
+
|
32
|
+
<!-- Panel - Body -->
|
33
|
+
<div class="panel-body">
|
34
|
+
|
35
|
+
<!-- Index - Table -->
|
36
|
+
<div class="table-responsive">
|
37
|
+
<table class="table table-striped table-bordered">
|
38
|
+
|
39
|
+
<thead>
|
40
|
+
<tr>
|
41
|
+
<th>Status</th>
|
42
|
+
<th>Account Name</th>
|
43
|
+
<th>Invoice Amount</th>
|
44
|
+
<th>Invoice Paid</th>
|
45
|
+
<th>Invoice Due</th>
|
46
|
+
<th>Due Date</th>
|
47
|
+
<th>Invoice PDF Download</th>
|
48
|
+
<th>Invoice Link</th>
|
49
|
+
</tr>
|
50
|
+
</thead>
|
51
|
+
|
52
|
+
<tbody>
|
53
|
+
<% @admin_invoice_list.each do |admin_invoice| %>
|
54
|
+
<tr>
|
55
|
+
<td><%= admin_invoice.status.capitalize %></td>
|
56
|
+
<td><%= admin_invoice.account_name %></td>
|
57
|
+
<td><%= number_to_currency(admin_invoice.amount_due/100) %></td>
|
58
|
+
<td><%= number_to_currency(admin_invoice.amount_paid/100) %></td>
|
59
|
+
<td><%= number_to_currency(admin_invoice.amount_remaining/100) %></td>
|
60
|
+
<td><%= Time.at(admin_invoice.due_date).to_datetime.strftime("%B %d, %Y") %></td>
|
61
|
+
<td>
|
62
|
+
<i class="fad fa-external-link"></i>
|
63
|
+
<%= link_to admin_invoice.invoice_pdf, target: "_blank" do %>
|
64
|
+
Invoice #: <%= admin_invoice.number %>
|
65
|
+
<% end %>
|
66
|
+
</td>
|
67
|
+
<td>
|
68
|
+
<i class="fad fa-external-link"></i>
|
69
|
+
<%= link_to admin_invoice.hosted_invoice_url, target: "_blank" do %>
|
70
|
+
Invoice #: <%= admin_invoice.number %>
|
71
|
+
<% end %>
|
72
|
+
</td>
|
73
|
+
</tr>
|
74
|
+
<% end %>
|
75
|
+
</tbody>
|
76
|
+
|
77
|
+
</table>
|
78
|
+
</div>
|
79
|
+
<!-- Index - Table -->
|
80
|
+
|
81
|
+
</div>
|
82
|
+
<!-- Panel - Body -->
|
83
|
+
|
84
|
+
</div>
|
85
|
+
<!-- Panel -->
|
86
|
+
|
87
|
+
</div>
|
88
|
+
</div>
|
89
|
+
<!-- Page Content -->
|
data/config/routes.rb
CHANGED
@@ -7,6 +7,7 @@ PhcdevworksAccountsStripe::Engine.routes.draw do
|
|
7
7
|
|
8
8
|
# Admin Routes
|
9
9
|
match "/admin/customers", to: "admin/customers#admin_customer_list", via: "get"
|
10
|
+
match "/admin/invoices", to: "admin/invoices#admin_invoice_list", via: "get"
|
10
11
|
match "/admin/products", to: "admin/products#admin_products_list", via: "get"
|
11
12
|
match "/admin/subscriptions", to: "admin/subscriptions#admin_subscription_list", via: "get"
|
12
13
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcdevworks_accounts_stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PHCDevworks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -136,20 +136,6 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '3.2'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: phcdevworks_core_modules
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '7.1'
|
146
|
-
type: :runtime
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '7.1'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: wicked
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,14 +240,14 @@ dependencies:
|
|
254
240
|
requirements:
|
255
241
|
- - "~>"
|
256
242
|
- !ruby/object:Gem::Version
|
257
|
-
version: '3.
|
243
|
+
version: '3.2'
|
258
244
|
type: :runtime
|
259
245
|
prerelease: false
|
260
246
|
version_requirements: !ruby/object:Gem::Requirement
|
261
247
|
requirements:
|
262
248
|
- - "~>"
|
263
249
|
- !ruby/object:Gem::Version
|
264
|
-
version: '3.
|
250
|
+
version: '3.2'
|
265
251
|
- !ruby/object:Gem::Dependency
|
266
252
|
name: factory_bot_rails
|
267
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -343,7 +329,9 @@ files:
|
|
343
329
|
- README.md
|
344
330
|
- Rakefile
|
345
331
|
- app/assets/config/phcdevworks_accounts_stripe_manifest.js
|
332
|
+
- app/assets/javascripts/phcdevworks_accounts_stripe/admin/invoices.coffee
|
346
333
|
- app/assets/stylesheets/phcdevworks_accounts_stripe/admin/customers.css
|
334
|
+
- app/assets/stylesheets/phcdevworks_accounts_stripe/admin/invoices.scss
|
347
335
|
- app/assets/stylesheets/phcdevworks_accounts_stripe/admin/plans.css
|
348
336
|
- app/assets/stylesheets/phcdevworks_accounts_stripe/admin/subscriptions.css
|
349
337
|
- app/assets/stylesheets/phcdevworks_accounts_stripe/application.css
|
@@ -351,6 +339,7 @@ files:
|
|
351
339
|
- app/assets/stylesheets/phcdevworks_accounts_stripe/user/plan.css
|
352
340
|
- app/assets/stylesheets/phcdevworks_accounts_stripe/user/subscription.css
|
353
341
|
- app/controllers/phcdevworks_accounts_stripe/admin/customers_controller.rb
|
342
|
+
- app/controllers/phcdevworks_accounts_stripe/admin/invoices_controller.rb
|
354
343
|
- app/controllers/phcdevworks_accounts_stripe/admin/products_controller.rb
|
355
344
|
- app/controllers/phcdevworks_accounts_stripe/admin/subscriptions_controller.rb
|
356
345
|
- app/controllers/phcdevworks_accounts_stripe/application_controller.rb
|
@@ -358,6 +347,7 @@ files:
|
|
358
347
|
- app/controllers/phcdevworks_accounts_stripe/user/product_controller.rb
|
359
348
|
- app/controllers/phcdevworks_accounts_stripe/user/subscription_controller.rb
|
360
349
|
- app/helpers/phcdevworks_accounts_stripe/admin/customers_helper.rb
|
350
|
+
- app/helpers/phcdevworks_accounts_stripe/admin/invoices_helper.rb
|
361
351
|
- app/helpers/phcdevworks_accounts_stripe/admin/plans_helper.rb
|
362
352
|
- app/helpers/phcdevworks_accounts_stripe/admin/subscriptions_helper.rb
|
363
353
|
- app/helpers/phcdevworks_accounts_stripe/application_helper.rb
|
@@ -372,6 +362,7 @@ files:
|
|
372
362
|
- app/views/layouts/phcdevworks_accounts_stripe/components/backend/navigation/_top_menu.html.erb
|
373
363
|
- app/views/layouts/phcdevworks_accounts_stripe/components/backend/sidebars/_side_menu.html.erb
|
374
364
|
- app/views/phcdevworks_accounts_stripe/admin/customers/admin_customer_list.html.erb
|
365
|
+
- app/views/phcdevworks_accounts_stripe/admin/invoices/admin_invoice_list.html.erb
|
375
366
|
- app/views/phcdevworks_accounts_stripe/admin/products/admin_products_list.html.erb
|
376
367
|
- app/views/phcdevworks_accounts_stripe/admin/subscriptions/admin_subscription_list.html.erb
|
377
368
|
- app/views/phcdevworks_accounts_stripe/user/invoices/user_invoice_item.html.erb
|