Sha256: 3183b783d4950c4ea7e46ebcbc00ca07445370d9a8757cee79a61c0dadf92064

Contents?: true

Size: 769 Bytes

Versions: 13

Compression:

Stored size: 769 Bytes

Contents

# frozen_string_literal: true

module Stripe
  class ApplicationFee < APIResource
    extend Stripe::APIOperations::List
    extend Stripe::APIOperations::NestedResource

    OBJECT_NAME = "application_fee".freeze

    nested_resource_class_methods :refund,
                                  operations: %i[create retrieve update list]

    # If you don't need access to an updated fee object after the refund, it's
    # more performant to just call `fee.refunds.create` directly.
    def refund(params = {}, opts = {})
      refunds.create(params, opts)

      # now that a refund has been created, we expect the state of this object
      # to change as well (i.e. `refunded` will now be `true`) so refresh it
      # from the server
      refresh
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
stripe-4.24.0 lib/stripe/resources/application_fee.rb
stripe-4.23.0 lib/stripe/resources/application_fee.rb
stripe-4.22.1 lib/stripe/resources/application_fee.rb
stripe-4.22.0 lib/stripe/resources/application_fee.rb
bongloy-4.21.3 lib/stripe/resources/application_fee.rb
stripe-4.21.3 lib/stripe/resources/application_fee.rb
stripe-4.21.2 lib/stripe/resources/application_fee.rb
stripe-4.21.1 lib/stripe/resources/application_fee.rb
stripe-4.21.0 lib/stripe/resources/application_fee.rb
stripe-4.20.1 lib/stripe/resources/application_fee.rb
stripe-4.20.0 lib/stripe/resources/application_fee.rb
stripe-4.19.0 lib/stripe/resources/application_fee.rb
stripe-4.18.1 lib/stripe/application_fee.rb