payola-payments 1.2.5 → 1.2.6

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: 687b1a158e55cc469bc30828b4935396bec9a54e
4
- data.tar.gz: 83ef120df1b244def0d9a2e5a096947274ffd404
3
+ metadata.gz: 8deb29ec575d4faf852d02cc955375825a13fcaa
4
+ data.tar.gz: 304228ce7fcc032647b7d7121914eca2e02b9d86
5
5
  SHA512:
6
- metadata.gz: 121077b27aa23f3958a2b158810ab60b2982182fb7245691ac3cef9a80cecda82b393f6d05090232119adaee8d50e3affa86840d27d640efbb7e65e29b6b0b38
7
- data.tar.gz: 3052d957372c564914d5430edff374e0416db8dd0add2f8dc8d78f2247e2aee2ef3b0ba787a64544f551a5743acbe310c576a89bdc01498c14daebe7569601a4
6
+ metadata.gz: 3e294bea2fecf77ae284a312b46692c9fcb956fe21edea5b380bda1a1dd2611249c8e15d095bd5596adaf22c4a7f7ff9dadf915b8bb79c95047e0406478aec95
7
+ data.tar.gz: 184c3ad6bf4d5d869aa1b4ae1a3b0a3a48d2ed0c4f87d6997b72addbc71abd63c62e2363a94df8144c3655772960ab04dcbc3dc8f2301a514812010d8de001e3
@@ -52,18 +52,22 @@ var PayolaOnestepSubscriptionForm = {
52
52
  var handler = function(data) {
53
53
  if (data.status === "active") {
54
54
  window.location = base_path + '/confirm_subscription/' + guid;
55
- } else if (data.status === "errored") {
56
- PayolaOnestepSubscriptionForm.showError(form, data.error);
57
55
  } else {
58
56
  setTimeout(function() { PayolaOnestepSubscriptionForm.poll(form, num_retries_left - 1, guid, base_path); }, 500);
59
57
  }
60
58
  };
59
+ var errorHandler = function(jqXHR){
60
+ if(jqXHR.responseJSON.status === "errored"){
61
+ PayolaSubscriptionForm.showError(form, jqXHR.responseJSON.error);
62
+ }
63
+ };
61
64
 
62
65
  $.ajax({
63
66
  type: 'GET',
67
+ dataType: 'json',
64
68
  url: base_path + '/subscription_status/' + guid,
65
69
  success: handler,
66
- error: handler
70
+ error: errorHandler
67
71
  });
68
72
  },
69
73
 
@@ -51,18 +51,22 @@ var PayolaSubscriptionForm = {
51
51
  form.append($('<input type="hidden" name="payola_subscription_guid"></input>').val(guid));
52
52
  form.append(PayolaSubscriptionForm.authenticityTokenInput());
53
53
  form.get(0).submit();
54
- } else if (data.status === "errored") {
55
- PayolaSubscriptionForm.showError(form, data.error);
56
54
  } else {
57
55
  setTimeout(function() { PayolaSubscriptionForm.poll(form, num_retries_left - 1, guid, base_path); }, 500);
58
56
  }
59
57
  };
58
+ var errorHandler = function(jqXHR){
59
+ if(jqXHR.responseJSON.status === "errored"){
60
+ PayolaSubscriptionForm.showError(form, jqXHR.responseJSON.error);
61
+ }
62
+ };
60
63
 
61
64
  $.ajax({
62
65
  type: 'GET',
66
+ dataType: 'json',
63
67
  url: base_path + '/subscription_status/' + guid,
64
68
  success: handler,
65
- error: handler
69
+ error: errorHandler
66
70
  });
67
71
  },
68
72
 
@@ -1,3 +1,3 @@
1
1
  module Payola
2
- VERSION = "1.2.5"
2
+ VERSION = "1.2.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payola-payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Keen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-25 00:00:00.000000000 Z
11
+ date: 2015-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails