effective_orders 1.8.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +150 -60
  4. data/Rakefile +0 -3
  5. data/active_admin/effective_orders.rb +14 -9
  6. data/app/assets/javascripts/effective_orders.js +2 -0
  7. data/app/assets/javascripts/effective_orders/{stripe_charges.js.coffee → providers/stripe_charges.js.coffee} +1 -1
  8. data/app/assets/javascripts/effective_orders/{stripe_subscriptions.js.coffee → providers/stripe_subscriptions.js.coffee} +1 -1
  9. data/app/assets/stylesheets/effective_orders/_order.scss +9 -3
  10. data/app/controllers/admin/orders_controller.rb +87 -3
  11. data/app/controllers/concerns/acts_as_active_admin_controller.rb +2 -1
  12. data/app/controllers/effective/carts_controller.rb +4 -2
  13. data/app/controllers/effective/orders_controller.rb +101 -60
  14. data/app/controllers/effective/providers/app_checkout.rb +10 -2
  15. data/app/controllers/effective/providers/ccbill.rb +34 -0
  16. data/app/controllers/effective/providers/cheque.rb +30 -0
  17. data/app/controllers/effective/providers/moneris.rb +7 -7
  18. data/app/controllers/effective/providers/paypal.rb +7 -5
  19. data/app/controllers/effective/providers/pretend.rb +22 -0
  20. data/app/controllers/effective/providers/stripe.rb +26 -24
  21. data/app/controllers/effective/webhooks_controller.rb +1 -1
  22. data/app/helpers/effective_carts_helper.rb +59 -29
  23. data/app/helpers/effective_ccbill_helper.rb +25 -0
  24. data/app/helpers/effective_orders_helper.rb +50 -41
  25. data/app/helpers/effective_paypal_helper.rb +11 -11
  26. data/app/mailers/effective/orders_mailer.rb +95 -20
  27. data/app/models/concerns/acts_as_purchasable.rb +14 -22
  28. data/app/models/effective/cart.rb +9 -15
  29. data/app/models/effective/cart_item.rb +15 -13
  30. data/app/models/effective/customer.rb +9 -9
  31. data/app/models/effective/datatables/order_items.rb +14 -8
  32. data/app/models/effective/datatables/orders.rb +56 -69
  33. data/app/models/effective/order.rb +250 -139
  34. data/app/models/effective/order_item.rb +23 -16
  35. data/app/models/effective/product.rb +23 -0
  36. data/app/models/effective/providers/ccbill_postback.rb +85 -0
  37. data/app/models/effective/{stripe_charge.rb → providers/stripe_charge.rb} +1 -1
  38. data/app/models/effective/subscription.rb +16 -12
  39. data/app/models/effective/tax_rate_calculator.rb +45 -0
  40. data/app/views/admin/customers/index.html.haml +2 -5
  41. data/app/views/admin/order_items/index.html.haml +2 -5
  42. data/app/views/admin/orders/_actions.html.haml +2 -0
  43. data/app/views/admin/orders/_form.html.haml +28 -0
  44. data/app/views/admin/orders/_order_item_fields.html.haml +9 -0
  45. data/app/views/admin/orders/index.html.haml +9 -5
  46. data/app/views/admin/orders/new.html.haml +3 -0
  47. data/app/views/effective/carts/_cart.html.haml +3 -12
  48. data/app/views/effective/carts/_cart_actions.html.haml +4 -0
  49. data/app/views/effective/carts/show.html.haml +10 -12
  50. data/app/views/effective/orders/_checkout_step1.html.haml +46 -0
  51. data/app/views/effective/orders/_checkout_step2.html.haml +33 -0
  52. data/app/views/effective/orders/_order.html.haml +2 -0
  53. data/app/views/effective/orders/_order_actions.html.haml +10 -5
  54. data/app/views/effective/orders/_order_footer.html.haml +1 -0
  55. data/app/views/effective/orders/_order_items.html.haml +11 -9
  56. data/app/views/effective/orders/_order_note.html.haml +8 -0
  57. data/app/views/effective/orders/_order_note_fields.html.haml +5 -0
  58. data/app/views/effective/orders/_order_shipping.html.haml +4 -4
  59. data/app/views/effective/orders/_order_user_fields.html.haml +1 -0
  60. data/app/views/effective/orders/_orders_table.html.haml +27 -0
  61. data/app/views/effective/orders/ccbill/_form.html.haml +24 -0
  62. data/app/views/effective/orders/checkout_step1.html.haml +3 -0
  63. data/app/views/effective/orders/checkout_step2.html.haml +3 -0
  64. data/app/views/effective/orders/cheque/_form.html.haml +2 -0
  65. data/app/views/effective/orders/cheque/pay_by_cheque.html.haml +9 -0
  66. data/app/views/effective/orders/declined.html.haml +4 -2
  67. data/app/views/effective/orders/my_purchases.html.haml +1 -1
  68. data/app/views/effective/orders/my_sales.html.haml +1 -1
  69. data/app/views/effective/orders/purchased.html.haml +3 -2
  70. data/app/views/effective/orders/show.html.haml +1 -1
  71. data/app/views/effective/orders/stripe/_form.html.haml +5 -5
  72. data/app/views/effective/orders_mailer/order_error.html.haml +11 -0
  73. data/app/views/effective/orders_mailer/payment_request_to_buyer.html.haml +13 -0
  74. data/app/views/effective/orders_mailer/pending_order_invoice_to_buyer.html.haml +13 -0
  75. data/app/views/layouts/effective_orders_mailer_layout.html.haml +7 -7
  76. data/config/routes.rb +39 -24
  77. data/db/migrate/01_create_effective_orders.rb.erb +20 -1
  78. data/db/upgrade/03_upgrade_effective_orders_from1x.rb.erb +95 -0
  79. data/lib/effective_orders.rb +67 -9
  80. data/lib/effective_orders/app_checkout_service.rb +1 -2
  81. data/lib/effective_orders/engine.rb +46 -14
  82. data/lib/effective_orders/version.rb +1 -1
  83. data/lib/generators/effective_orders/install_generator.rb +1 -0
  84. data/lib/generators/effective_orders/upgrade_from03x_generator.rb +1 -0
  85. data/lib/generators/effective_orders/upgrade_from1x_generator.rb +31 -0
  86. data/lib/generators/templates/effective_orders.rb +131 -66
  87. data/lib/generators/templates/effective_orders_mailer_preview.rb +28 -13
  88. data/spec/controllers/admin/orders_controller_spec.rb +242 -0
  89. data/spec/controllers/ccbill_orders_controller_spec.rb +103 -0
  90. data/spec/controllers/moneris_orders_controller_spec.rb +23 -23
  91. data/spec/controllers/orders_controller_spec.rb +167 -79
  92. data/spec/controllers/stripe_orders_controller_spec.rb +7 -7
  93. data/spec/dummy/app/models/product.rb +0 -8
  94. data/spec/dummy/app/models/product_with_float_price.rb +0 -8
  95. data/spec/dummy/app/models/user.rb +2 -19
  96. data/spec/dummy/config/application.rb +2 -1
  97. data/spec/dummy/config/environments/test.rb +1 -0
  98. data/spec/dummy/config/initializers/effective_orders.rb +109 -64
  99. data/spec/dummy/db/schema.rb +15 -2
  100. data/spec/dummy/db/test.sqlite3 +0 -0
  101. data/spec/dummy/log/test.log +0 -258
  102. data/spec/models/acts_as_purchasable_spec.rb +8 -6
  103. data/spec/models/factories_spec.rb +7 -1
  104. data/spec/models/order_item_spec.rb +1 -1
  105. data/spec/models/order_spec.rb +165 -46
  106. data/spec/models/stripe_charge_spec.rb +5 -5
  107. data/spec/spec_helper.rb +2 -0
  108. data/spec/support/factories.rb +49 -33
  109. metadata +47 -64
  110. data/app/views/effective/orders/_checkout_step_1.html.haml +0 -43
  111. data/app/views/effective/orders/_checkout_step_2.html.haml +0 -25
  112. data/app/views/effective/orders/_my_purchases.html.haml +0 -17
  113. data/app/views/effective/orders/checkout.html.haml +0 -3
  114. data/app/views/effective/orders/new.html.haml +0 -4
  115. data/spec/dummy/log/development.log +0 -82
@@ -13,7 +13,7 @@ describe Effective::OrdersController, type: :controller do
13
13
  let(:buyer) { Effective::Customer.for_user(order.user) }
14
14
  let(:token) { stripe_helper.generate_card_token }
15
15
  let(:stripe_charge_params) do
16
- {:effective_stripe_charge => {'effective_order_id' => order.to_param, 'token' => token}}
16
+ {:effective_providers_stripe_charge => {'effective_order_id' => order.to_param, 'token' => token}}
17
17
  end
18
18
 
19
19
  describe '#stripe_charge' do
@@ -24,20 +24,20 @@ describe Effective::OrdersController, type: :controller do
24
24
  describe 'invalid parameters' do
25
25
  it 'raises RecordNotFound when passed an unknown order id' do
26
26
  expect {
27
- post :stripe_charge, stripe_charge_params.tap { |x| x[:effective_stripe_charge]['effective_order_id'] = 999 }
27
+ post :stripe_charge, stripe_charge_params.tap { |x| x[:effective_providers_stripe_charge]['effective_order_id'] = 999 }
28
28
  }.to raise_error(ActiveRecord::RecordNotFound)
29
29
  end
30
30
 
31
31
  it 'renders the :create action on validation failure' do
32
32
  expect(subject).not_to receive(:process_stripe_charge)
33
33
 
34
- post :stripe_charge, stripe_charge_params.tap { |x| x[:effective_stripe_charge]['token'] = nil }
34
+ post :stripe_charge, stripe_charge_params.tap { |x| x[:effective_providers_stripe_charge]['token'] = nil }
35
35
 
36
36
  flash[:danger].downcase.include?('token').should eq true
37
37
  assigns(:stripe_charge).errors[:token].present?.should eq true
38
38
 
39
39
  assigns(:order).purchased?.should eq false
40
- response.should render_template(:checkout)
40
+ response.should render_template(:checkout_step2)
41
41
  end
42
42
  end
43
43
 
@@ -84,7 +84,7 @@ describe Effective::OrdersController, type: :controller do
84
84
  assigns(:order).purchased?.should eq false
85
85
  assigns(:stripe_charge).errors[:base].first.downcase.include?('unable to process order with stripe').should eq true
86
86
  assigns(:stripe_charge).errors[:base].first.downcase.include?('the card was declined').should eq true
87
- response.should render_template(:checkout)
87
+ response.should render_template(:checkout_step2)
88
88
  end
89
89
  end
90
90
  end
@@ -93,9 +93,9 @@ describe Effective::OrdersController, type: :controller do
93
93
  let(:order) { FactoryGirl.create(:order_with_subscription) }
94
94
  let(:buyer) { Effective::Customer.for_user(order.user) }
95
95
  let(:subscription) { order.order_items[1].purchasable }
96
- let(:token) { stripe_helper.generate_card_token }
96
+ let(:token) { stripe_helper.generate_card_token }
97
97
  let(:stripe_charge_params) do
98
- {:effective_stripe_charge => {'effective_order_id' => order.to_param, 'token' => token}}
98
+ {:effective_providers_stripe_charge => {'effective_order_id' => order.to_param, 'token' => token}}
99
99
  end
100
100
 
101
101
  before do
@@ -1,14 +1,6 @@
1
1
  class Product < ActiveRecord::Base
2
2
  acts_as_purchasable
3
3
 
4
- structure do
5
- price :integer, :default => 0
6
- title :string
7
- tax_exempt :boolean
8
-
9
- timestamps
10
- end
11
-
12
4
  after_purchase do |order, order_item|
13
5
  end
14
6
 
@@ -1,14 +1,6 @@
1
1
  class ProductWithFloatPrice < ActiveRecord::Base
2
2
  acts_as_purchasable
3
3
 
4
- structure do
5
- price :decimal, :default => 0.0
6
- title :string
7
- tax_exempt :boolean
8
-
9
- timestamps
10
- end
11
-
12
4
  after_purchase do |order, order_item|
13
5
  end
14
6
 
@@ -5,24 +5,7 @@ class User < ActiveRecord::Base
5
5
 
6
6
  attr_accessor :first_name, :last_name
7
7
 
8
- structure do
9
- # Devise attributes
10
- encrypted_password :string, :validates => [:presence]
11
- reset_password_token :string
12
- reset_password_sent_at :datetime
13
- remember_created_at :datetime
14
- confirmation_sent_at :datetime
15
- confirmed_at :datetime
16
- confirmation_token :string
17
- unconfirmed_email :string
18
- sign_in_count :integer, :default => 0
19
- current_sign_in_at :datetime
20
- last_sign_in_at :datetime
21
- current_sign_in_ip :string
22
- last_sign_in_ip :string
23
-
24
- email :string
25
-
26
- timestamps
8
+ def to_s
9
+ email
27
10
  end
28
11
  end
@@ -6,7 +6,8 @@ Bundler.require(*Rails.groups)
6
6
  require 'devise'
7
7
  require 'haml'
8
8
  require 'effective_addresses'
9
- require "effective_orders"
9
+ require 'effective_orders'
10
+ require 'effective_obfuscation'
10
11
 
11
12
  module Dummy
12
13
  class Application < Rails::Application
@@ -32,4 +32,5 @@ Rails.application.configure do
32
32
 
33
33
  # Raises error for missing translations
34
34
  # config.action_view.raise_on_missing_translations = true
35
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
35
36
  end
@@ -8,6 +8,7 @@ EffectiveOrders.setup do |config|
8
8
  config.cart_items_table_name = :cart_items
9
9
  config.customers_table_name = :customers
10
10
  config.subscriptions_table_name = :subscriptions
11
+ config.products_table_name = :custom_products
11
12
 
12
13
  # Authorization Method
13
14
  #
@@ -55,8 +56,8 @@ EffectiveOrders.setup do |config|
55
56
  # Don't validate_associated :user when saving an Order
56
57
  config.skip_user_validation = false
57
58
 
58
- # Tax Calculation Method
59
- config.tax_rate_method = Proc.new { |acts_as_purchasable| 0.05 } # Regardless of the object, charge 5% tax (GST)
59
+ config.collect_note = true
60
+ config.collect_note_message = 'please enter a note'
60
61
 
61
62
  # Minimum Charge
62
63
  # Prevent orders less than this value from being purchased
@@ -84,6 +85,15 @@ EffectiveOrders.setup do |config|
84
85
  config.allow_pretend_purchase_in_production = false
85
86
  config.allow_pretend_purchase_in_production_message = '* payment information is not required to process this order at this time.'
86
87
 
88
+ # Pay by Cheque
89
+ # Allow user to create pending orders in order to pay for it by cheque offline. Pending orders are not
90
+ # considered purchased and have 'pending' purchase state
91
+ #
92
+ # When true, there will be a 'Pay by Cheque' button on the Checkout screen.
93
+ # Clicking this button will mark an Order pending and redirect the user to the
94
+ # pending order page.
95
+ config.cheque_enabled = true
96
+
87
97
  # Show/hide the 'Order History' button on the 'Cart Page'
88
98
  config.show_order_history_button = true
89
99
 
@@ -92,11 +102,11 @@ EffectiveOrders.setup do |config|
92
102
 
93
103
  # config.layout = 'application' # All EffectiveOrders controllers will use this layout
94
104
  config.layout = {
95
- :carts => 'application',
96
- :orders => 'application',
97
- :subscriptions => 'application',
98
- :admin_customers => 'application',
99
- :admin_orders => 'application'
105
+ carts: 'application',
106
+ orders: 'application',
107
+ subscriptions: 'application',
108
+ admin_customers: 'application',
109
+ admin_orders: 'application'
100
110
  }
101
111
 
102
112
  # SimpleForm Options
@@ -104,12 +114,12 @@ EffectiveOrders.setup do |config|
104
114
  config.simple_form_options = {}
105
115
 
106
116
  # config.simple_form_options = {
107
- # :html => {:class => 'form-horizontal'},
108
- # :wrapper => :horizontal_form,
109
- # :wrapper_mappings => {
110
- # :boolean => :horizontal_boolean,
111
- # :check_boxes => :horizontal_radio_and_checkboxes,
112
- # :radio_buttons => :horizontal_radio_and_checkboxes
117
+ # html: {class: 'form-horizontal'},
118
+ # wrapper: :horizontal_form,
119
+ # wrapper_mappings: {
120
+ # boolean: :horizontal_boolean,
121
+ # check_boxes: :horizontal_radio_and_checkboxes,
122
+ # radio_buttons: :horizontal_radio_and_checkboxes
113
123
  # }
114
124
  # }
115
125
 
@@ -117,29 +127,35 @@ EffectiveOrders.setup do |config|
117
127
  # effective_orders will send out receipts to the buyer, seller and admins.
118
128
  # For all the emails, the same :subject_prefix will be prefixed. Leave as nil / empty string if you don't want any prefix
119
129
  #
120
- # The subject_for_admin_receipt, subject_for_buyer_receipt and subject_for_seller_receipt can be one of:
130
+ # The subject_for_admin_receipt, subject_for_buyer_receipt, subject_for_payment_request and
131
+ # subject_for_seller_receipt can be one of:
121
132
  # - nil / empty string to use the built in defaults
122
133
  # - A string with the full subject line for this email
123
134
  # - A Proc to create the subject line based on the email
124
135
  # In all three of these cases, the subject_prefix will still be used.
125
136
 
126
137
  # The Procs are the same for admin & buyer receipt, the seller Proc is different
127
- # :subject_for_admin_receipt => Proc.new { |order| "Order #{order.to_param} has been purchased"}
128
- # :subject_for_buyer_receipt => Proc.new { |order| "Order #{order.to_param} has been purchased"}
129
- # :subject_for_seller_receipt => Proc.new { |order, order_items, seller| "Order #{order.to_param} has been purchased"}
138
+ # subject_for_admin_receipt: Proc.new { |order| "Order #{order.to_param} has been purchased"}
139
+ # subject_for_buyer_receipt: Proc.new { |order| "Order #{order.to_param} has been purchased"}
140
+ # subject_for_payment_request: Proc.new { |order| "Pending Order #{order.to_param}"}
141
+ # subject_for_seller_receipt: Proc.new { |order, order_items, seller| "Order #{order.to_param} has been purchased"}
130
142
 
131
143
  config.mailer = {
132
- :send_order_receipt_to_admin => true,
133
- :send_order_receipt_to_buyer => true,
134
- :send_order_receipt_to_seller => true, # Only applies to StripeConnect
135
- :admin_email => 'admin@example.com',
136
- :default_from => 'info@example.com',
137
- :subject_prefix => '[example]',
138
- :subject_for_admin_receipt => '',
139
- :subject_for_buyer_receipt => '',
140
- :subject_for_seller_receipt => '',
141
- :deliver_method => :deliver_now,
142
- :delayed_job_deliver => false
144
+ send_order_receipt_to_admin: true,
145
+ send_order_receipt_to_buyer: true,
146
+ send_payment_request_to_buyer: true,
147
+ send_order_receipts_when_marked_paid_by_admin: false,
148
+ send_order_receipt_to_seller: true, # Only applies to StripeConnect
149
+ layout: 'effective_orders_mailer_layout',
150
+ admin_email: 'admin@example.com',
151
+ default_from: 'info@example.com',
152
+ subject_prefix: '[example]',
153
+ subject_for_admin_receipt: '',
154
+ subject_for_buyer_receipt: '',
155
+ subject_for_payment_request: '',
156
+ subject_for_seller_receipt: '',
157
+ deliver_method: nil,
158
+ delayed_job_deliver: false
143
159
  }
144
160
 
145
161
  # Moneris configuration
@@ -147,17 +163,17 @@ EffectiveOrders.setup do |config|
147
163
 
148
164
  if Rails.env.production?
149
165
  config.moneris = {
150
- :ps_store_id => '',
151
- :hpp_key => '',
152
- :hpp_url => 'https://www3.moneris.com/HPPDP/index.php',
153
- :verify_url => 'https://www3.moneris.com/HPPDP/verifyTxn.php'
166
+ ps_store_id: '',
167
+ hpp_key: '',
168
+ hpp_url: 'https://www3.moneris.com/HPPDP/index.php',
169
+ verify_url: 'https://www3.moneris.com/HPPDP/verifyTxn.php'
154
170
  }
155
171
  else
156
172
  config.moneris = {
157
- :ps_store_id => 'foo',
158
- :hpp_key => 'bar',
159
- :hpp_url => 'https://esqa.moneris.com/HPPDP/index.php',
160
- :verify_url => 'https://esqa.moneris.com/HPPDP/verifyTxn.php'
173
+ ps_store_id: 'foo',
174
+ hpp_key: 'bar',
175
+ hpp_url: 'https://esqa.moneris.com/HPPDP/index.php',
176
+ verify_url: 'https://esqa.moneris.com/HPPDP/verifyTxn.php'
161
177
  }
162
178
  end
163
179
 
@@ -166,25 +182,25 @@ EffectiveOrders.setup do |config|
166
182
 
167
183
  if Rails.env.production?
168
184
  config.paypal = {
169
- :seller_email => '',
170
- :secret => '',
171
- :cert_id => '',
172
- :paypal_url => 'https://www.paypal.com/cgi-bin/webscr',
173
- :currency => 'CAD',
174
- :paypal_cert => "#{Rails.root}/config/paypalcerts/production/paypal_cert.pem",
175
- :app_cert => "#{Rails.root}/config/paypalcerts/production/app_cert.pem",
176
- :app_key => "#{Rails.root}/config/paypalcerts/production/app_key.pem"
185
+ seller_email: '',
186
+ secret: '',
187
+ cert_id: '',
188
+ paypal_url: 'https://www.paypal.com/cgi-bin/webscr',
189
+ currency: 'CAD',
190
+ paypal_cert: "#{Rails.root}/config/paypalcerts/production/paypal_cert.pem",
191
+ app_cert: "#{Rails.root}/config/paypalcerts/production/app_cert.pem",
192
+ app_key: "#{Rails.root}/config/paypalcerts/production/app_key.pem"
177
193
  }
178
194
  else
179
195
  config.paypal = {
180
- :seller_email => 'seller@mail.com',
181
- :secret => 'foo',
182
- :cert_id => 'bar',
183
- :paypal_url => 'https://www.sandbox.paypal.com/cgi-bin/webscr',
184
- :currency => 'CAD',
185
- :paypal_cert => "#{Rails.root}/config/paypalcerts/#{Rails.env}/paypal_cert.pem",
186
- :app_cert => "#{Rails.root}/config/paypalcerts/#{Rails.env}/app_cert.pem",
187
- :app_key => "#{Rails.root}/config/paypalcerts/#{Rails.env}/app_key.pem"
196
+ seller_email: 'seller@mail.com',
197
+ secret: 'foo',
198
+ cert_id: 'bar',
199
+ paypal_url: 'https://www.sandbox.paypal.com/cgi-bin/webscr',
200
+ currency: 'CAD',
201
+ paypal_cert: "#{Rails.root}/config/paypalcerts/#{Rails.env}/paypal_cert.pem",
202
+ app_cert: "#{Rails.root}/config/paypalcerts/#{Rails.env}/app_cert.pem",
203
+ app_key: "#{Rails.root}/config/paypalcerts/#{Rails.env}/app_key.pem"
188
204
  }
189
205
  end
190
206
 
@@ -196,21 +212,50 @@ EffectiveOrders.setup do |config|
196
212
 
197
213
  if Rails.env.production?
198
214
  config.stripe = {
199
- :secret_key => '',
200
- :publishable_key => '',
201
- :currency => 'usd',
202
- :site_title => 'My Site',
203
- :site_image => '', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
204
- :connect_client_id => ''
215
+ secret_key: '',
216
+ publishable_key: '',
217
+ currency: 'usd',
218
+ site_title: 'My Site',
219
+ site_image: '', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
220
+ connect_client_id: ''
205
221
  }
206
222
  else
207
223
  config.stripe = {
208
- :secret_key => 'foo',
209
- :publishable_key => 'bar',
210
- :currency => 'usd',
211
- :site_title => 'My Development Site', # Displayed on the Embedded Stripe Form
212
- :site_image => 'foo', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
213
- :connect_client_id => 'bar'
224
+ secret_key: 'foo',
225
+ publishable_key: 'bar',
226
+ currency: 'usd',
227
+ site_title: 'My Development Site', # Displayed on the Embedded Stripe Form
228
+ site_image: 'foo', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
229
+ connect_client_id: 'bar'
230
+ }
231
+ end
232
+
233
+ # CCBill configuration
234
+ config.ccbill_enabled = true
235
+
236
+ # CCBill Dynamic Pricing documentation describes these variables:
237
+ # https://www.ccbill.com/cs/wiki/tiki-index.php?page=Dynamic+Pricing+User+Guide
238
+ if Rails.env.production?
239
+ config.ccbill = {
240
+ client_accnum: '',
241
+ client_subacc: '',
242
+ # Get this from CCBill Admin dashboard after setting up a form
243
+ form_name: '',
244
+ form_period: '',
245
+ # https://www.ccbill.com/cs/wiki/tiki-index.php?page=Webhooks+User+Guide#Appendix_A:_Currency_Codes
246
+ currency_code: '',
247
+ # You'll get this salt value from CCBill tech support
248
+ # https://www.ccbill.com/cs/wiki/tiki-index.php?page=Dynamic+Pricing+User+Guide#Generating_the_MD5_Hash
249
+ dynamic_pricing_salt: ''
250
+ }
251
+ else
252
+ config.ccbill = {
253
+ client_accnum: 'foo',
254
+ client_subacc: 'bar',
255
+ form_name: 'foo',
256
+ form_period: 'bar',
257
+ currency_code: 'foo',
258
+ dynamic_pricing_salt: 'bar'
214
259
  }
215
260
  end
216
261
 
@@ -52,6 +52,14 @@ ActiveRecord::Schema.define(:version => 4) do
52
52
 
53
53
  add_index "carts", ["user_id"], :name => "index_carts_on_user_id"
54
54
 
55
+ create_table "custom_products", force: :true do |t|
56
+ t.string "title"
57
+ t.integer "price", default: 0
58
+ t.boolean "tax_exempt"
59
+ t.datetime "created_at"
60
+ t.datetime "updated_at"
61
+ end
62
+
55
63
  create_table "customers", force: true do |t|
56
64
  t.integer "user_id"
57
65
  t.string "stripe_customer_id"
@@ -70,7 +78,6 @@ ActiveRecord::Schema.define(:version => 4) do
70
78
  t.integer "quantity"
71
79
  t.integer "price", :default => 0
72
80
  t.boolean "tax_exempt"
73
- t.decimal "tax_rate", :precision => 5, :scale => 3, :default => 0.0
74
81
  t.datetime "created_at", :null => false
75
82
  t.datetime "updated_at", :null => false
76
83
  end
@@ -84,9 +91,15 @@ ActiveRecord::Schema.define(:version => 4) do
84
91
  t.string "purchase_state"
85
92
  t.datetime "purchased_at"
86
93
  t.text "payment"
87
- t.text "details"
88
94
  t.datetime "created_at", :null => false
89
95
  t.datetime "updated_at", :null => false
96
+ t.text "note"
97
+ t.integer "total"
98
+ t.decimal "tax_rate", precision: 6, scale: 3
99
+ t.integer "subtotal"
100
+ t.integer "tax"
101
+ t.string "payment_provider"
102
+ t.string "payment_card"
90
103
  end
91
104
 
92
105
  add_index "orders", ["user_id"], :name => "index_orders_on_user_id"
Binary file
@@ -1,261 +1,3 @@
1
-  (0.5ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
2
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
3
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
4
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
5
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
6
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
7
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
8
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
9
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
10
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
11
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
12
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
13
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
14
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
15
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
16
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
17
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
18
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
19
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
20
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
21
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
22
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
23
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
24
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
25
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
26
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
27
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
28
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
29
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
30
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
31
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
32
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
33
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
34
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
35
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
36
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
37
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
38
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
39
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
40
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
41
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
42
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
43
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
44
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
45
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
46
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
47
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
48
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
49
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
50
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
51
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
52
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
53
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
54
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
55
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
56
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
57
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
58
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
59
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
60
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
61
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
62
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
63
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
64
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
65
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
66
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
67
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
68
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
69
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
70
-  (0.5ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
71
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
72
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
73
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
74
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
75
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
76
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
77
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
78
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
79
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
80
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
81
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
82
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
83
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
84
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
85
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
86
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
87
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
88
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
89
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
90
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
91
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
92
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
93
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
94
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
95
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
96
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
97
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
98
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
99
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
100
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
101
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
102
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
103
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
104
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
105
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
106
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
107
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
108
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
109
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
110
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
111
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
112
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
113
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
114
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
115
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
116
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
117
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
118
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
119
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
120
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
121
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
122
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
123
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
124
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
125
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
126
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
127
1
   (0.5ms) SELECT MAX("orders"."id") FROM "orders"
128
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
129
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
130
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
131
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
132
2
   (0.5ms) SELECT MAX("orders"."id") FROM "orders"
133
3
   (0.2ms) SELECT MAX("orders"."id") FROM "orders"
134
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
135
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
136
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
137
-  (0.4ms) SELECT MAX("orders"."id") FROM "orders"
138
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
139
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
140
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
141
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
142
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
143
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
144
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
145
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
146
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
147
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
148
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
149
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
150
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
151
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
152
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
153
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
154
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
155
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
156
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
157
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
158
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
159
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
160
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
161
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
162
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
163
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
164
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
165
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
166
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
167
-  (0.4ms) SELECT MAX("orders"."id") FROM "orders"
168
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
169
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
170
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
171
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
172
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
173
-  (0.4ms) SELECT MAX("orders"."id") FROM "orders"
174
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
175
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
176
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
177
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
178
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
179
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
180
-  (0.1ms) SELECT MAX("orders"."id") FROM "orders"
181
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
182
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
183
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
184
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
185
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
186
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
187
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
188
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
189
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
190
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
191
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
192
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
193
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
194
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
195
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
196
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
197
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
198
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
199
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
200
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
201
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
202
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
203
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
204
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
205
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
206
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
207
-  (0.4ms) SELECT MAX("orders"."id") FROM "orders"
208
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
209
-  (0.4ms) SELECT MAX("orders"."id") FROM "orders"
210
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
211
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
212
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
213
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
214
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
215
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
216
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
217
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
218
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
219
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
220
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
221
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
222
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
223
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
224
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
225
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
226
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
227
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
228
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
229
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
230
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
231
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
232
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
233
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
234
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
235
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
236
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
237
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
238
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
239
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
240
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
241
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
242
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
243
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
244
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
245
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
246
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
247
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
248
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
249
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
250
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
251
-  (0.4ms) SELECT MAX("orders"."id") FROM "orders"
252
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
253
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
254
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
255
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
256
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
257
-  (0.3ms) SELECT MAX("orders"."id") FROM "orders"
258
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
259
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
260
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"
261
-  (0.2ms) SELECT MAX("orders"."id") FROM "orders"