phcdevworks_accounts_stripe 0.1.2 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5b0930d365bee1bfa945cc16140274317d647e86107cb9911cebcafaeab0a15
4
- data.tar.gz: 48d81e6c4a75a2a0dd8c272c57c73e302c2aebc398844969f9ace7ad7ca2b087
3
+ metadata.gz: f09f1de338c64e97fad3b933365f6479845d926764c1a81ca926696b920ec99e
4
+ data.tar.gz: 7ee0e98d7a1bbb152824c33fb29f83c06d8746d3f40b8d0e89f9427a21ede63d
5
5
  SHA512:
6
- metadata.gz: af7b2a81220a73938b35231688994275ea93b16e8d7f180b39c4c3a2956488ceea85379cbabe8f4cd9cbe679348fb973475cc4b2a3df4b0767a4730d2413ef8a
7
- data.tar.gz: 77d3ce558aad76586d670631d409885a5816f40b8353794965092cc9eea03aa6bd4d85c0aa90a24cecb03328ccdc0fdff184454a94b4c6745b44900960550574
6
+ metadata.gz: 3b208b87bc489c7ba044c32cabf24b71a84e53a5c5f0090f47ab7bb500589b991dfa5c77b7a2d19bc807998390021f0541ca35cad28bf02c5782361e507c7e1d
7
+ data.tar.gz: d1ce3cfbbc12a8cb40b4ae14d6b0c4af871e33e0622dcdcb3fd741851e847600e53cd9cdf2cd03c9145e5d82a6efb07160b7f74a05934509f3c31442c11ebbe0
@@ -0,0 +1,3 @@
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the admin/invoices controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: https://sass-lang.com/
@@ -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.stripe_customer_id})
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::PlanController < ApplicationController
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.stripe_customer_id})
10
+ @user_subscription_item = Stripe::Subscription.list({customer: current_user.payments_customer_id})
11
11
 
12
12
  end
13
13
 
@@ -0,0 +1,4 @@
1
+ module PhcdevworksAccountsStripe
2
+ module Admin::InvoicesHelper
3
+ end
4
+ end
@@ -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
- <% if current_user && current_user.admin? %>
280
+ <% if current_user and current_user.admin? %>
281
+ <li class="nav-header">Administration</li>
282
+ <% if defined?phcdevworks_accounts_stripe and current_user.admin? %>
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 Auth</span>
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>
@@ -329,13 +329,13 @@
329
329
  <% end %>
330
330
 
331
331
  <li class="nav-header">Your Account</li>
332
- <% if defined?phcdevworks_accounts_stripe && current_user %>
332
+ <% if defined?phcdevworks_accounts_stripe and current_user %>
333
333
  <!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Accounts Stripe -->
334
334
  <li class="has-sub">
335
335
  <a href="javascript:;">
336
336
  <b class="caret"></b>
337
337
  <i class="fad fa-money-check-alt"></i>
338
- <span>Plan Settings</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>Accounts Settings</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
 
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksAccountsStripe
2
- VERSION = '0.1.2'
2
+ VERSION = "0.1.7"
3
3
  end
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.2
4
+ version: 0.1.7
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-04 00:00:00.000000000 Z
11
+ date: 2021-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -240,14 +240,14 @@ dependencies:
240
240
  requirements:
241
241
  - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: '3.0'
243
+ version: '3.2'
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - "~>"
249
249
  - !ruby/object:Gem::Version
250
- version: '3.0'
250
+ version: '3.2'
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: factory_bot_rails
253
253
  requirement: !ruby/object:Gem::Requirement
@@ -329,7 +329,9 @@ files:
329
329
  - README.md
330
330
  - Rakefile
331
331
  - app/assets/config/phcdevworks_accounts_stripe_manifest.js
332
+ - app/assets/javascripts/phcdevworks_accounts_stripe/admin/invoices.coffee
332
333
  - app/assets/stylesheets/phcdevworks_accounts_stripe/admin/customers.css
334
+ - app/assets/stylesheets/phcdevworks_accounts_stripe/admin/invoices.scss
333
335
  - app/assets/stylesheets/phcdevworks_accounts_stripe/admin/plans.css
334
336
  - app/assets/stylesheets/phcdevworks_accounts_stripe/admin/subscriptions.css
335
337
  - app/assets/stylesheets/phcdevworks_accounts_stripe/application.css
@@ -337,6 +339,7 @@ files:
337
339
  - app/assets/stylesheets/phcdevworks_accounts_stripe/user/plan.css
338
340
  - app/assets/stylesheets/phcdevworks_accounts_stripe/user/subscription.css
339
341
  - app/controllers/phcdevworks_accounts_stripe/admin/customers_controller.rb
342
+ - app/controllers/phcdevworks_accounts_stripe/admin/invoices_controller.rb
340
343
  - app/controllers/phcdevworks_accounts_stripe/admin/products_controller.rb
341
344
  - app/controllers/phcdevworks_accounts_stripe/admin/subscriptions_controller.rb
342
345
  - app/controllers/phcdevworks_accounts_stripe/application_controller.rb
@@ -344,6 +347,7 @@ files:
344
347
  - app/controllers/phcdevworks_accounts_stripe/user/product_controller.rb
345
348
  - app/controllers/phcdevworks_accounts_stripe/user/subscription_controller.rb
346
349
  - app/helpers/phcdevworks_accounts_stripe/admin/customers_helper.rb
350
+ - app/helpers/phcdevworks_accounts_stripe/admin/invoices_helper.rb
347
351
  - app/helpers/phcdevworks_accounts_stripe/admin/plans_helper.rb
348
352
  - app/helpers/phcdevworks_accounts_stripe/admin/subscriptions_helper.rb
349
353
  - app/helpers/phcdevworks_accounts_stripe/application_helper.rb
@@ -358,6 +362,7 @@ files:
358
362
  - app/views/layouts/phcdevworks_accounts_stripe/components/backend/navigation/_top_menu.html.erb
359
363
  - app/views/layouts/phcdevworks_accounts_stripe/components/backend/sidebars/_side_menu.html.erb
360
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
361
366
  - app/views/phcdevworks_accounts_stripe/admin/products/admin_products_list.html.erb
362
367
  - app/views/phcdevworks_accounts_stripe/admin/subscriptions/admin_subscription_list.html.erb
363
368
  - app/views/phcdevworks_accounts_stripe/user/invoices/user_invoice_item.html.erb