Sha256: fb95fb87b4ab7d8aa3b223480487479758732142f2900465f9a2e51f89d217bc

Contents?: true

Size: 536 Bytes

Versions: 31

Compression:

Stored size: 536 Bytes

Contents

# frozen_string_literal: true

module Stripe
  class Subscription < APIResource
    extend Stripe::APIOperations::List
    extend Stripe::APIOperations::Create
    include Stripe::APIOperations::Save
    include Stripe::APIOperations::Delete

    OBJECT_NAME = "subscription".freeze

    save_nested_resource :source

    def delete_discount
      _, opts = request(:delete, discount_url)
      initialize_from({ discount: nil }, opts, true)
    end

    private

    def discount_url
      resource_url + "/discount"
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
stripe-3.31.0 lib/stripe/subscription.rb
stripe-3.30.0 lib/stripe/subscription.rb
stripe-3.29.0 lib/stripe/subscription.rb
stripe-3.28.0 lib/stripe/subscription.rb
stripe-3.27.0 lib/stripe/subscription.rb
stripe-3.26.1 lib/stripe/subscription.rb
stripe-3.26.0 lib/stripe/subscription.rb
stripe-3.25.0 lib/stripe/subscription.rb
stripe-3.24.0 lib/stripe/subscription.rb
stripe-3.23.0 lib/stripe/subscription.rb
stripe-3.22.0 lib/stripe/subscription.rb