Sha256: b50be3f4c1952a539a94dd9177c358e71337fea4adb946efbd50e34d0f95ff21

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

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

    OBJECT_NAME = "customer"

    nested_resource_class_methods :balance_transaction,
                                  operations: %i[create retrieve update list]
    nested_resource_class_methods :tax_id,
                                  operations: %i[create retrieve delete list]

    custom_method :delete_discount, http_verb: :delete, http_path: "discount"

    save_nested_resource :source
    nested_resource_class_methods :source,
                                  operations: %i[create retrieve update delete list]

    # The API request for deleting a card or bank account and for detaching a
    # source object are the same.
    class << self
      alias detach_source delete_source
    end

    def delete_discount
      resp, opts = execute_resource_request(:delete, resource_url + "/discount")
      initialize_from(resp.data, opts, true)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stripe-5.29.0 lib/stripe/resources/customer.rb
stripe-5.28.0 lib/stripe/resources/customer.rb
stripe-5.27.0 lib/stripe/resources/customer.rb
stripe-5.26.0 lib/stripe/resources/customer.rb
stripe-5.25.0 lib/stripe/resources/customer.rb
stripe-5.24.0 lib/stripe/resources/customer.rb
stripe-5.23.1 lib/stripe/resources/customer.rb