Sha256: 99619495fed758f7e91f60640490c8a1e2e450b4452165875f065e78c091285d

Contents?: true

Size: 603 Bytes

Versions: 9

Compression:

Stored size: 603 Bytes

Contents

module Conekta
  class Subscription < Resource
    include Conekta::Operations::Update
    include Conekta::Operations::CustomAction
    def url
      raise Error.new(
        I18n.t('error.resource.id',  { resource: self.class.class_name, locale: :en }),
        I18n.t('error.resource.id_purchaser',  { locale: Conekta.locale.to_sym })) if (id.nil? || id.empty?)
      self.customer.url + "/subscription"
    end
    def pause
      custom_action(:post, 'pause')
    end
    def resume
      custom_action(:post, 'resume')
    end
    def cancel
      custom_action(:post, 'cancel')
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
conekta-0.5.6 lib/conekta/subscription.rb
conekta-0.5.5 lib/conekta/subscription.rb
conekta-0.5.4 lib/conekta/subscription.rb
conekta-0.5.3 lib/conekta/subscription.rb
conekta-0.5.2 lib/conekta/subscription.rb
conekta-0.5.1 lib/conekta/subscription.rb
conekta-0.4.8 lib/conekta/subscription.rb
conekta-0.4.7 lib/conekta/subscription.rb
conekta-0.4.6 lib/conekta/subscription.rb