jackpot 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. data/.gitignore +16 -0
  2. data/.rspec +1 -0
  3. data/.rvmrc.example +1 -0
  4. data/.travis.yml +12 -0
  5. data/Gemfile +9 -0
  6. data/Gemfile.lock +181 -0
  7. data/MIT-LICENSE +20 -0
  8. data/README.md +134 -0
  9. data/Rakefile +25 -0
  10. data/app/assets/images/jackpot/.gitkeep +0 -0
  11. data/app/assets/javascripts/jackpot/application.js +5 -0
  12. data/app/assets/javascripts/jackpot/bootstrap.js +32 -0
  13. data/app/assets/javascripts/jackpot/customers.js +2 -0
  14. data/app/assets/javascripts/jackpot/login.js +1 -0
  15. data/app/assets/javascripts/jackpot/payments.js +2 -0
  16. data/app/assets/javascripts/jackpot/subscriptions.js +2 -0
  17. data/app/assets/stylesheets/jackpot/application.css +9 -0
  18. data/app/assets/stylesheets/jackpot/customers.css +4 -0
  19. data/app/assets/stylesheets/jackpot/jackpot.css +10 -0
  20. data/app/controllers/jackpot/application_controller.rb +4 -0
  21. data/app/controllers/jackpot/customers_controller.rb +100 -0
  22. data/app/controllers/jackpot/payments_controller.rb +20 -0
  23. data/app/controllers/jackpot/subscriptions_controller.rb +86 -0
  24. data/app/helpers/jackpot/application_helper.rb +27 -0
  25. data/app/helpers/jackpot/customers_helper.rb +7 -0
  26. data/app/helpers/jackpot/subscriptions_helper.rb +4 -0
  27. data/app/models/jackpot/card.rb +29 -0
  28. data/app/models/jackpot/customer.rb +48 -0
  29. data/app/models/jackpot/gateway.rb +28 -0
  30. data/app/models/jackpot/payment.rb +33 -0
  31. data/app/models/jackpot/subscription.rb +13 -0
  32. data/app/models/jackpot/user.rb +25 -0
  33. data/app/views/jackpot/customers/_credit_card_form.html.erb +42 -0
  34. data/app/views/jackpot/customers/_form.html.erb +17 -0
  35. data/app/views/jackpot/customers/edit.html.erb +13 -0
  36. data/app/views/jackpot/customers/index.html.erb +30 -0
  37. data/app/views/jackpot/customers/new.html.erb +8 -0
  38. data/app/views/jackpot/customers/show.html.erb +32 -0
  39. data/app/views/jackpot/payments/create.html.erb +1 -0
  40. data/app/views/jackpot/payments/index.html.erb +25 -0
  41. data/app/views/jackpot/shared/_flash_messages.html.erb +6 -0
  42. data/app/views/jackpot/shared/_navigation.html.erb +5 -0
  43. data/app/views/jackpot/subscriptions/_form.html.erb +13 -0
  44. data/app/views/jackpot/subscriptions/edit.html.erb +6 -0
  45. data/app/views/jackpot/subscriptions/index.html.erb +29 -0
  46. data/app/views/jackpot/subscriptions/new.html.erb +4 -0
  47. data/app/views/jackpot/subscriptions/show.html.erb +23 -0
  48. data/app/views/layouts/devise.html.erb +22 -0
  49. data/app/views/layouts/jackpot/application.html.erb +39 -0
  50. data/config/initializers/jackpot_devise.rb +226 -0
  51. data/config/locales/devise.en.yml +57 -0
  52. data/config/routes.rb +17 -0
  53. data/db/migrate/20111221002616_create_jackpot_payments.rb +11 -0
  54. data/db/migrate/20111230014003_add_customer_information_to_jackpot_payments.rb +5 -0
  55. data/db/migrate/20120102223341_create_jackpot_subscriptions.rb +10 -0
  56. data/db/migrate/20120103211153_create_jackpot_customers.rb +11 -0
  57. data/db/migrate/20120104164830_add_credit_card_number_to_customer.rb +5 -0
  58. data/db/migrate/20120130173242_add_credit_card_information_to_customers.rb +7 -0
  59. data/db/migrate/20120208191815_add_billing_period_to_jackpot_subscriptions.rb +5 -0
  60. data/db/migrate/20120208191934_add_good_until_date_to_jackpot_customers.rb +6 -0
  61. data/db/migrate/20120209203542_add_subscription_and_customer_to_jackpot_payments.rb +8 -0
  62. data/db/migrate/20120209212043_rename_column_token_in_jackpot_payments.rb +5 -0
  63. data/db/migrate/20120210144038_devise_create_jackpot_users.rb +49 -0
  64. data/jackpot.gemspec +33 -0
  65. data/lib/jackpot.rb +23 -0
  66. data/lib/jackpot/configuration.rb +33 -0
  67. data/lib/jackpot/cron.rb +22 -0
  68. data/lib/jackpot/engine.rb +14 -0
  69. data/lib/jackpot/errors.rb +18 -0
  70. data/lib/jackpot/factory.rb +26 -0
  71. data/lib/jackpot/version.rb +3 -0
  72. data/lib/tasks/jackpot_tasks.rake +38 -0
  73. data/script/rails +6 -0
  74. data/spec/controllers/jackpot/customers_controller_spec.rb +170 -0
  75. data/spec/controllers/jackpot/payments_controller_spec.rb +47 -0
  76. data/spec/controllers/jackpot/subscriptions_controller_spec.rb +153 -0
  77. data/spec/dummy/.gitignore +1 -0
  78. data/spec/dummy/Rakefile +7 -0
  79. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  80. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  81. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  82. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  83. data/spec/dummy/app/mailers/.gitkeep +0 -0
  84. data/spec/dummy/app/models/.gitkeep +0 -0
  85. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  86. data/spec/dummy/config.ru +4 -0
  87. data/spec/dummy/config/application.rb +51 -0
  88. data/spec/dummy/config/boot.rb +10 -0
  89. data/spec/dummy/config/database.yml +17 -0
  90. data/spec/dummy/config/environment.rb +5 -0
  91. data/spec/dummy/config/environments/development.rb +32 -0
  92. data/spec/dummy/config/environments/production.rb +60 -0
  93. data/spec/dummy/config/environments/test.rb +41 -0
  94. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  95. data/spec/dummy/config/initializers/inflections.rb +10 -0
  96. data/spec/dummy/config/initializers/jackpot.rb +13 -0
  97. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  98. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  99. data/spec/dummy/config/initializers/session_store.rb +8 -0
  100. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  101. data/spec/dummy/config/locales/en.yml +5 -0
  102. data/spec/dummy/config/routes.rb +3 -0
  103. data/spec/dummy/db/schema.rb +68 -0
  104. data/spec/dummy/lib/assets/.gitkeep +0 -0
  105. data/spec/dummy/public/404.html +26 -0
  106. data/spec/dummy/public/422.html +26 -0
  107. data/spec/dummy/public/500.html +26 -0
  108. data/spec/dummy/public/favicon.ico +0 -0
  109. data/spec/dummy/public/index.html +5 -0
  110. data/spec/dummy/public/payment.html +36 -0
  111. data/spec/dummy/script/rails +6 -0
  112. data/spec/fixtures/vcr/Create_Customers_To_bill_monthly_my_customers_As_a_user_I_want_to_record_their_billing_information_/assigning_credit_card_information_to_customer.yml +34 -0
  113. data/spec/fixtures/vcr/Jackpot_Customer/_update_credit_card_number/when_card_is_valid/.yml +34 -0
  114. data/spec/fixtures/vcr/Jackpot_Customer/_update_credit_card_number/when_card_is_valid/when_persisting/should_NEVER_persist_in_the_database_the_actual_card_number.yml +34 -0
  115. data/spec/fixtures/vcr/Jackpot_Customer/_update_credit_card_number/when_card_is_valid/when_persisting/should_NEVER_persist_in_the_database_the_verification_value.yml +34 -0
  116. data/spec/fixtures/vcr/Jackpot_Customer/_update_credit_card_number/when_card_is_valid/when_persisting/should_persist_in_the_database_the_ONLY_last_four_digits.yml +34 -0
  117. data/spec/fixtures/vcr/Jackpot_Customer/_update_credit_card_number/when_card_is_valid/when_persisting/should_persist_the_card_information.yml +34 -0
  118. data/spec/fixtures/vcr/Jackpot_Customer/_update_credit_card_number/when_card_is_valid/when_persisting/should_store_this_card_at_the_gateway.yml +34 -0
  119. data/spec/fixtures/vcr/Jackpot_Payment/_create/with_valid_token_information/creates_a_new_payment.yml +96 -0
  120. data/spec/fixtures/vcr/Jackpot_Payment/_create/with_valid_token_information/does_not_persist_credit_card_token_information.yml +96 -0
  121. data/spec/fixtures/vcr/Jackpot_Payment/_create/with_valid_token_information/records_the_payment_transaction_id_for_future_reference.yml +96 -0
  122. data/spec/fixtures/vcr/Jackpot_Payment/_create/with_valid_token_information/records_this_payment_information.yml +96 -0
  123. data/spec/fixtures/vcr/Jackpot_Payment/_customer_name/returns_its_customer_email.yml +96 -0
  124. data/spec/fixtures/vcr/jackpot/customer/updatecard.yml +34 -0
  125. data/spec/fixtures/vcr/jackpot/customer_expiration_date.yml +34 -0
  126. data/spec/fixtures/vcr/jackpot/receiving_payments.yml +96 -0
  127. data/spec/helpers/jackpot/customers_helper_spec.rb +16 -0
  128. data/spec/helpers/jackpot/subscriptions_helper_spec.rb +4 -0
  129. data/spec/lib/cron_spec.rb +39 -0
  130. data/spec/lib/factory_spec.rb +40 -0
  131. data/spec/models/jackpot/card_spec.rb +23 -0
  132. data/spec/models/jackpot/customer_spec.rb +140 -0
  133. data/spec/models/jackpot/gateway_spec.rb +22 -0
  134. data/spec/models/jackpot/payment_spec.rb +74 -0
  135. data/spec/models/jackpot/subscription_spec.rb +19 -0
  136. data/spec/requests/jackpot/jackpot_assign_subscription_to_customer_spec.rb +39 -0
  137. data/spec/requests/jackpot/jackpot_create_customer_spec.rb +73 -0
  138. data/spec/requests/jackpot/jackpot_create_subscriptions_spec.rb +27 -0
  139. data/spec/requests/jackpot/jackpot_receive_payments_spec.rb +34 -0
  140. data/spec/spec_helper.rb +41 -0
  141. data/spec/support/active_merchant.rb +1 -0
  142. data/spec/support/capybara.rb +6 -0
  143. data/spec/support/devise.rb +21 -0
  144. data/spec/support/factories/jackpot_customers.rb +36 -0
  145. data/spec/support/factories/jackpot_payments.rb +7 -0
  146. data/spec/support/factories/jackpot_subscriptions.rb +9 -0
  147. data/spec/support/factories/jackpot_users.rb +9 -0
  148. data/spec/support/helpers.rb +16 -0
  149. data/spec/support/routes.rb +3 -0
  150. data/spec/support/vcr.rb +10 -0
  151. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  152. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  153. data/vendor/assets/javascripts/twitter/bootstrap.js +12 -0
  154. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +91 -0
  155. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +98 -0
  156. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +154 -0
  157. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +136 -0
  158. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +92 -0
  159. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +209 -0
  160. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +95 -0
  161. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +125 -0
  162. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +130 -0
  163. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +270 -0
  164. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +51 -0
  165. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +271 -0
  166. data/vendor/assets/stylesheets/twitter/bootstrap/bootstrap-responsive.css +567 -0
  167. data/vendor/assets/stylesheets/twitter/bootstrap/bootstrap.css.erb +3366 -0
  168. metadata +351 -0
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,17 @@
1
+ development:
2
+ host: localhost
3
+ adapter: mysql2
4
+ database: jackpot_development
5
+ username: root
6
+ pool: 5
7
+ encoding: utf8
8
+ reconnect: false
9
+
10
+ test: &test
11
+ host: localhost
12
+ adapter: mysql2
13
+ database: jackpot_test<%= ENV['TEST_ENV_NUMBER'] %>
14
+ username: root
15
+ reconnect: false
16
+ pool: 5
17
+ encoding: utf8
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,32 @@
1
+ ActiveMerchant::Billing::Base.mode = :test
2
+
3
+ Dummy::Application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb
5
+
6
+ # In the development environment your application's code is reloaded on
7
+ # every request. This slows down response time but is perfect for development
8
+ # since you don't have to restart the web server when you make code changes.
9
+ config.cache_classes = false
10
+
11
+ # Log error messages when you accidentally call methods on nil.
12
+ config.whiny_nils = true
13
+
14
+ # Show full error reports and disable caching
15
+ config.consider_all_requests_local = true
16
+ config.action_controller.perform_caching = false
17
+
18
+ # Don't care if the mailer can't send
19
+ config.action_mailer.raise_delivery_errors = false
20
+
21
+ # Print deprecation notices to the Rails logger
22
+ config.active_support.deprecation = :log
23
+
24
+ # Only use best-standards-support built into browsers
25
+ config.action_dispatch.best_standards_support = :builtin
26
+
27
+ # Do not compress assets
28
+ config.assets.compress = false
29
+
30
+ # Expands the lines which load the assets
31
+ config.assets.debug = true
32
+ end
@@ -0,0 +1,60 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Use a different logger for distributed setups
37
+ # config.logger = SyslogLogger.new
38
+
39
+ # Use a different cache store in production
40
+ # config.cache_store = :mem_cache_store
41
+
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
+ # config.action_controller.asset_host = "http://assets.example.com"
44
+
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
48
+ # Disable delivery errors, bad email addresses will be ignored
49
+ # config.action_mailer.raise_delivery_errors = false
50
+
51
+ # Enable threaded mode
52
+ # config.threadsafe!
53
+
54
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
55
+ # the I18n.default_locale when a translation can not be found)
56
+ config.i18n.fallbacks = true
57
+
58
+ # Send deprecation notices to registered listeners
59
+ config.active_support.deprecation = :notify
60
+ end
@@ -0,0 +1,41 @@
1
+ ActiveMerchant::Billing::Base.mode = :test
2
+
3
+ Dummy::Application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb
5
+
6
+ # The test environment is used exclusively to run your application's
7
+ # test suite. You never need to work with it otherwise. Remember that
8
+ # your test database is "scratch space" for the test suite and is wiped
9
+ # and recreated between test runs. Don't rely on the data there!
10
+ config.cache_classes = true
11
+
12
+ # Configure static asset server for tests with Cache-Control for performance
13
+ config.serve_static_assets = true
14
+ config.static_cache_control = "public, max-age=3600"
15
+
16
+ # Log error messages when you accidentally call methods on nil
17
+ config.whiny_nils = true
18
+
19
+ # Show full error reports and disable caching
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
35
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
36
+ # like if you have constraints or database-specific column types
37
+ # config.active_record.schema_format = :sql
38
+
39
+ # Print deprecation notices to the stderr
40
+ config.active_support.deprecation = :stderr
41
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,13 @@
1
+ Jackpot.configure do |c|
2
+ if Rails.env.production? or Rails.env.staging?
3
+ c.gateway_type :braintree
4
+ c.gateway_login ENV['jackpot_login']
5
+ c.gateway_password ENV['jackpot_demo']
6
+ c.gateway_mode :test
7
+ else
8
+ c.gateway_type :braintree
9
+ c.gateway_login 'demo'
10
+ c.gateway_password 'password'
11
+ c.gateway_mode :test
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'a38f2cc02334c3ef2cb7c369af85fbeaa837e54bc5cb2d7688bb2ba136d1bb5e0169f7696aa3826098f4d6dcd5163b4eb96968e5da3ae87c73f3021cce508ee5'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount Jackpot::Engine => "/billing"
3
+ end
@@ -0,0 +1,68 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20120214020231) do
15
+
16
+ create_table "jackpot_customers", :force => true do |t|
17
+ t.string "email"
18
+ t.text "description"
19
+ t.integer "subscription_id"
20
+ t.datetime "created_at"
21
+ t.datetime "updated_at"
22
+ t.string "credit_card_number"
23
+ t.integer "credit_card_expiry_month"
24
+ t.integer "credit_card_expiry_year"
25
+ t.string "credit_card_token"
26
+ t.date "good_until"
27
+ end
28
+
29
+ create_table "jackpot_payments", :force => true do |t|
30
+ t.string "payment_transaction_token"
31
+ t.integer "amount"
32
+ t.text "description"
33
+ t.datetime "created_at"
34
+ t.datetime "updated_at"
35
+ t.string "customer_name"
36
+ t.integer "subscription_id"
37
+ t.integer "customer_id"
38
+ end
39
+
40
+ create_table "jackpot_subscriptions", :force => true do |t|
41
+ t.string "name"
42
+ t.integer "price"
43
+ t.datetime "created_at"
44
+ t.datetime "updated_at"
45
+ t.integer "billing_period"
46
+ end
47
+
48
+ create_table "jackpot_users", :force => true do |t|
49
+ t.string "email", :default => "", :null => false
50
+ t.string "encrypted_password", :default => "", :null => false
51
+ t.string "reset_password_token"
52
+ t.datetime "reset_password_sent_at"
53
+ t.datetime "remember_created_at"
54
+ t.integer "sign_in_count", :default => 0
55
+ t.datetime "current_sign_in_at"
56
+ t.datetime "last_sign_in_at"
57
+ t.string "current_sign_in_ip"
58
+ t.string "last_sign_in_ip"
59
+ t.string "authentication_token"
60
+ t.datetime "created_at"
61
+ t.datetime "updated_at"
62
+ end
63
+
64
+ add_index "jackpot_users", ["authentication_token"], :name => "index_jackpot_users_on_authentication_token", :unique => true
65
+ add_index "jackpot_users", ["email"], :name => "index_jackpot_users_on_email", :unique => true
66
+ add_index "jackpot_users", ["reset_password_token"], :name => "index_jackpot_users_on_reset_password_token", :unique => true
67
+
68
+ end
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,5 @@
1
+ <h1>
2
+ Jackpot dummy app
3
+ </h1>
4
+
5
+ <a href="/billing/payments">Go to payments</a>
@@ -0,0 +1,36 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy Payment Information</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/payment.html -->
21
+ <div class="dialog">
22
+ <h1>Dummy payment information</h1>
23
+ </div>
24
+ <form name="payment" action="/billing/payments" method="POST">
25
+ <ol>
26
+ <li>
27
+ <label for="payment[customer_id]">Customer id</label>
28
+ <input type="text" name="customer_id">
29
+ </li>
30
+ <li>
31
+ <input type="submit" name="confirm" value="confirm">
32
+ </li>
33
+ <ol>
34
+ <form>
35
+ </body>
36
+ </html>