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



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

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



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

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

#discount_used(shop_domain, discount_id) ⇒ Object



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

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



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

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

#get_bundle_plan(active_plan_id = nil) ⇒ Object



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

def get_bundle_plan(active_plan_id = nil)
  get("/get-bundle-plan", {active_plan_id: active_plan_id})
end

#get_charge(shop_domain) ⇒ Object



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

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

#get_plan(plan_id, shop_domain = nil) ⇒ Object



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

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, sdk_versions = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/app_manager/client/plans.rb', line 5

def get_plans(shop_domain, active_plan_id = nil, sdk_versions = {})
  query = {
    shop_domain: shop_domain,
    active_plan_id: active_plan_id,
    sdk_versions: sdk_versions
  }.to_query
  get("/plans?#{query}")
end

#get_promotional_discount(shop_domain = nil, code) ⇒ Object



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

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


75
76
77
# File 'lib/app_manager/client/plans.rb', line 75

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



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

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



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

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

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



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

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



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

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

#sync_charge(options = {}) ⇒ Object



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

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

#sync_discount_usage_log(options = {}) ⇒ Object



71
72
73
# File 'lib/app_manager/client/plans.rb', line 71

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

#update_charge(shop_domain, plan_id) ⇒ Object



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

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