Sha256: bfd380154a1ffe871af2cb36921033b7d23ecf710bff731c68c5da0ceed1050b

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

module Chartmogul
  module V1
    class Import::Subscriptions < Chartmogul::V1::Base
      BASE_URI = "#{BASE_URI}/import"

      # Public: Cancel Imported Customer's Subscription.
      #
      # See: https://dev.chartmogul.com/docs/cancel-a-customers-subscription
      #
      # uuid         - The String ChartMogul UUID of the subscription that needs to be cancelled.
      # cancelled_at - The Time at which the subscription was cancelled.
      #
      # Returns the instance of Chartmogul::V1::Request.
      def cancel(uuid, cancelled_at)
        Chartmogul::V1::Request.new("#{BASE_URI}/subscriptions/#{uuid}",
          body:    { cancelled_at: cancelled_at.iso8601 },
          method:  :put,
          userpwd: client.userpwd,
        )
      end

      # Public: List Customer's Subscriptions.
      #
      # See: https://dev.chartmogul.com/docs/list-a-customers-subscriptions
      #
      # uuid - The String ChartMogul UUID of the Customer whose subscriptions are required. Specified as part of the URL.
      #
      # Returns the instance of Chartmogul::V1::Request.
      def list(uuid)
        Chartmogul::V1::Request.new "#{BASE_URI}/customers/#{uuid}/subscriptions", userpwd: client.userpwd
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chartmogul_client-0.0.6 lib/chartmogul/v1/import/subscriptions.rb