app_manager 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/controllers/app_manager/charges_controller.rb +4 -3
- data/lib/app_manager/fail_safe.rb +59 -5
- data/lib/app_manager/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e3986aadebfd51cccf040bfd0a5ad36041de436ac3ab4c074fb0a2174a9da10
|
4
|
+
data.tar.gz: 83e772b1847481e9e91745f91569973d16e1809eb7732affe4f6f46ab3385c89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8793bb25fdfbff2ed36e2c0f4f24f63d6c40c1bc6df999ef101cfa6f6b66d2732729743f1ab2298d66debfbd6785ea47bddcdacf7fa3d21efcebdd17bcda5b3b
|
7
|
+
data.tar.gz: 1b040a0afaedeb15cf4892f9010105e4f1ea1e6f7a92b75c5d65dc5e1c3a5870fd3eb4a01f825738a5c8fbc722a8f3dd63fe3be8eb217bf19ac4859bc1d716bd
|
data/Gemfile.lock
CHANGED
@@ -18,11 +18,12 @@ module AppManager
|
|
18
18
|
if plan_data['price'] == 0
|
19
19
|
active_charge_data = plan_obj.get_charge(params[:shop])
|
20
20
|
begin
|
21
|
-
if active_charge_data && active_charge_data.any? && !active_charge_data['active_charge']['charge_id'].nil?
|
21
|
+
if active_charge_data && active_charge_data.any? && !active_charge_data['active_charge'].nil? && !active_charge_data['active_charge']['charge_id'].nil?
|
22
22
|
gq_obj = AppManager::GraphqlHelper.new(@shop.shopify_domain,@shop.shopify_token)
|
23
23
|
rec_cancel_data = gq_obj.recurring_charge_cancel_api_call(active_charge_data['active_charge']['charge_id'],@shop)
|
24
|
-
if !rec_cancel_data["errors"].present? && (rec_cancel_data["data"].present? && rec_cancel_data["data"]["appSubscriptionCancel"].present? && !rec_cancel_data["data"]["
|
25
|
-
|
24
|
+
if !rec_cancel_data["errors"].present? && (rec_cancel_data["data"].present? && rec_cancel_data["data"]["appSubscriptionCancel"].present? && !rec_cancel_data["data"]["appSubscriptionCancel"]["userErrors"].any? && (rec_cancel_data["data"]["appSubscriptionCancel"]["appSubscription"]["status"] == 'CANCELLED'))
|
25
|
+
cancelled_charge_id = rec_cancel_data["data"]["appSubscriptionCancel"]["appSubscription"]["id"].split('/')[-1]
|
26
|
+
plan_obj.cancel_charge(params[:shop],cancelled_charge_id)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
rescue Exception => e
|
@@ -29,36 +29,90 @@ module AppManager
|
|
29
29
|
save_api_plans(params["plans"])
|
30
30
|
rescue Exception => e
|
31
31
|
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
32
|
+
begin
|
33
|
+
create_plan_table
|
34
|
+
save_api_plans(params["plans"])
|
35
|
+
rescue Exception => e
|
36
|
+
Rails.logger.info "APP MANAGER FailSafe >>>> #{e.inspect}"
|
37
|
+
end
|
32
38
|
end
|
39
|
+
|
40
|
+
|
33
41
|
begin
|
34
42
|
save_api_charges(params["charges"])
|
35
43
|
rescue Exception => e
|
36
|
-
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
44
|
+
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
45
|
+
begin
|
46
|
+
create_charges_table
|
47
|
+
save_api_charges(params["charges"])
|
48
|
+
rescue Exception => e
|
49
|
+
Rails.logger.info "APP MANAGER FailSafe >>>> #{e.inspect}"
|
50
|
+
end
|
37
51
|
end
|
52
|
+
|
53
|
+
|
38
54
|
begin
|
39
55
|
save_api_apps(params["apps"])
|
40
56
|
rescue Exception => e
|
41
|
-
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
57
|
+
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
58
|
+
begin
|
59
|
+
create_apps_table
|
60
|
+
save_api_apps(params["apps"])
|
61
|
+
rescue Exception => e
|
62
|
+
Rails.logger.info "APP MANAGER FailSafe >>>> #{e.inspect}"
|
63
|
+
end
|
42
64
|
end
|
65
|
+
|
66
|
+
|
43
67
|
begin
|
44
68
|
save_api_app_structures(params["app_structures"])
|
45
69
|
rescue Exception => e
|
46
|
-
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
70
|
+
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
71
|
+
begin
|
72
|
+
create_app_structures_table
|
73
|
+
save_api_app_structures(params["app_structures"])
|
74
|
+
rescue Exception => e
|
75
|
+
Rails.logger.info "APP MANAGER FailSafe >>>> #{e.inspect}"
|
76
|
+
end
|
47
77
|
end
|
78
|
+
|
79
|
+
|
48
80
|
begin
|
49
81
|
save_api_discount_plans(params["discount_plans"])
|
50
82
|
rescue Exception => e
|
51
83
|
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
84
|
+
begin
|
85
|
+
create_discount_plans_table
|
86
|
+
save_api_discount_plans(params["discount_plans"])
|
87
|
+
rescue Exception => e
|
88
|
+
Rails.logger.info "APP MANAGER FailSafe >>>> #{e.inspect}"
|
89
|
+
end
|
52
90
|
end
|
91
|
+
|
92
|
+
|
53
93
|
begin
|
54
94
|
save_api_extend_trials(params["extend_trials"])
|
55
95
|
rescue Exception => e
|
56
|
-
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
96
|
+
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
97
|
+
begin
|
98
|
+
create_extend_trials_table
|
99
|
+
save_api_extend_trials(params["extend_trials"])
|
100
|
+
rescue Exception => e
|
101
|
+
Rails.logger.info "APP MANAGER FailSafe >>>> #{e.inspect}"
|
102
|
+
end
|
57
103
|
end
|
104
|
+
|
105
|
+
|
58
106
|
begin
|
59
107
|
save_api_plan_users(params["plan_users"])
|
60
108
|
rescue Exception => e
|
61
|
-
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
109
|
+
Rails.logger.info "APP MANAGER >>>> #{e.inspect}"
|
110
|
+
begin
|
111
|
+
create_plan_users_table
|
112
|
+
save_api_plan_users(params["plan_users"])
|
113
|
+
rescue Exception => e
|
114
|
+
Rails.logger.info "APP MANAGER FailSafe >>>> #{e.inspect}"
|
115
|
+
end
|
62
116
|
end
|
63
117
|
end
|
64
118
|
|
data/lib/app_manager/version.rb
CHANGED