Module: AppManager::Client::Plans

Included in:
AppManager::Client
Defined in:
lib/app_manager/client/plans.rb

Instance Method Summary collapse

Instance Method Details

#cancel_charge(shop_domain, plan_id) ⇒ Object



17
18
19
# File 'lib/app_manager/client/plans.rb', line 17

def cancel_charge(shop_domain, plan_id)
  post("/cancel-charge", {shop_domain: shop_domain, plan_id: plan_id})
end

#check_and_activate_global_plan(shop_domain) ⇒ Object



50
51
52
# File 'lib/app_manager/client/plans.rb', line 50

def check_and_activate_global_plan(shop_domain)
  post("/activate-global-plan", {shop_domain: shop_domain})
end

#discount_used(shop_domain, discount_id) ⇒ Object



58
59
60
# File 'lib/app_manager/client/plans.rb', line 58

def discount_used(shop_domain, discount_id)
  post('/use-discount', {shop_domain: shop_domain, discount_id: discount_id.to_i})
end

#get_app_bundle_dataObject



46
47
48
# File 'lib/app_manager/client/plans.rb', line 46

def get_app_bundle_data
  get("/app-bundle-data")
end

#get_charge(shop_domain) ⇒ Object



34
35
36
# File 'lib/app_manager/client/plans.rb', line 34

def get_charge(shop_domain)
  get("/get-charge?shop_domain=#{shop_domain}")
end

#get_plan(plan_id, shop_domain = nil) ⇒ Object



9
10
11
# File 'lib/app_manager/client/plans.rb', line 9

def get_plan(plan_id, shop_domain = nil)
  get("/plan?plan_id=#{plan_id}&shop_domain=#{shop_domain}")
end

#get_plans(shop_domain, active_plan_id = nil) ⇒ Object



5
6
7
# File 'lib/app_manager/client/plans.rb', line 5

def get_plans(shop_domain, active_plan_id = nil)
  get("/plans?shop_domain=#{shop_domain}&active_plan_id=#{active_plan_id}")
end

#get_promotional_discount(shop_domain = nil, code) ⇒ Object



54
55
56
# File 'lib/app_manager/client/plans.rb', line 54

def get_promotional_discount(shop_domain = nil,code)
  get("/discount?shop_domain=#{shop_domain}&code=#{code}")
end


66
67
68
# File 'lib/app_manager/client/plans.rb', line 66

def get_related_discounted_plans(discount_id)
  get("/get-related-discounted-plans?discount_id=#{discount_id}")
end

#get_remaining_days(shop_domain, trial_activated_at = nil, plan_id = nil) ⇒ Object



30
31
32
# File 'lib/app_manager/client/plans.rb', line 30

def get_remaining_days(shop_domain, trial_activated_at = nil, plan_id = nil)
  get("/get-remaining-days?shop_domain=#{shop_domain}&trial_activated_at=#{trial_activated_at}&plan_id=#{plan_id}")
end

#get_status(options = {}) ⇒ Object



38
39
40
# File 'lib/app_manager/client/plans.rb', line 38

def get_status(options = {})
  get("/get-status", options)
end

#has_plan(shop_domain, plan_id, trial_activated_at, grandfathered) ⇒ Object



42
43
44
# File 'lib/app_manager/client/plans.rb', line 42

def has_plan(shop_domain, plan_id, trial_activated_at, grandfathered)
  get("/has-plan?shop_domain=#{shop_domain}&plan_id=#{plan_id}&trial_activated_at=#{trial_activated_at}&grandfathered=#{grandfathered}")
end

#store_charge(options = {}) ⇒ Object



13
14
15
# File 'lib/app_manager/client/plans.rb', line 13

def store_charge(options = {})
  post("/store-charge", options)
end

#sync_charge(options = {}) ⇒ Object



25
26
27
# File 'lib/app_manager/client/plans.rb', line 25

def sync_charge(options = {})
  post("/sync-charge", options)
end

#sync_discount_usage_log(options = {}) ⇒ Object



62
63
64
# File 'lib/app_manager/client/plans.rb', line 62

def sync_discount_usage_log(options = {})
  post("/use-discount-sync", options)
end

#update_charge(shop_domain, plan_id) ⇒ Object



21
22
23
# File 'lib/app_manager/client/plans.rb', line 21

def update_charge(shop_domain, plan_id)
  post("/update-charge", {shop_domain: shop_domain, plan_id: plan_id})
end