Sha256: cd04c757f1161d79f20f52302f9e7fcf2b89b34b1a72e76742f5395029224eb5

Contents?: true

Size: 888 Bytes

Versions: 9

Compression:

Stored size: 888 Bytes

Contents

# 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 = 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 = request(:get, resource_url + "/preview/lines", params, opts)
      Util.convert_to_stripe_object(resp.data, opts)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
stripe-5.22.0 lib/stripe/resources/credit_note.rb
stripe-5.21.0 lib/stripe/resources/credit_note.rb
stripe-5.20.0 lib/stripe/resources/credit_note.rb
stripe-5.19.0 lib/stripe/resources/credit_note.rb
stripe-5.18.0 lib/stripe/resources/credit_note.rb
stripe-5.17.0 lib/stripe/resources/credit_note.rb
stripe-5.16.0 lib/stripe/resources/credit_note.rb
stripe-5.15.0 lib/stripe/resources/credit_note.rb
stripe-5.14.0 lib/stripe/resources/credit_note.rb