Sha256: 71a774f2a5b982c362a27631226997618ca77956ad111491a81bc7982d516659

Contents?: true

Size: 1.54 KB

Versions: 45

Compression:

Stored size: 1.54 KB

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
  class BankAccount < APIResource
    include Stripe::APIOperations::Delete
    extend Stripe::APIOperations::List
    include Stripe::APIOperations::Save

    OBJECT_NAME = "bank_account"

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

    def resource_url
      if respond_to?(:customer)
        "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
      elsif respond_to?(:account)
        "#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}"
      end
    end

    def self.update(_id, _params = nil, _opts = nil)
      raise NotImplementedError,
            "Bank accounts cannot be updated without a customer ID or an " \
            " account ID. Update a bank account using " \
            "`Customer.update_source('customer_id', 'bank_account_id', " \
            "update_params)` or `Account.update_external_account(" \
            "'account_id', 'bank_account_id', update_params)`"
    end

    def self.retrieve(_id, _opts = nil)
      raise NotImplementedError,
            "Bank accounts cannot be retrieve without a customer ID or an " \
            "account ID. Retrieve a bank account using " \
            "`Customer.retrieve_source('customer_id', 'bank_account_id')` " \
            "or `Account.retrieve_external_account('account_id', " \
            "'bank_account_id')`"
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
stripe-7.1.0 lib/stripe/resources/bank_account.rb
stripe-7.1.0.pre.beta.2 lib/stripe/resources/bank_account.rb
stripe-7.1.0.pre.beta.1 lib/stripe/resources/bank_account.rb
stripe-7.0.0 lib/stripe/resources/bank_account.rb
stripe-6.6.0.pre.beta.1 lib/stripe/resources/bank_account.rb
stripe-6.5.0 lib/stripe/resources/bank_account.rb
stripe-6.4.0 lib/stripe/resources/bank_account.rb
stripe-6.3.0 lib/stripe/resources/bank_account.rb
stripe-6.2.0 lib/stripe/resources/bank_account.rb
stripe-6.1.0 lib/stripe/resources/bank_account.rb
stripe-6.0.0 lib/stripe/resources/bank_account.rb
stripe-5.55.0 lib/stripe/resources/bank_account.rb
stripe-5.54.0 lib/stripe/resources/bank_account.rb
stripe-5.53.0 lib/stripe/resources/bank_account.rb
stripe-5.52.0 lib/stripe/resources/bank_account.rb
stripe-5.50.0 lib/stripe/resources/bank_account.rb
stripe-5.49.0 lib/stripe/resources/bank_account.rb
stripe-5.48.0 lib/stripe/resources/bank_account.rb
stripe-5.47.0 lib/stripe/resources/bank_account.rb
stripe-5.46.0 lib/stripe/resources/bank_account.rb