Sha256: eb21c112dc6333f0fd026098ec1b3fe4f49fe2a283b765a9855623a25d950486

Contents?: true

Size: 820 Bytes

Versions: 13

Compression:

Stored size: 820 Bytes

Contents

module Payjp
  class Subscription < APIResource
    include Payjp::APIOperations::List
    include Payjp::APIOperations::Create
    include Payjp::APIOperations::Update
    include Payjp::APIOperations::Delete

    def pause(params = {}, opts = {})
      response, opts = request(:post, pause_url, params, opts)
      refresh_from(response, opts)
    end

    def resume(params = {}, opts = {})
      response, opts = request(:post, resume_url, params, opts)
      refresh_from(response, opts)
    end

    def cancel(params = {}, opts = {})
      response, opts = request(:post, cancel_url, params, opts)
      refresh_from(response, opts)
    end

    private

    def pause_url
      url + '/pause'
    end

    def resume_url
      url + '/resume'
    end

    def cancel_url
      url + '/cancel'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
payjp-0.0.16 lib/payjp/subscription.rb
payjp-0.0.14 lib/payjp/subscription.rb
payjp-0.0.13 lib/payjp/subscription.rb
payjp-0.0.12 lib/payjp/subscription.rb
payjp-0.0.10 lib/payjp/subscription.rb
payjp-0.0.9 lib/payjp/subscription.rb
payjp-0.0.8 lib/payjp/subscription.rb
payjp-0.0.7 lib/payjp/subscription.rb
payjp-0.0.6 lib/payjp/subscription.rb
payjp-0.0.5 lib/payjp/subscription.rb
payjp-0.0.4 lib/payjp/subscription.rb
payjp-0.0.3 lib/payjp/subscription.rb
payjp-0.0.2 lib/payjp/subscription.rb