Sha256: 664dcb6bfd3f98035931142ff3aefdfdcb00f474aab8f777fb86882a604d65d7

Contents?: true

Size: 987 Bytes

Versions: 4

Compression:

Stored size: 987 Bytes

Contents

# frozen_string_literal: true

module Stripe
  class SubscriptionSchedule < APIResource
    extend Stripe::APIOperations::Create
    extend Stripe::APIOperations::List
    include Stripe::APIOperations::Save
    extend Stripe::APIOperations::NestedResource

    OBJECT_NAME = "subscription_schedule".freeze

    custom_method :cancel, http_verb: :post
    custom_method :release, http_verb: :post

    nested_resource_class_methods :revision, operations: %i[retrieve list]

    def cancel(params = {}, opts = {})
      resp, opts = request(:post, resource_url + "/cancel", params, opts)
      initialize_from(resp.data, opts)
    end

    def release(params = {}, opts = {})
      resp, opts = request(:post, resource_url + "/release", params, opts)
      initialize_from(resp.data, opts)
    end

    def revisions(params = {}, opts = {})
      resp, opts = request(:get, resource_url + "/revisions", params, opts)
      Util.convert_to_stripe_object(resp.data, opts)
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
stripe-4.22.0 lib/stripe/resources/subscription_schedule.rb
bongloy-4.21.3 lib/stripe/resources/subscription_schedule.rb
stripe-4.21.3 lib/stripe/resources/subscription_schedule.rb
stripe-4.21.2 lib/stripe/resources/subscription_schedule.rb