billing 0.0.0 → 0.0.3

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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/billing/accounts.js +2 -0
  3. data/app/assets/javascripts/billing/charges.js +2 -0
  4. data/app/assets/javascripts/billing/modifiers.js +2 -0
  5. data/app/assets/javascripts/billing/payments.js +2 -0
  6. data/app/assets/stylesheets/billing/accounts.css +4 -0
  7. data/app/assets/stylesheets/billing/charges.css +4 -0
  8. data/app/assets/stylesheets/billing/modifiers.css +4 -0
  9. data/app/assets/stylesheets/billing/payments.css +4 -0
  10. data/app/controllers/billing/accounts_controller.rb +29 -0
  11. data/app/controllers/billing/application_controller.rb +18 -0
  12. data/app/controllers/billing/charges_controller.rb +29 -0
  13. data/app/controllers/billing/modifiers_controller.rb +29 -0
  14. data/app/controllers/billing/payments_controller.rb +29 -0
  15. data/app/helpers/billing/accounts_helper.rb +4 -0
  16. data/app/helpers/billing/charges_helper.rb +4 -0
  17. data/app/helpers/billing/modifiers_helper.rb +4 -0
  18. data/app/helpers/billing/payments_helper.rb +4 -0
  19. data/app/models/billing/account.rb +66 -0
  20. data/app/models/billing/account_item.rb +15 -0
  21. data/app/models/billing/charge.rb +21 -0
  22. data/app/models/billing/modifier.rb +32 -0
  23. data/app/models/billing/modifier_items.rb +11 -0
  24. data/app/models/billing/origin.rb +4 -0
  25. data/app/models/billing/payment.rb +39 -0
  26. data/app/models/billing/payment_type.rb +6 -0
  27. data/app/models/billing/payment_with_type.rb +14 -0
  28. data/app/models/billing/plu.rb +4 -0
  29. data/app/models/billing/profile.rb +4 -0
  30. data/app/models/billing/tax_group.rb +4 -0
  31. data/app/views/billing/accounts/index.html.erb +7 -0
  32. data/app/views/billing/accounts/new.html.erb +8 -0
  33. data/app/views/billing/accounts/show.html.erb +29 -0
  34. data/app/views/billing/application/index.html.erb +3 -0
  35. data/app/views/billing/charges/new.html.erb +12 -0
  36. data/app/views/billing/modifiers/new.html.erb +18 -0
  37. data/app/views/billing/payments/new.html.erb +11 -0
  38. data/config/routes.rb +6 -0
  39. data/db/migrate/20140717180443_create_billing_accounts.rb +9 -0
  40. data/db/migrate/20140717181134_create_billing_charges.rb +11 -0
  41. data/db/migrate/20140717181406_create_billing_discounts.rb +11 -0
  42. data/db/migrate/20140717183129_create_billing_payments.rb +10 -0
  43. data/db/migrate/20140717202527_create_billing_origins.rb +9 -0
  44. data/db/migrate/20140718164841_add_sumaries_to_billing_account.rb +11 -0
  45. data/db/migrate/20140718210349_add_fixed_value_to_billing_discount.rb +7 -0
  46. data/db/migrate/20140718212116_create_billing_payment_types.rb +11 -0
  47. data/db/migrate/20140719094023_create_billing_tax_groups.rb +9 -0
  48. data/db/migrate/20140719094033_create_billing_plus.rb +9 -0
  49. data/db/migrate/20140719094418_create_billing_profiles.rb +9 -0
  50. data/db/migrate/20140719103621_rename_billing_discounts_to_modifiers.rb +5 -0
  51. data/db/migrate/20140719110412_add_surcharges_sum_to_billing_account.rb +7 -0
  52. data/db/migrate/20140720110811_add_type_to_billing_payment.rb +6 -0
  53. data/db/migrate/20140720132559_add_type_to_billing_payment_type.rb +5 -0
  54. data/lib/billing.rb +16 -0
  55. data/lib/billing/billable.rb +34 -0
  56. data/lib/billing/engine.rb +1 -0
  57. data/lib/billing/mapping.rb +32 -0
  58. data/lib/billing/routes.rb +16 -0
  59. data/lib/billing/version.rb +1 -1
  60. data/lib/tasks/billing.rake +7 -0
  61. data/test/controllers/billing/accounts_controller_test.rb +19 -0
  62. data/test/controllers/billing/charges_controller_test.rb +16 -0
  63. data/test/controllers/billing/modifiers_controller_test.rb +16 -0
  64. data/test/controllers/billing/payments_controller_test.rb +16 -0
  65. data/test/dummy/app/models/profile.rb +3 -0
  66. data/test/dummy/config/routes.rb +3 -2
  67. data/test/dummy/db/development.sqlite3 +0 -0
  68. data/test/dummy/db/migrate/20140718104656_create_profiles.rb +8 -0
  69. data/test/dummy/db/schema.rb +112 -0
  70. data/test/dummy/db/test.sqlite3 +0 -0
  71. data/test/dummy/log/development.log +1602 -0
  72. data/test/dummy/log/test.log +52069 -0
  73. data/test/dummy/test/fixtures/profiles.yml +11 -0
  74. data/test/dummy/test/models/profile_test.rb +7 -0
  75. data/test/dummy/tmp/cache/assets/test/sprockets/02adf8ace512aefc4ef19b35aebc07f7 +0 -0
  76. data/test/dummy/tmp/cache/assets/test/sprockets/0cab887466527f5353fd43adab72769b +0 -0
  77. data/test/dummy/tmp/cache/assets/test/sprockets/25b7c6efcbd128f109577104af58d084 +0 -0
  78. data/test/dummy/tmp/cache/assets/test/sprockets/2f52090f9e08ac02cd453b04af0df887 +0 -0
  79. data/test/dummy/tmp/cache/assets/test/sprockets/35a523ac3c33d6409a69faead4b2a882 +0 -0
  80. data/test/dummy/tmp/cache/assets/test/sprockets/3f4fc67be1dd91962f5a0026848dca77 +0 -0
  81. data/test/dummy/tmp/cache/assets/test/sprockets/43b3cc0ac6f63c0e1a3ab61fec84519d +0 -0
  82. data/test/dummy/tmp/cache/assets/test/sprockets/59435066fc40e1ef5b45b0fd2c0eacf9 +0 -0
  83. data/test/dummy/tmp/cache/assets/test/sprockets/69cb965e6031d8099c185256f6fa8f90 +0 -0
  84. data/test/dummy/tmp/cache/assets/test/sprockets/6d34e4addaf3495d1d96306d164feb97 +0 -0
  85. data/test/dummy/tmp/cache/assets/test/sprockets/79316f9f3f5ebcec9b368d92d2e97e23 +0 -0
  86. data/test/dummy/tmp/cache/assets/test/sprockets/7ffc7e805e3fc08bae6a93e027a3e911 +0 -0
  87. data/test/dummy/tmp/cache/assets/test/sprockets/82ae0f4fbceb673c729b9bcb54a1161c +0 -0
  88. data/test/dummy/tmp/cache/assets/test/sprockets/9509747efe602f6a81d50d9744f385f2 +0 -0
  89. data/test/dummy/tmp/cache/assets/test/sprockets/971b6b8d6c7a57e72d235e55537a2c44 +0 -0
  90. data/test/dummy/tmp/cache/assets/test/sprockets/b68d1e1a967e74abe3e10f643756ae67 +0 -0
  91. data/test/dummy/tmp/cache/assets/test/sprockets/cab3eca4515d1263ea8db2ff58df151d +0 -0
  92. data/test/dummy/tmp/cache/assets/test/sprockets/cac68bb014ecc482b8f85312e49baa6f +0 -0
  93. data/test/dummy/tmp/cache/assets/test/sprockets/d3ab844c61f1c211ed5fad5407cd18ef +0 -0
  94. data/test/dummy/tmp/cache/assets/test/sprockets/d6d844128e4910cf773d1c48dd147e3b +0 -0
  95. data/test/dummy/tmp/cache/assets/test/sprockets/e62907e54633a2adb53c33c1f59b79bf +0 -0
  96. data/test/dummy/tmp/cache/assets/test/sprockets/e96b4e8fe0ebcceb51d202c8af7826ea +0 -0
  97. data/test/dummy/tmp/cache/assets/test/sprockets/eb95e26896c1c6788657c4ef68a7e9e1 +0 -0
  98. data/test/dummy/tmp/cache/assets/test/sprockets/efaa0abeb4ad44b0ef8df996631f3997 +0 -0
  99. data/test/dummy/tmp/cache/assets/test/sprockets/f393277b28dd79320611f18a379dbea7 +0 -0
  100. data/test/dummy/tmp/cache/assets/test/sprockets/fbf1489a0c3d66a329f070c10cd77a03 +0 -0
  101. data/test/fixtures/billing/accounts.yml +11 -0
  102. data/test/fixtures/billing/charges.yml +15 -0
  103. data/test/fixtures/billing/modifiers.yml +14 -0
  104. data/test/fixtures/billing/origins.yml +7 -0
  105. data/test/fixtures/billing/payment_types.yml +11 -0
  106. data/test/fixtures/billing/payments.yml +15 -0
  107. data/test/fixtures/billing/plus.yml +7 -0
  108. data/test/fixtures/billing/profiles.yml +7 -0
  109. data/test/fixtures/billing/tax_groups.yml +7 -0
  110. data/test/fixtures/profiles.yml +1 -0
  111. data/test/helpers/billing/accounts_helper_test.rb +6 -0
  112. data/test/helpers/billing/charges_helper_test.rb +6 -0
  113. data/test/helpers/billing/modifiers_helper_test.rb +6 -0
  114. data/test/helpers/billing/payments_helper_test.rb +6 -0
  115. data/test/models/billing/account_test.rb +43 -0
  116. data/test/models/billing/charge_test.rb +17 -0
  117. data/test/models/billing/modifier_test.rb +19 -0
  118. data/test/models/billing/origin_test.rb +9 -0
  119. data/test/models/billing/payment_test.rb +17 -0
  120. data/test/models/billing/payment_type_test.rb +9 -0
  121. data/test/models/billing/plu_test.rb +9 -0
  122. data/test/models/billing/profile_test.rb +9 -0
  123. data/test/models/billing/tax_group_test.rb +9 -0
  124. data/test/test_helper.rb +28 -2
  125. metadata +199 -7
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one: {}
8
+ # column: value
9
+ #
10
+ two: {}
11
+ # column: value
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class ProfileTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one:
8
+ billable: one(Profile)
9
+
10
+ two:
11
+ billable: one(Profile)
@@ -0,0 +1,15 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one:
8
+ account: one
9
+ price_cents: 100
10
+ price_currency: USD
11
+
12
+ two:
13
+ account: one
14
+ price_cents: 200
15
+ price_currency: USD
@@ -0,0 +1,14 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one:
8
+ account: one
9
+ percent_ratio: 1.0
10
+
11
+ two:
12
+ account: one
13
+ fixed_value_cents: 100
14
+ fixed_value_currency: 'USD'
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+ cash: false
6
+ fiscal: false
7
+
8
+ two:
9
+ name: MyString
10
+ cash: false
11
+ fiscal: false
@@ -0,0 +1,15 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one:
8
+ account: one
9
+ value_cents: 100
10
+ value_currency: USD
11
+
12
+ two:
13
+ account: one
14
+ value_cents: 200
15
+ value_currency: USD
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1 @@
1
+ one: {}
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class AccountsHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class ChargesHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class ModifiersHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class PaymentsHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,43 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class AccountTest < ActiveSupport::TestCase
5
+ setup do
6
+ @account = billing_accounts(:one)
7
+ @account.save! # force summary calculation
8
+ end
9
+
10
+ test "charge" do
11
+ charge = @account.charge 3
12
+ assert charge.persisted?
13
+ assert_equal '13 USD'.to_money, @account.total # (1 + 3) + 100% + $1
14
+ end
15
+
16
+ test "discount" do
17
+ discount = @account.modify(-1.00)
18
+ assert discount.persisted?
19
+ assert_equal '6 USD'.to_money, @account.total
20
+ end
21
+
22
+ test "surcharge" do
23
+ surcharge = @account.modify(1.00)
24
+ assert surcharge.persisted?
25
+ assert_equal '8 USD'.to_money, @account.total
26
+ end
27
+
28
+ test "pay" do
29
+ payment = @account.pay billing_payment_types(:one)
30
+ assert @account.balance.zero?, @account.errors.full_messages.join(', ')
31
+ assert_equal '7 USD'.to_money, @account.payments_sum
32
+ end
33
+
34
+ test "validate positive total" do
35
+ assert @account.save
36
+ @account.modify(-500)
37
+ assert @account.errors[:total]
38
+ assert_raise ActiveRecord::RecordInvalid do
39
+ @account.save!
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class ChargeTest < ActiveSupport::TestCase
5
+ setup do
6
+ @charge = billing_charges(:one)
7
+ end
8
+
9
+ test "args_to_attributes class method" do
10
+ assert_equal Billing::Charge.args(1), { price: '1 USD'.to_money }
11
+ assert_equal Billing::Charge.args("1"), { price: '1 USD'.to_money }
12
+ assert_equal Billing::Charge.args("1 EUR"), { price: '1 EUR'.to_money }
13
+ assert_equal Billing::Charge.args(1, price_currency: 'USD'), { price: '1 USD'.to_money, price_currency: 'USD' }
14
+ assert_equal Billing::Charge.args(price: 10, price_currency: 'EUR'), { price: 10, price_currency: 'EUR' }
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class ModifierTest < ActiveSupport::TestCase
5
+ setup do
6
+ @modifier = billing_modifiers(:one)
7
+ end
8
+
9
+ # test "args_to_attributes class method" do
10
+ # assert_equal Billing::Modifier.args_to_attributes("1%"), { percent: 1 }
11
+ # assert_equal Billing::Modifier.args_to_attributes("22.1 %"), { percent: 22.1 }
12
+ # assert_equal Billing::Modifier.args_to_attributes(1.456), { fixed_value: '1.46 USD'.to_money }
13
+ # assert_equal Billing::Modifier.args_to_attributes("1.4"), { fixed_value: '1.4 USD'.to_money }
14
+ # assert_equal Billing::Modifier.args_to_attributes("1.4EUR"), { fixed_value: '1.4 EUR'.to_money }
15
+ # assert_equal Billing::Modifier.args_to_attributes(1, percent_ration: 0.01 ), { fixed_value: '1 USD'.to_money, percent: 0.01 }
16
+ # assert_equal Billing::Modifier.args_to_attributes(percent_ration: 0.01), { percent_ratio: 0.01 }
17
+ # end
18
+ end
19
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class OriginTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class PaymentTest < ActiveSupport::TestCase
5
+ setup do
6
+ @payment = billing_payments(:one)
7
+ end
8
+
9
+ # test "args_to_attributes class method" do
10
+ # payment_type = billing_payment_type(:one)
11
+ # assert_equal Billing::Payment.args_to_attributes(), {}
12
+ # assert_equal Billing::Payment.args_to_attributes(payment_type.id), { payment_type_id: payment_type.id }
13
+ # assert_equal Billing::Payment.args_to_attributes(billing_payment_type(:one)), { payment_type_id: payment_type.id }
14
+ # assert_equal Billing::Payment.args_to_attributes(payment_type_id: 2, value: 0.23), { payment_type_id: 2, value: 0.23 }
15
+ # end
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class PaymentTypeTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class PluTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class ProfileTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class TaxGroupTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
data/test/test_helper.rb CHANGED
@@ -10,6 +10,32 @@ Rails.backtrace_cleaner.remove_silencers!
10
10
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
11
 
12
12
  # Load fixtures from the engine
13
- if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
13
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
14
+
15
+
16
+ class ActiveSupport::TestCase
17
+ # load db schema
18
+ ActiveRecord::Schema.verbose = false
19
+ load "#{Rails.root}/db/schema.rb"
20
+
21
+ fixtures :all
22
+ end
23
+ module Billing
24
+ class ActionController::TestCase
25
+ setup do
26
+ @routes = Billing::Engine.routes
27
+ end
28
+ module Behavior
29
+ def process_with_profile(action, http_method = 'GET', parameters = nil, session = nil, flash = nil)
30
+ parameters = { profile_id: profiles(:one) }.merge(parameters || {})
31
+ process_without_profile(action, http_method, parameters, session, flash)
32
+ end
33
+ alias_method_chain :process, :profile
34
+ end
35
+ end
36
+ class ActionDispatch::Routing::RouteSet
37
+ def default_url_options(options={})
38
+ options.merge(profile_id: Profile.first)
39
+ end
40
+ end
15
41
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Vangelov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-17 00:00:00.000000000 Z
11
+ date: 2014-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.4
19
+ version: 4.0.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 4.0.5
27
+ - !ruby/object:Gem::Dependency
28
+ name: money-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
25
32
  - !ruby/object:Gem::Version
26
- version: 4.1.4
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: sqlite3
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -48,23 +62,82 @@ files:
48
62
  - MIT-LICENSE
49
63
  - README.rdoc
50
64
  - Rakefile
65
+ - app/assets/javascripts/billing/accounts.js
51
66
  - app/assets/javascripts/billing/application.js
67
+ - app/assets/javascripts/billing/charges.js
68
+ - app/assets/javascripts/billing/modifiers.js
69
+ - app/assets/javascripts/billing/payments.js
70
+ - app/assets/stylesheets/billing/accounts.css
52
71
  - app/assets/stylesheets/billing/application.css
72
+ - app/assets/stylesheets/billing/charges.css
73
+ - app/assets/stylesheets/billing/modifiers.css
74
+ - app/assets/stylesheets/billing/payments.css
75
+ - app/controllers/billing/accounts_controller.rb
53
76
  - app/controllers/billing/application_controller.rb
77
+ - app/controllers/billing/charges_controller.rb
78
+ - app/controllers/billing/modifiers_controller.rb
79
+ - app/controllers/billing/payments_controller.rb
80
+ - app/helpers/billing/accounts_helper.rb
54
81
  - app/helpers/billing/application_helper.rb
82
+ - app/helpers/billing/charges_helper.rb
83
+ - app/helpers/billing/modifiers_helper.rb
84
+ - app/helpers/billing/payments_helper.rb
85
+ - app/models/billing/account.rb
86
+ - app/models/billing/account_item.rb
87
+ - app/models/billing/charge.rb
88
+ - app/models/billing/modifier.rb
89
+ - app/models/billing/modifier_items.rb
90
+ - app/models/billing/origin.rb
91
+ - app/models/billing/payment.rb
92
+ - app/models/billing/payment_type.rb
93
+ - app/models/billing/payment_with_type.rb
94
+ - app/models/billing/plu.rb
95
+ - app/models/billing/profile.rb
96
+ - app/models/billing/tax_group.rb
97
+ - app/views/billing/accounts/index.html.erb
98
+ - app/views/billing/accounts/new.html.erb
99
+ - app/views/billing/accounts/show.html.erb
100
+ - app/views/billing/application/index.html.erb
101
+ - app/views/billing/charges/new.html.erb
102
+ - app/views/billing/modifiers/new.html.erb
103
+ - app/views/billing/payments/new.html.erb
55
104
  - app/views/layouts/billing/application.html.erb
56
105
  - config/routes.rb
106
+ - db/migrate/20140717180443_create_billing_accounts.rb
107
+ - db/migrate/20140717181134_create_billing_charges.rb
108
+ - db/migrate/20140717181406_create_billing_discounts.rb
109
+ - db/migrate/20140717183129_create_billing_payments.rb
110
+ - db/migrate/20140717202527_create_billing_origins.rb
111
+ - db/migrate/20140718164841_add_sumaries_to_billing_account.rb
112
+ - db/migrate/20140718210349_add_fixed_value_to_billing_discount.rb
113
+ - db/migrate/20140718212116_create_billing_payment_types.rb
114
+ - db/migrate/20140719094023_create_billing_tax_groups.rb
115
+ - db/migrate/20140719094033_create_billing_plus.rb
116
+ - db/migrate/20140719094418_create_billing_profiles.rb
117
+ - db/migrate/20140719103621_rename_billing_discounts_to_modifiers.rb
118
+ - db/migrate/20140719110412_add_surcharges_sum_to_billing_account.rb
119
+ - db/migrate/20140720110811_add_type_to_billing_payment.rb
120
+ - db/migrate/20140720132559_add_type_to_billing_payment_type.rb
57
121
  - lib/billing.rb
122
+ - lib/billing/billable.rb
58
123
  - lib/billing/engine.rb
124
+ - lib/billing/mapping.rb
125
+ - lib/billing/routes.rb
59
126
  - lib/billing/version.rb
127
+ - lib/tasks/billing.rake
60
128
  - lib/tasks/billing_tasks.rake
61
129
  - test/billing_test.rb
130
+ - test/controllers/billing/accounts_controller_test.rb
131
+ - test/controllers/billing/charges_controller_test.rb
132
+ - test/controllers/billing/modifiers_controller_test.rb
133
+ - test/controllers/billing/payments_controller_test.rb
62
134
  - test/dummy/README.rdoc
63
135
  - test/dummy/Rakefile
64
136
  - test/dummy/app/assets/javascripts/application.js
65
137
  - test/dummy/app/assets/stylesheets/application.css
66
138
  - test/dummy/app/controllers/application_controller.rb
67
139
  - test/dummy/app/helpers/application_helper.rb
140
+ - test/dummy/app/models/profile.rb
68
141
  - test/dummy/app/views/layouts/application.html.erb
69
142
  - test/dummy/bin/bundle
70
143
  - test/dummy/bin/rails
@@ -88,11 +161,68 @@ files:
88
161
  - test/dummy/config/locales/en.yml
89
162
  - test/dummy/config/routes.rb
90
163
  - test/dummy/config/secrets.yml
164
+ - test/dummy/db/development.sqlite3
165
+ - test/dummy/db/migrate/20140718104656_create_profiles.rb
166
+ - test/dummy/db/schema.rb
167
+ - test/dummy/db/test.sqlite3
168
+ - test/dummy/log/development.log
169
+ - test/dummy/log/test.log
91
170
  - test/dummy/public/404.html
92
171
  - test/dummy/public/422.html
93
172
  - test/dummy/public/500.html
94
173
  - test/dummy/public/favicon.ico
174
+ - test/dummy/test/fixtures/profiles.yml
175
+ - test/dummy/test/models/profile_test.rb
176
+ - test/dummy/tmp/cache/assets/test/sprockets/02adf8ace512aefc4ef19b35aebc07f7
177
+ - test/dummy/tmp/cache/assets/test/sprockets/0cab887466527f5353fd43adab72769b
178
+ - test/dummy/tmp/cache/assets/test/sprockets/25b7c6efcbd128f109577104af58d084
179
+ - test/dummy/tmp/cache/assets/test/sprockets/2f52090f9e08ac02cd453b04af0df887
180
+ - test/dummy/tmp/cache/assets/test/sprockets/35a523ac3c33d6409a69faead4b2a882
181
+ - test/dummy/tmp/cache/assets/test/sprockets/3f4fc67be1dd91962f5a0026848dca77
182
+ - test/dummy/tmp/cache/assets/test/sprockets/43b3cc0ac6f63c0e1a3ab61fec84519d
183
+ - test/dummy/tmp/cache/assets/test/sprockets/59435066fc40e1ef5b45b0fd2c0eacf9
184
+ - test/dummy/tmp/cache/assets/test/sprockets/69cb965e6031d8099c185256f6fa8f90
185
+ - test/dummy/tmp/cache/assets/test/sprockets/6d34e4addaf3495d1d96306d164feb97
186
+ - test/dummy/tmp/cache/assets/test/sprockets/79316f9f3f5ebcec9b368d92d2e97e23
187
+ - test/dummy/tmp/cache/assets/test/sprockets/7ffc7e805e3fc08bae6a93e027a3e911
188
+ - test/dummy/tmp/cache/assets/test/sprockets/82ae0f4fbceb673c729b9bcb54a1161c
189
+ - test/dummy/tmp/cache/assets/test/sprockets/9509747efe602f6a81d50d9744f385f2
190
+ - test/dummy/tmp/cache/assets/test/sprockets/971b6b8d6c7a57e72d235e55537a2c44
191
+ - test/dummy/tmp/cache/assets/test/sprockets/b68d1e1a967e74abe3e10f643756ae67
192
+ - test/dummy/tmp/cache/assets/test/sprockets/cab3eca4515d1263ea8db2ff58df151d
193
+ - test/dummy/tmp/cache/assets/test/sprockets/cac68bb014ecc482b8f85312e49baa6f
194
+ - test/dummy/tmp/cache/assets/test/sprockets/d3ab844c61f1c211ed5fad5407cd18ef
195
+ - test/dummy/tmp/cache/assets/test/sprockets/d6d844128e4910cf773d1c48dd147e3b
196
+ - test/dummy/tmp/cache/assets/test/sprockets/e62907e54633a2adb53c33c1f59b79bf
197
+ - test/dummy/tmp/cache/assets/test/sprockets/e96b4e8fe0ebcceb51d202c8af7826ea
198
+ - test/dummy/tmp/cache/assets/test/sprockets/eb95e26896c1c6788657c4ef68a7e9e1
199
+ - test/dummy/tmp/cache/assets/test/sprockets/efaa0abeb4ad44b0ef8df996631f3997
200
+ - test/dummy/tmp/cache/assets/test/sprockets/f393277b28dd79320611f18a379dbea7
201
+ - test/dummy/tmp/cache/assets/test/sprockets/fbf1489a0c3d66a329f070c10cd77a03
202
+ - test/fixtures/billing/accounts.yml
203
+ - test/fixtures/billing/charges.yml
204
+ - test/fixtures/billing/modifiers.yml
205
+ - test/fixtures/billing/origins.yml
206
+ - test/fixtures/billing/payment_types.yml
207
+ - test/fixtures/billing/payments.yml
208
+ - test/fixtures/billing/plus.yml
209
+ - test/fixtures/billing/profiles.yml
210
+ - test/fixtures/billing/tax_groups.yml
211
+ - test/fixtures/profiles.yml
212
+ - test/helpers/billing/accounts_helper_test.rb
213
+ - test/helpers/billing/charges_helper_test.rb
214
+ - test/helpers/billing/modifiers_helper_test.rb
215
+ - test/helpers/billing/payments_helper_test.rb
95
216
  - test/integration/navigation_test.rb
217
+ - test/models/billing/account_test.rb
218
+ - test/models/billing/charge_test.rb
219
+ - test/models/billing/modifier_test.rb
220
+ - test/models/billing/origin_test.rb
221
+ - test/models/billing/payment_test.rb
222
+ - test/models/billing/payment_type_test.rb
223
+ - test/models/billing/plu_test.rb
224
+ - test/models/billing/profile_test.rb
225
+ - test/models/billing/tax_group_test.rb
96
226
  - test/test_helper.rb
97
227
  homepage: http://extface.com
98
228
  licenses:
@@ -117,17 +247,66 @@ rubyforge_project:
117
247
  rubygems_version: 2.2.2
118
248
  signing_key:
119
249
  specification_version: 4
120
- summary: Billing for rails 4 app
250
+ summary: Billing for Rails 4 app
121
251
  test_files:
122
252
  - test/billing_test.rb
253
+ - test/fixtures/billing/payment_types.yml
254
+ - test/fixtures/billing/origins.yml
255
+ - test/fixtures/billing/plus.yml
256
+ - test/fixtures/billing/payments.yml
257
+ - test/fixtures/billing/charges.yml
258
+ - test/fixtures/billing/modifiers.yml
259
+ - test/fixtures/billing/profiles.yml
260
+ - test/fixtures/billing/accounts.yml
261
+ - test/fixtures/billing/tax_groups.yml
262
+ - test/fixtures/profiles.yml
123
263
  - test/test_helper.rb
264
+ - test/controllers/billing/payments_controller_test.rb
265
+ - test/controllers/billing/modifiers_controller_test.rb
266
+ - test/controllers/billing/accounts_controller_test.rb
267
+ - test/controllers/billing/charges_controller_test.rb
268
+ - test/dummy/tmp/cache/assets/test/sprockets/6d34e4addaf3495d1d96306d164feb97
269
+ - test/dummy/tmp/cache/assets/test/sprockets/efaa0abeb4ad44b0ef8df996631f3997
270
+ - test/dummy/tmp/cache/assets/test/sprockets/e62907e54633a2adb53c33c1f59b79bf
271
+ - test/dummy/tmp/cache/assets/test/sprockets/69cb965e6031d8099c185256f6fa8f90
272
+ - test/dummy/tmp/cache/assets/test/sprockets/d3ab844c61f1c211ed5fad5407cd18ef
273
+ - test/dummy/tmp/cache/assets/test/sprockets/25b7c6efcbd128f109577104af58d084
274
+ - test/dummy/tmp/cache/assets/test/sprockets/3f4fc67be1dd91962f5a0026848dca77
275
+ - test/dummy/tmp/cache/assets/test/sprockets/35a523ac3c33d6409a69faead4b2a882
276
+ - test/dummy/tmp/cache/assets/test/sprockets/eb95e26896c1c6788657c4ef68a7e9e1
277
+ - test/dummy/tmp/cache/assets/test/sprockets/02adf8ace512aefc4ef19b35aebc07f7
278
+ - test/dummy/tmp/cache/assets/test/sprockets/f393277b28dd79320611f18a379dbea7
279
+ - test/dummy/tmp/cache/assets/test/sprockets/fbf1489a0c3d66a329f070c10cd77a03
280
+ - test/dummy/tmp/cache/assets/test/sprockets/d6d844128e4910cf773d1c48dd147e3b
281
+ - test/dummy/tmp/cache/assets/test/sprockets/b68d1e1a967e74abe3e10f643756ae67
282
+ - test/dummy/tmp/cache/assets/test/sprockets/9509747efe602f6a81d50d9744f385f2
283
+ - test/dummy/tmp/cache/assets/test/sprockets/82ae0f4fbceb673c729b9bcb54a1161c
284
+ - test/dummy/tmp/cache/assets/test/sprockets/cab3eca4515d1263ea8db2ff58df151d
285
+ - test/dummy/tmp/cache/assets/test/sprockets/0cab887466527f5353fd43adab72769b
286
+ - test/dummy/tmp/cache/assets/test/sprockets/59435066fc40e1ef5b45b0fd2c0eacf9
287
+ - test/dummy/tmp/cache/assets/test/sprockets/7ffc7e805e3fc08bae6a93e027a3e911
288
+ - test/dummy/tmp/cache/assets/test/sprockets/2f52090f9e08ac02cd453b04af0df887
289
+ - test/dummy/tmp/cache/assets/test/sprockets/cac68bb014ecc482b8f85312e49baa6f
290
+ - test/dummy/tmp/cache/assets/test/sprockets/971b6b8d6c7a57e72d235e55537a2c44
291
+ - test/dummy/tmp/cache/assets/test/sprockets/e96b4e8fe0ebcceb51d202c8af7826ea
292
+ - test/dummy/tmp/cache/assets/test/sprockets/79316f9f3f5ebcec9b368d92d2e97e23
293
+ - test/dummy/tmp/cache/assets/test/sprockets/43b3cc0ac6f63c0e1a3ab61fec84519d
124
294
  - test/dummy/config.ru
295
+ - test/dummy/test/fixtures/profiles.yml
296
+ - test/dummy/test/models/profile_test.rb
297
+ - test/dummy/log/development.log
298
+ - test/dummy/log/test.log
299
+ - test/dummy/db/development.sqlite3
300
+ - test/dummy/db/migrate/20140718104656_create_profiles.rb
301
+ - test/dummy/db/test.sqlite3
302
+ - test/dummy/db/schema.rb
125
303
  - test/dummy/README.rdoc
126
304
  - test/dummy/app/views/layouts/application.html.erb
127
305
  - test/dummy/app/controllers/application_controller.rb
128
306
  - test/dummy/app/helpers/application_helper.rb
129
307
  - test/dummy/app/assets/javascripts/application.js
130
308
  - test/dummy/app/assets/stylesheets/application.css
309
+ - test/dummy/app/models/profile.rb
131
310
  - test/dummy/config/application.rb
132
311
  - test/dummy/config/locales/en.yml
133
312
  - test/dummy/config/boot.rb
@@ -154,4 +333,17 @@ test_files:
154
333
  - test/dummy/public/404.html
155
334
  - test/dummy/public/422.html
156
335
  - test/dummy/Rakefile
336
+ - test/helpers/billing/accounts_helper_test.rb
337
+ - test/helpers/billing/payments_helper_test.rb
338
+ - test/helpers/billing/modifiers_helper_test.rb
339
+ - test/helpers/billing/charges_helper_test.rb
157
340
  - test/integration/navigation_test.rb
341
+ - test/models/billing/tax_group_test.rb
342
+ - test/models/billing/account_test.rb
343
+ - test/models/billing/plu_test.rb
344
+ - test/models/billing/payment_test.rb
345
+ - test/models/billing/origin_test.rb
346
+ - test/models/billing/profile_test.rb
347
+ - test/models/billing/payment_type_test.rb
348
+ - test/models/billing/charge_test.rb
349
+ - test/models/billing/modifier_test.rb