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-4.11.0 lib/stripe/subscription.rb
stripe-4.10.0 lib/stripe/subscription.rb
stripe-4.9.1 lib/stripe/subscription.rb
stripe-4.9.0 lib/stripe/subscription.rb
stripe-4.8.1 lib/stripe/subscription.rb
stripe-4.8.0 lib/stripe/subscription.rb
stripe-4.7.1 lib/stripe/subscription.rb
stripe-4.7.0 lib/stripe/subscription.rb
stripe-4.6.0 lib/stripe/subscription.rb
stripe-4.5.0 lib/stripe/subscription.rb
stripe-4.4.1 lib/stripe/subscription.rb
stripe-4.4.0 lib/stripe/subscription.rb
stripe-4.3.0 lib/stripe/subscription.rb
stripe-4.2.0 lib/stripe/subscription.rb
stripe-4.1.0 lib/stripe/subscription.rb
stripe-4.0.3 lib/stripe/subscription.rb
stripe-4.0.2 lib/stripe/subscription.rb
stripe-4.0.1 lib/stripe/subscription.rb
stripe-4.0.0 lib/stripe/subscription.rb
stripe-3.31.1 lib/stripe/subscription.rb