Sha256: b8d53701e4c76dbd2c52ad1919f738a01cbae551c12b46a6578eff65af4915a0

Contents?: true

Size: 961 Bytes

Versions: 38

Compression:

Stored size: 961 Bytes

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

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

    OBJECT_NAME = "credit_note"

    custom_method :void_credit_note, http_verb: :post, http_path: "void"

    def void_credit_note(params = {}, opts = {})
      request_stripe_object(
        method: :post,
        path: resource_url + "/void",
        params: params,
        opts: opts
      )
    end

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

    def self.list_preview_line_items(params, opts = {})
      resp, opts = execute_resource_request(:get, resource_url + "/preview/lines", params, opts)
      Util.convert_to_stripe_object(resp.data, opts)
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
stripe-5.38.0 lib/stripe/resources/credit_note.rb
stripe-5.37.0 lib/stripe/resources/credit_note.rb
stripe-5.36.0 lib/stripe/resources/credit_note.rb
stripe-5.35.0 lib/stripe/resources/credit_note.rb
stripe-5.34.0 lib/stripe/resources/credit_note.rb
stripe-5.33.0 lib/stripe/resources/credit_note.rb
stripe-5.32.1 lib/stripe/resources/credit_note.rb
stripe-5.32.0 lib/stripe/resources/credit_note.rb
stripe-5.31.0 lib/stripe/resources/credit_note.rb
stripe-5.30.0 lib/stripe/resources/credit_note.rb
stripe-5.29.1 lib/stripe/resources/credit_note.rb
stripe-5.29.0 lib/stripe/resources/credit_note.rb
stripe-5.28.0 lib/stripe/resources/credit_note.rb
stripe-5.27.0 lib/stripe/resources/credit_note.rb
stripe-5.26.0 lib/stripe/resources/credit_note.rb
stripe-5.25.0 lib/stripe/resources/credit_note.rb
stripe-5.24.0 lib/stripe/resources/credit_note.rb
stripe-5.23.1 lib/stripe/resources/credit_note.rb