caboose-store 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTUzNTdjNzIyNGQwN2ZiZjM4YjAwMzg5MDY0OTAzYWRhZWNkYzEwYg==
4
+ NDM5ZTA5YWU5NTc4NjAwOTA1NzE3Y2E4ZGIyNDFhMDZjNWRiYmYyMA==
5
5
  data.tar.gz: !binary |-
6
- YzI2NWMxYTYzNDlmNWJjM2I1MzlhMzc3NzZmMWNhYTdjMDU1YmI0Yg==
6
+ NzFkMGQxNDFlNTljMmIwYmNiOWYwZTMzMDM3NDY0NjA3MTE1YzlhYg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NGZlZjFiMDA0YzNlNDIzNjIzMGFiMzdkM2U3YzE3ZDA5M2M2ZWI0ZDc1ODM3
10
- MDk2ZWVkNzZmOTU0MjQ4NDFkZTBlNGIwYzQ2Yzc0NmRjYzMxMTY1YWEzODEx
11
- ZGE5YjgyMjIyMTY4NGE4MmViYjQ4ODkwMDk4NmE1NjZiMjk0Y2M=
9
+ MWYzZDU0NzQ1NzJkOGRmMTJhZjhmYWI5OTIzNWViOTU3MDNkODA2NDIwZWM4
10
+ NjBlNDZiOGZlM2FlYjUwNGZkY2E2NjBjNDgxY2YzZGQxYTdlYmRmYzIxMTAz
11
+ ZDE4OGNiMWQ1YjAwYWMwMWJmMzY5M2YwZjgwMjA3OGQyZDA1N2Q=
12
12
  data.tar.gz: !binary |-
13
- MzY3MDE2NDMzNjY4OTdiYWJkMGU4ZWNiNDY3ZWVlYWQyY2I0ZjNlYjE5OTdk
14
- NTg3ODMzOWUzYTRiOTY0ZDRkNDJhYjQxYzZiMDZjYzMyMjA5Yjk4NDdkNTYw
15
- Njg5MzFmYTEyM2I5NmI2MDFjZjk1ZWNmZTI1MmY4ZGZmN2U2Zjc=
13
+ NTcxOTllMGZjOTY3ZjExZjkyNWE1YWJmZmMyNWI4MzkyNWUxMzU4ZjMyYzk2
14
+ ZTMzNWUyOGYwNjc3YTY5N2Y0ZGIwOWFmODZhY2M0N2MzNzI5OWYwNzQ5NDRj
15
+ MDM4OWY2NTY5NWM4MjVmZWQ5MjI2MjI5YjE2ODU0YWY1YmM1MjM=
@@ -36,16 +36,15 @@ Caboose.Store.Modules.CheckoutStep1 = (function() {
36
36
  //
37
37
 
38
38
  self.bindEventHandlers = function() {
39
- self.$checkout.on('click' , '[data-login-action]', self.loginClickHandler);
40
- self.$checkout.on('submit', '#checkout-login form', self.loginSubmitHandler);
41
- self.$checkout.on('click' , '#checkout-continue button', self.continueHandler);
42
-
39
+ self.$checkout.on('click' , '[data-login-action]', self.login_click_handler);
40
+ //self.$checkout.on('submit', '#checkout-login form', self.login_submit_handler);
41
+ //self.$checkout.on('click' , '#checkout-continue button', self.continue_handler);
43
42
  $('#signin_form' ).submit(self.login_form_submit_handler);
44
43
  $('#register_form').submit(self.register_form_submit_handler);
45
44
  $('#guest_form' ).submit(self.guest_form_submit_handler);
46
45
  };
47
46
 
48
- self.loginClickHandler = function(event) {
47
+ self.login_click_handler = function(event) {
49
48
  var form = $(event.target).data('login-action');
50
49
  if (self.current_form && form == self.current_form)
51
50
  return;
@@ -64,52 +63,52 @@ Caboose.Store.Modules.CheckoutStep1 = (function() {
64
63
  self.current_form = form;
65
64
  };
66
65
 
67
- self.loginSubmitHandler = function(event) {
68
- event.preventDefault();
69
- var $form = $(event.target);
70
-
71
- $.ajax({
72
- type: $form.attr('method'),
73
- url: $form.attr('action'),
74
- data: $form.serialize(),
75
- success: function(response) {
76
- if (response.error || (response.errors && response.errors.length > 0)) {
77
- if ($form.find('.message').length) {
78
- $form.find('.message').empty().addClass('error').text(response.error || response.errors[0]);
79
- } else {
80
- $form.append($('<span/>').addClass('message error').text(response.error || response.errors[0]));
81
- }
82
- } else {
83
- if (response.logged_in) {
84
- self.$login.after($('<p/>').addClass('alert').text('You are now signed in').css('text-align', 'center')).remove();
85
- $.post('/checkout/attach-user');
86
- } else {
87
- self.$login.after($('<p/>').addClass('alert').text('Email successfully saved').css('text-align', 'center')).remove();
88
- }
89
- }
90
-
91
- self.fetch(self.render);
92
- }
93
- });
94
- };
66
+ //self.login_submit_handler = function(event) {
67
+ // event.preventDefault();
68
+ // var $form = $(event.target);
69
+ //
70
+ // $.ajax({
71
+ // type: $form.attr('method'),
72
+ // url: $form.attr('action'),
73
+ // data: $form.serialize(),
74
+ // success: function(response) {
75
+ // if (response.error || (response.errors && response.errors.length > 0)) {
76
+ // if ($form.find('.message').length) {
77
+ // $form.find('.message').empty().addClass('error').text(response.error || response.errors[0]);
78
+ // } else {
79
+ // $form.append($('<span/>').addClass('message error').text(response.error || response.errors[0]));
80
+ // }
81
+ // } else {
82
+ // if (response.logged_in) {
83
+ // self.$login.after($('<p/>').addClass('alert').text('You are now signed in').css('text-align', 'center')).remove();
84
+ // $.post('/checkout/attach-user');
85
+ // } else {
86
+ // self.$login.after($('<p/>').addClass('alert').text('Email successfully saved').css('text-align', 'center')).remove();
87
+ // }
88
+ // }
89
+ //
90
+ // self.fetch(self.render);
91
+ // }
92
+ // });
93
+ //};
95
94
 
96
- self.continueHandler = function(event) {
97
- $form = self.$address.find('form');
98
-
99
- $.ajax({
100
- type: $form.attr('method'),
101
- url: $form.attr('action'),
102
- data: $form.serialize(),
103
- success: function(response) {
104
- if (response.success) {
105
- window.location = '/checkout/step-two';
106
- } else {
107
- $form.find('.message').remove();
108
- $form.find('#' + response.address + ' h3').append($('<span/>').addClass('message error').text(response.errors[0]));
109
- }
110
- }
111
- });
112
- };
95
+ //self.continueHandler = function(event) {
96
+ // $form = self.$address.find('form');
97
+ //
98
+ // $.ajax({
99
+ // type: $form.attr('method'),
100
+ // url: $form.attr('action'),
101
+ // data: $form.serialize(),
102
+ // success: function(response) {
103
+ // if (response.success) {
104
+ // window.location = '/checkout/step-two';
105
+ // } else {
106
+ // $form.find('.message').remove();
107
+ // $form.find('#' + response.address + ' h3').append($('<span/>').addClass('message error').text(response.errors[0]));
108
+ // }
109
+ // }
110
+ // });
111
+ //};
113
112
 
114
113
  self.login_form_submit_handler = function(event) {
115
114
  $('#message').html("<p class='loading'>Logging in...</p>");
@@ -117,9 +116,19 @@ Caboose.Store.Modules.CheckoutStep1 = (function() {
117
116
  url: '/login',
118
117
  type: 'post',
119
118
  data: $('#signin_form').serialize(),
120
- success: function(resp) {
119
+ success: function(resp) {
121
120
  if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>");
122
- else window.location = '/checkout/step-two';
121
+ else
122
+ {
123
+ $.ajax({
124
+ url: '/checkout/attach-user',
125
+ type: 'post',
126
+ success: function(resp2) {
127
+ if (resp2.error) $('#message').html("<p class='note error'>" + resp2.error + "</p>");
128
+ //else window.location = '/checkout/step-two';
129
+ }
130
+ });
131
+ }
123
132
  }
124
133
  });
125
134
  return false;
@@ -207,8 +207,12 @@ module CabooseStore
207
207
  session[:cart_id] = nil
208
208
 
209
209
  # Send out emails
210
- OrdersMailer.customer_new_order(@order).deliver
211
- OrdersMailer.fulfillment_new_order(@order).deliver
210
+ begin
211
+ OrdersMailer.customer_new_order(@order).deliver
212
+ OrdersMailer.fulfillment_new_order(@order).deliver
213
+ rescue
214
+
215
+ end
212
216
 
213
217
  # Emit order event
214
218
  Caboose.plugin_hook('order_authorized', @order)
@@ -1,3 +1,3 @@
1
1
  module CabooseStore
2
- VERSION = '0.0.14'
2
+ VERSION = '0.0.15'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry