Sha256: dd7750de994eebca67e9356dbfa1822dab45426a686dfb0dfde58cf75f1817ca

Contents?: true

Size: 621 Bytes

Versions: 1

Compression:

Stored size: 621 Bytes

Contents

require 'razorpay/request'
require 'razorpay/entity'

module Razorpay
  # Subscription API allows you to create and
  # manage subscriptions with Razorpay
  class Subscription < Entity
    def self.request
      Razorpay::Request.new('subscriptions')
    end

    def self.create(options)
      request.create options
    end

    def self.fetch(id)
      request.fetch id
    end

    def self.all(options = {})
      request.all options
    end

    def self.cancel(id, options = {})
      request.post "#{id}/cancel", options
    end

    def cancel(options = {})
      self.class.cancel id, options
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
razorpay-2.2.0 lib/razorpay/subscription.rb