Sha256: 623af430a8f2b63eb0deeed205063c9f17e861e2342b21879716ac2db2b1ecbe

Contents?: true

Size: 1.89 KB

Versions: 4

Compression:

Stored size: 1.89 KB

Contents

module AppManager
  class Client
    module Plans

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

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

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

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

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

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


      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

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

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

      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

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

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

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

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

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
app_manager-2.2.4 lib/app_manager/client/plans.rb
app_manager-2.2.3 lib/app_manager/client/plans.rb
app_manager-2.2.2 lib/app_manager/client/plans.rb
app_manager-2.2.0 lib/app_manager/client/plans.rb