stripe_local 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +35 -0
  4. data/Rakefile +29 -0
  5. data/app/assets/javascripts/stripe_local/application.js +13 -0
  6. data/app/assets/javascripts/stripe_local/cards.js +2 -0
  7. data/app/assets/javascripts/stripe_local/charges.js +2 -0
  8. data/app/assets/javascripts/stripe_local/coupons.js +2 -0
  9. data/app/assets/javascripts/stripe_local/customers.js +2 -0
  10. data/app/assets/javascripts/stripe_local/discounts.js +2 -0
  11. data/app/assets/javascripts/stripe_local/invoices.js +2 -0
  12. data/app/assets/javascripts/stripe_local/line_items.js +2 -0
  13. data/app/assets/javascripts/stripe_local/plans.js +2 -0
  14. data/app/assets/javascripts/stripe_local/subscriptions.js +2 -0
  15. data/app/assets/stylesheets/stripe_local/application.css +13 -0
  16. data/app/assets/stylesheets/stripe_local/cards.css +4 -0
  17. data/app/assets/stylesheets/stripe_local/charges.css +4 -0
  18. data/app/assets/stylesheets/stripe_local/coupons.css +4 -0
  19. data/app/assets/stylesheets/stripe_local/customers.css +4 -0
  20. data/app/assets/stylesheets/stripe_local/discounts.css +4 -0
  21. data/app/assets/stylesheets/stripe_local/invoices.css +4 -0
  22. data/app/assets/stylesheets/stripe_local/line_items.css +4 -0
  23. data/app/assets/stylesheets/stripe_local/plans.css +4 -0
  24. data/app/assets/stylesheets/stripe_local/subscriptions.css +4 -0
  25. data/app/callbacks/stripe_local/plan_sync.rb +33 -0
  26. data/app/controllers/stripe_local/application_controller.rb +4 -0
  27. data/app/controllers/stripe_local/cards_controller.rb +6 -0
  28. data/app/controllers/stripe_local/charges_controller.rb +6 -0
  29. data/app/controllers/stripe_local/coupons_controller.rb +6 -0
  30. data/app/controllers/stripe_local/customers_controller.rb +6 -0
  31. data/app/controllers/stripe_local/discounts_controller.rb +6 -0
  32. data/app/controllers/stripe_local/invoices_controller.rb +6 -0
  33. data/app/controllers/stripe_local/line_items_controller.rb +6 -0
  34. data/app/controllers/stripe_local/plans_controller.rb +6 -0
  35. data/app/controllers/stripe_local/subscriptions_controller.rb +6 -0
  36. data/app/controllers/stripe_local/webhooks_controller.rb +13 -0
  37. data/app/helpers/stripe_local/application_helper.rb +4 -0
  38. data/app/helpers/stripe_local/cards_helper.rb +4 -0
  39. data/app/helpers/stripe_local/charges_helper.rb +4 -0
  40. data/app/helpers/stripe_local/coupons_helper.rb +4 -0
  41. data/app/helpers/stripe_local/customers_helper.rb +4 -0
  42. data/app/helpers/stripe_local/discounts_helper.rb +4 -0
  43. data/app/helpers/stripe_local/invoices_helper.rb +4 -0
  44. data/app/helpers/stripe_local/line_items_helper.rb +4 -0
  45. data/app/helpers/stripe_local/plans_helper.rb +4 -0
  46. data/app/helpers/stripe_local/subscriptions_helper.rb +4 -0
  47. data/app/mixins/stripe_local/object_adapter.rb +33 -0
  48. data/app/mixins/stripe_local/sync_plans.rb +39 -0
  49. data/app/models/stripe_local/balance.rb +48 -0
  50. data/app/models/stripe_local/card.rb +39 -0
  51. data/app/models/stripe_local/charge.rb +63 -0
  52. data/app/models/stripe_local/coupon.rb +21 -0
  53. data/app/models/stripe_local/customer.rb +98 -0
  54. data/app/models/stripe_local/discount.rb +36 -0
  55. data/app/models/stripe_local/invoice.rb +68 -0
  56. data/app/models/stripe_local/line_item.rb +56 -0
  57. data/app/models/stripe_local/plan.rb +41 -0
  58. data/app/models/stripe_local/subscription.rb +50 -0
  59. data/app/models/stripe_local/transaction.rb +45 -0
  60. data/app/models/stripe_local/transfer.rb +48 -0
  61. data/app/validators/email_pattern_validator.rb +7 -0
  62. data/app/validators/full_name_pattern_validator.rb +7 -0
  63. data/app/validators/legal_name_pattern_validator.rb +7 -0
  64. data/app/validators/phone_pattern_validator.rb +17 -0
  65. data/app/validators/plan_id_pattern_validator.rb +7 -0
  66. data/app/validators/slug_pattern_validator.rb +38 -0
  67. data/app/validators/state_abbreviation_validator.rb +13 -0
  68. data/app/validators/stripe_type_validator.rb +7 -0
  69. data/app/validators/zip_type_validator.rb +8 -0
  70. data/app/views/layouts/stripe_local/application.html.erb +14 -0
  71. data/config/routes.rb +22 -0
  72. data/db/migrate/20131122063517_load_stripe_tables.rb +200 -0
  73. data/lib/stripe_local/engine.rb +7 -0
  74. data/lib/stripe_local/version.rb +3 -0
  75. data/lib/stripe_local/webhook/subscriber.rb +34 -0
  76. data/lib/stripe_local/webhook/types.rb +45 -0
  77. data/lib/stripe_local/webhook.rb +55 -0
  78. data/lib/stripe_local/webhooks.rb +20 -0
  79. data/lib/stripe_local.rb +48 -0
  80. data/lib/tasks/stripe_local_tasks.rake +4 -0
  81. data/spec/dummy/README.rdoc +28 -0
  82. data/spec/dummy/Rakefile +6 -0
  83. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  84. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  85. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  86. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  87. data/spec/dummy/app/models/client.rb +4 -0
  88. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  89. data/spec/dummy/bin/bundle +3 -0
  90. data/spec/dummy/bin/rails +4 -0
  91. data/spec/dummy/bin/rake +4 -0
  92. data/spec/dummy/config/application.rb +21 -0
  93. data/spec/dummy/config/boot.rb +5 -0
  94. data/spec/dummy/config/database.yml +17 -0
  95. data/spec/dummy/config/environment.rb +5 -0
  96. data/spec/dummy/config/environments/development.rb +29 -0
  97. data/spec/dummy/config/environments/production.rb +80 -0
  98. data/spec/dummy/config/environments/test.rb +36 -0
  99. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  100. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  101. data/spec/dummy/config/initializers/inflections.rb +16 -0
  102. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  103. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  104. data/spec/dummy/config/initializers/session_store.rb +3 -0
  105. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  106. data/spec/dummy/config/locales/en.yml +23 -0
  107. data/spec/dummy/config/routes.rb +4 -0
  108. data/spec/dummy/config.ru +4 -0
  109. data/spec/dummy/db/migrate/20131102200937_create_clients.rb +11 -0
  110. data/spec/dummy/db/migrate/20131122104223_add_stripe_customer_id_to_clients.rb +5 -0
  111. data/spec/dummy/db/schema.rb +236 -0
  112. data/spec/dummy/log/development.log +1290 -0
  113. data/spec/dummy/log/test.log +7041 -0
  114. data/spec/dummy/public/404.html +58 -0
  115. data/spec/dummy/public/422.html +58 -0
  116. data/spec/dummy/public/500.html +57 -0
  117. data/spec/dummy/public/favicon.ico +0 -0
  118. data/spec/dummy/spec/spec_helper.rb +42 -0
  119. data/spec/fixtures/client_params.json +18 -0
  120. data/spec/fixtures/credit_card.json +18 -0
  121. data/spec/fixtures/stripe_local/balance_transactions.yml +25 -0
  122. data/spec/fixtures/stripe_local/cards.yml +21 -0
  123. data/spec/fixtures/stripe_local/charges.yml +37 -0
  124. data/spec/fixtures/stripe_local/coupons.yml +23 -0
  125. data/spec/fixtures/stripe_local/customers.yml +21 -0
  126. data/spec/fixtures/stripe_local/discounts.yml +13 -0
  127. data/spec/fixtures/stripe_local/invoices.yml +37 -0
  128. data/spec/fixtures/stripe_local/line_items.yml +19 -0
  129. data/spec/fixtures/stripe_local/plans.yml +17 -0
  130. data/spec/fixtures/stripe_local/subscriptions.yml +25 -0
  131. data/spec/fixtures/stripe_local/transfers.yml +17 -0
  132. data/spec/models/stripe_local/balance_spec.rb +47 -0
  133. data/spec/models/stripe_local/card_spec.rb +13 -0
  134. data/spec/models/stripe_local/charge_spec.rb +13 -0
  135. data/spec/models/stripe_local/customer_spec.rb +17 -0
  136. data/spec/models/stripe_local/invoice_spec.rb +17 -0
  137. data/spec/models/stripe_local/plan_spec.rb +33 -0
  138. data/spec/models/stripe_local/subscription_spec.rb +15 -0
  139. data/spec/models/stripe_local/transaction_spec.rb +14 -0
  140. data/spec/models/stripe_local/transfer_spec.rb +13 -0
  141. data/spec/spec_helper.rb +19 -0
  142. data/spec/webhook_fixtures/balance_transaction.json +23 -0
  143. data/spec/webhook_fixtures/charge.succeeded.json +45 -0
  144. data/spec/webhook_fixtures/customer.created.json +41 -0
  145. data/spec/webhook_fixtures/customer.subscription.created.json +27 -0
  146. data/spec/webhook_fixtures/customer_creation_response.json +66 -0
  147. data/spec/webhook_fixtures/invoice.payment_succeeded.json +55 -0
  148. data/spec/webhook_fixtures/plan.created.json +12 -0
  149. data/spec/webhook_fixtures/transfer.json +32 -0
  150. metadata +403 -0
@@ -0,0 +1,80 @@
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
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both thread web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
23
+ config.serve_static_assets = false
24
+
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
28
+
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
31
+
32
+ # Generate digests for assets URLs.
33
+ config.assets.digest = true
34
+
35
+ # Version of your assets, change this if you want to expire all your assets.
36
+ config.assets.version = '1.0'
37
+
38
+ # Specifies the header that your server uses for sending files.
39
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
41
+
42
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
+ # config.force_ssl = true
44
+
45
+ # Set to :debug to see everything in the log.
46
+ config.log_level = :info
47
+
48
+ # Prepend all log lines with the following tags.
49
+ # config.log_tags = [ :subdomain, :uuid ]
50
+
51
+ # Use a different logger for distributed setups.
52
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
53
+
54
+ # Use a different cache store in production.
55
+ # config.cache_store = :mem_cache_store
56
+
57
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58
+ # config.action_controller.asset_host = "http://assets.example.com"
59
+
60
+ # Precompile additional assets.
61
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
+ # config.assets.precompile += %w( search.js )
63
+
64
+ # Ignore bad email addresses and do not raise email delivery errors.
65
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66
+ # config.action_mailer.raise_delivery_errors = false
67
+
68
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69
+ # the I18n.default_locale when a translation can not be found).
70
+ config.i18n.fallbacks = true
71
+
72
+ # Send deprecation notices to registered listeners.
73
+ config.active_support.deprecation = :notify
74
+
75
+ # Disable automatic flushing of the log to improve performance.
76
+ # config.autoflush_log = false
77
+
78
+ # Use default logging formatter so that PID and timestamp are not suppressed.
79
+ config.log_formatter = ::Logger::Formatter.new
80
+ end
@@ -0,0 +1,36 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = "public, max-age=3600"
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
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+ 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,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # 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,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ Dummy::Application.config.secret_key_base = '1ebf064eee02f29a3b80a7e94690605d8836a0c927b93317e3c795cf4043d4c538c01de4cace0226ad4166d58a1bd221069e71ee5ccf78498f8368251d221246'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
@@ -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] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount StripeLocal::Engine => "/stripe_local"
4
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,11 @@
1
+ class CreateClients < ActiveRecord::Migration
2
+ def change
3
+ create_table :clients do |t|
4
+ t.string :name
5
+ t.string :email
6
+ t.string :password
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddStripeCustomerIdToClients < ActiveRecord::Migration
2
+ def change
3
+ add_column :clients, :stripe_customer_id, :string
4
+ end
5
+ end
@@ -0,0 +1,236 @@
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 that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20131122104223) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "clients", force: true do |t|
20
+ t.string "name"
21
+ t.string "email"
22
+ t.string "password"
23
+ t.datetime "created_at"
24
+ t.datetime "updated_at"
25
+ t.string "stripe_customer_id"
26
+ end
27
+
28
+ create_table "stripe_local_balances", force: true do |t|
29
+ t.integer "available"
30
+ t.integer "pending"
31
+ t.datetime "created_at"
32
+ t.datetime "updated_at"
33
+ end
34
+
35
+ create_table "stripe_local_cards", id: false, force: true do |t|
36
+ t.string "id"
37
+ t.string "customer_id"
38
+ t.string "name"
39
+ t.integer "exp_month"
40
+ t.integer "exp_year"
41
+ t.string "brand"
42
+ t.string "last4"
43
+ t.string "cvc_check"
44
+ t.datetime "created_at"
45
+ t.datetime "updated_at"
46
+ end
47
+
48
+ add_index "stripe_local_cards", ["customer_id"], name: "index_stripe_local_cards_on_customer_id", using: :btree
49
+ add_index "stripe_local_cards", ["id"], name: "index_stripe_local_cards_on_id", unique: true, using: :btree
50
+
51
+ create_table "stripe_local_charges", id: false, force: true do |t|
52
+ t.string "id"
53
+ t.string "card_id"
54
+ t.string "customer_id"
55
+ t.string "invoice_id"
56
+ t.string "transaction_id"
57
+ t.integer "amount"
58
+ t.boolean "captured", default: true
59
+ t.boolean "refunded", default: false
60
+ t.boolean "paid"
61
+ t.datetime "created"
62
+ t.string "currency", default: "usd"
63
+ t.integer "amount_refunded", default: 0
64
+ t.string "description"
65
+ t.string "failure_code"
66
+ t.string "failure_message"
67
+ t.text "metadata"
68
+ t.datetime "created_at"
69
+ t.datetime "updated_at"
70
+ end
71
+
72
+ add_index "stripe_local_charges", ["card_id"], name: "index_stripe_local_charges_on_card_id", using: :btree
73
+ add_index "stripe_local_charges", ["customer_id"], name: "index_stripe_local_charges_on_customer_id", using: :btree
74
+ add_index "stripe_local_charges", ["id"], name: "index_stripe_local_charges_on_id", unique: true, using: :btree
75
+ add_index "stripe_local_charges", ["invoice_id"], name: "index_stripe_local_charges_on_invoice_id", using: :btree
76
+ add_index "stripe_local_charges", ["transaction_id"], name: "index_stripe_local_charges_on_transaction_id", using: :btree
77
+
78
+ create_table "stripe_local_coupons", id: false, force: true do |t|
79
+ t.string "id"
80
+ t.integer "percent_off"
81
+ t.integer "amount_off"
82
+ t.string "currency", default: "usd"
83
+ t.string "duration"
84
+ t.datetime "redeem_by"
85
+ t.integer "max_redemptions"
86
+ t.integer "times_redeemed", default: 0
87
+ t.integer "duration_in_months"
88
+ t.boolean "synced", default: false
89
+ t.datetime "created_at"
90
+ t.datetime "updated_at"
91
+ end
92
+
93
+ add_index "stripe_local_coupons", ["id"], name: "index_stripe_local_coupons_on_id", unique: true, using: :btree
94
+
95
+ create_table "stripe_local_customers", id: false, force: true do |t|
96
+ t.string "id"
97
+ t.integer "account_balance"
98
+ t.string "default_card"
99
+ t.boolean "delinquent"
100
+ t.string "description"
101
+ t.string "email"
102
+ t.text "metadata"
103
+ t.datetime "created_at"
104
+ t.datetime "updated_at"
105
+ end
106
+
107
+ add_index "stripe_local_customers", ["id"], name: "index_stripe_local_customers_on_id", unique: true, using: :btree
108
+
109
+ create_table "stripe_local_discounts", force: true do |t|
110
+ t.string "coupon_id"
111
+ t.string "subscription_id"
112
+ t.datetime "start"
113
+ t.datetime "end"
114
+ t.datetime "created_at"
115
+ t.datetime "updated_at"
116
+ end
117
+
118
+ add_index "stripe_local_discounts", ["coupon_id", "subscription_id"], name: "index_stripe_local_discounts_on_coupon_id_and_subscription_id", using: :btree
119
+
120
+ create_table "stripe_local_invoices", id: false, force: true do |t|
121
+ t.string "id"
122
+ t.string "customer_id"
123
+ t.integer "amount_due"
124
+ t.integer "subtotal"
125
+ t.integer "total"
126
+ t.boolean "attempted"
127
+ t.integer "attempt_count"
128
+ t.boolean "paid"
129
+ t.boolean "closed"
130
+ t.datetime "date"
131
+ t.datetime "period_start"
132
+ t.datetime "period_end"
133
+ t.string "currency", default: "usd"
134
+ t.integer "starting_balance"
135
+ t.integer "ending_balance"
136
+ t.string "charge_id"
137
+ t.integer "discount", default: 0
138
+ t.integer "application_fee"
139
+ t.datetime "next_payment_attempt"
140
+ t.datetime "created_at"
141
+ t.datetime "updated_at"
142
+ end
143
+
144
+ add_index "stripe_local_invoices", ["customer_id"], name: "index_stripe_local_invoices_on_customer_id", using: :btree
145
+ add_index "stripe_local_invoices", ["id"], name: "index_stripe_local_invoices_on_id", unique: true, using: :btree
146
+
147
+ create_table "stripe_local_line_items", id: false, force: true do |t|
148
+ t.string "id"
149
+ t.string "invoice_id"
150
+ t.boolean "subscription", default: true
151
+ t.integer "amount"
152
+ t.string "currency", default: "usd"
153
+ t.boolean "proration"
154
+ t.datetime "period_start"
155
+ t.datetime "period_end"
156
+ t.integer "quantity"
157
+ t.string "plan_id"
158
+ t.string "description"
159
+ t.text "metadata"
160
+ t.datetime "created_at"
161
+ t.datetime "updated_at"
162
+ end
163
+
164
+ add_index "stripe_local_line_items", ["id"], name: "index_stripe_local_line_items_on_id", unique: true, using: :btree
165
+ add_index "stripe_local_line_items", ["invoice_id"], name: "index_stripe_local_line_items_on_invoice_id", using: :btree
166
+
167
+ create_table "stripe_local_plans", id: false, force: true do |t|
168
+ t.string "id"
169
+ t.string "name"
170
+ t.integer "amount"
171
+ t.string "interval"
172
+ t.integer "interval_count", default: 1
173
+ t.integer "trial_period_days", default: 0
174
+ t.string "currency", default: "usd"
175
+ t.boolean "synced", default: false
176
+ t.datetime "created_at"
177
+ t.datetime "updated_at"
178
+ end
179
+
180
+ add_index "stripe_local_plans", ["id"], name: "index_stripe_local_plans_on_id", unique: true, using: :btree
181
+
182
+ create_table "stripe_local_subscriptions", force: true do |t|
183
+ t.string "customer_id"
184
+ t.string "plan_id"
185
+ t.string "status"
186
+ t.integer "quantity", default: 1
187
+ t.datetime "start"
188
+ t.datetime "canceled_at"
189
+ t.datetime "ended_at"
190
+ t.datetime "current_period_start"
191
+ t.datetime "current_period_end"
192
+ t.datetime "trial_start"
193
+ t.datetime "trial_end"
194
+ t.datetime "created_at"
195
+ t.datetime "updated_at"
196
+ end
197
+
198
+ add_index "stripe_local_subscriptions", ["customer_id"], name: "index_stripe_local_subscriptions_on_customer_id", using: :btree
199
+ add_index "stripe_local_subscriptions", ["plan_id"], name: "index_stripe_local_subscriptions_on_plan_id", using: :btree
200
+
201
+ create_table "stripe_local_transactions", id: false, force: true do |t|
202
+ t.string "id"
203
+ t.integer "amount"
204
+ t.datetime "available_on"
205
+ t.datetime "created"
206
+ t.integer "fee"
207
+ t.integer "net"
208
+ t.string "source_id"
209
+ t.string "source_type"
210
+ t.string "status"
211
+ t.string "description"
212
+ t.datetime "created_at"
213
+ t.datetime "updated_at"
214
+ end
215
+
216
+ add_index "stripe_local_transactions", ["id"], name: "index_stripe_local_transactions_on_id", unique: true, using: :btree
217
+ add_index "stripe_local_transactions", ["source_id", "source_type"], name: "index_transactions_on_source_id_and_source_type", using: :btree
218
+ add_index "stripe_local_transactions", ["status"], name: "index_stripe_local_transactions_on_status", using: :btree
219
+
220
+ create_table "stripe_local_transfers", id: false, force: true do |t|
221
+ t.string "id"
222
+ t.integer "amount"
223
+ t.datetime "date"
224
+ t.string "status"
225
+ t.string "transaction_id"
226
+ t.string "description"
227
+ t.text "metadata"
228
+ t.datetime "created_at"
229
+ t.datetime "updated_at"
230
+ end
231
+
232
+ add_index "stripe_local_transfers", ["id"], name: "index_stripe_local_transfers_on_id", unique: true, using: :btree
233
+ add_index "stripe_local_transfers", ["status"], name: "index_stripe_local_transfers_on_status", using: :btree
234
+ add_index "stripe_local_transfers", ["transaction_id"], name: "index_stripe_local_transfers_on_transaction_id", using: :btree
235
+
236
+ end