caboose-cms 0.9.161 → 0.9.162

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d46a35b3b0506567f3ed44550b5a69f472c84451
4
- data.tar.gz: 01c3d0d3e9212ab3955a79c558b336b6457365f4
3
+ metadata.gz: 4ff8dda14d423d69c0f37041dd91c1c9b498c034
4
+ data.tar.gz: 03480f6f6c4f63ef1910c67ace85ab45fa0a1226
5
5
  SHA512:
6
- metadata.gz: d1a0adefb331e52d46c3b615bdf1de93485a0ddd2ac3f9c5447a0d94c274337ff84dd90ce530f0a41b233b5e944894454793e0b798e04db371f4c297bb582b91
7
- data.tar.gz: 74d54aa2905acdff4dd3ef1626f8d6a5e456042a81bffabb236a3ad9a46df93bf109b7e5295e299acef7b10601b0ab3a37a31f50e205676ded7ed35834b527b8
6
+ metadata.gz: 3d63c0cf3d69878011d13c713f5c98ccfac32dae72779fbe65da3feb032ad92c9227eede09247459f4bf03e558e9aacd61986ef3a0818c5c1fc467ca7a441fe6
7
+ data.tar.gz: bc77eba4793bb58fcac02e94ffb721ccac93f03548ce788af3fd6e80e265950fbf78677009f18647ac19f1735eaecd38ee0cbe29777fb52bb2818b7445c40d4a
@@ -3,7 +3,8 @@ var StripePaymentMethodController = function(params) { this.init(params); };
3
3
 
4
4
  StripePaymentMethodController.prototype = {
5
5
 
6
- container: 'payment_method_container',
6
+ container: 'payment_method_container',
7
+ user_id: false,
7
8
  stripe_key: false,
8
9
  customer_id: false,
9
10
  card_brand: false,
@@ -195,7 +196,7 @@ StripePaymentMethodController.prototype = {
195
196
  }
196
197
  $('#payment_message').html("<p class='loading'>Removing payment method...</p>");
197
198
  $.ajax({
198
- url: '/checkout/payment-method',
199
+ url: '/checkout/payment-method/' + that.user_id,
199
200
  type: 'delete',
200
201
  success: function(resp) {
201
202
  if (resp.error)
@@ -163,20 +163,20 @@ module Caboose
163
163
  :card_exp_year => u.card_exp_year
164
164
  }
165
165
  end
166
-
166
+
167
167
  # @route DELETE /checkout/payment-method
168
+ # @route DELETE /checkout/payment-method/:user_id
168
169
  def remove_payment_method
169
170
  render :json => false and return if !logged_in?
170
-
171
171
  resp = Caboose::StdClass.new
172
172
  sc = @site.store_config
173
173
  if sc.pp_name == 'stripe'
174
174
  Stripe.api_key = sc.stripe_secret_key.strip
175
- u = logged_in_user
175
+ u = params[:user_id].blank? ? logged_in_user : Caboose::User.find(params[:user_id])
176
176
  if u.stripe_customer_id
177
177
  begin
178
178
  c = Stripe::Customer.retrieve(u.stripe_customer_id)
179
- c.delete
179
+ c.delete if Rails.env.production?
180
180
  rescue Exception => ex
181
181
  Caboose.log(ex)
182
182
  resp.error = ex.message if !ex.message.starts_with?('No such customer')
@@ -324,6 +324,17 @@ module Caboose
324
324
  @edituser = User.find(params[:id])
325
325
  @new_value = "Testing"
326
326
  end
327
+
328
+ # @route DELETE /admin/users/bulk
329
+ def admin_bulk_delete
330
+ return unless user_is_allowed_to 'delete', 'users'
331
+ params[:model_ids].each do |user_id|
332
+ user = User.where(:id => user_id).first
333
+ user.destroy if user
334
+ end
335
+ resp = Caboose::StdClass.new('success' => true)
336
+ render :json => resp
337
+ end
327
338
 
328
339
  # @route DELETE /admin/users/:id
329
340
  def admin_delete
@@ -42,6 +42,7 @@ $(document).ready(function() {
42
42
  invoice: { total: 1.00 },
43
43
  print_ready_message: function() {},
44
44
  },
45
+ user_id: <%= @edituser.id %>,
45
46
  refresh_url: '/admin/users/<%= @edituser.id %>/stripe/json',
46
47
  after_update_url: '/admin/users/<%= @edituser.id %>'
47
48
  });
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.161'
2
+ VERSION = '0.9.162'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.161
4
+ version: 0.9.162
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-14 00:00:00.000000000 Z
11
+ date: 2018-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg