Class: PayPal::SDK::REST::DataTypes::BankAccount

Inherits:
Base show all
Includes:
RequestDataType
Defined in:
lib/paypal-sdk/rest/data_types.rb

Direct Known Subclasses

ExtendedBankAccount

Constant Summary

Constants inherited from Core::API::DataTypes::Base

Core::API::DataTypes::Base::ContentKey, Core::API::DataTypes::Base::HashOptions

Instance Attribute Summary

Attributes inherited from Base

#error, #header, #request_id

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RequestDataType

#api, api, #error=, included

Methods included from SetAPI

#client_id=, #client_secret=, #set_config, #token=

Methods inherited from Base

#http_header, #merge!, #raise_error!, raise_on_api_error, #success?

Methods inherited from Core::API::DataTypes::Base

add_attribute, add_member, array_of, #convert_array, #convert_object, define_alias_methods, #hash_key, #initialize, #member_names, members, #members, #merge!, object_of, #set, #skip_value?, snakecase, #to_hash, #value_to_hash

Methods included from Core::Logging

#log_event, #logger, logger, logger=

Constructor Details

This class inherits a constructor from PayPal::SDK::Core::API::DataTypes::Base

Class Method Details

.find(resource_id) ⇒ Object

Raises:

  • (ArgumentError)

470
471
472
473
474
# File 'lib/paypal-sdk/rest/data_types.rb', line 470

def find(resource_id)
  raise ArgumentError.new("id required") if resource_id.to_s.strip.empty?
  path = "v1/vault/bank-accounts/#{resource_id}"
  self.new(api.get(path))
end

.load_membersObject


434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/paypal-sdk/rest/data_types.rb', line 434

def self.load_members
  object_of :id, String
  object_of :account_number, String
  object_of :account_number_type, String
  object_of :routing_number, String
  object_of :account_type, String
  object_of :account_name, String
  object_of :check_type, String
  object_of :auth_type, String
  object_of :auth_capture_timestamp, String
  object_of :bank_name, String
  object_of :country_code, String
  object_of :first_name, String
  object_of :last_name, String
  object_of :birth_date, String
  object_of :billing_address, Address
  object_of :state, String
  object_of :confirmation_status, String
  object_of :payer_id, String
  object_of :external_customer_id, String
  object_of :merchant_id, String
  object_of :create_time, String
  object_of :update_time, String
  object_of :valid_until, String
end

Instance Method Details

#createObject


462
463
464
465
466
467
# File 'lib/paypal-sdk/rest/data_types.rb', line 462

def create()
  path = "v1/vault/bank-accounts"
  response = api.post(path, self.to_hash, http_header)
  self.merge!(response)
  success?
end

#deleteObject


477
478
479
480
481
482
# File 'lib/paypal-sdk/rest/data_types.rb', line 477

def delete()
  path = "v1/vault/bank-accounts/#{self.id}"
  response = api.delete(path, {})
  self.merge!(response)
  success?
end

#update(patch_request) ⇒ Object


484
485
486
487
488
489
490
# File 'lib/paypal-sdk/rest/data_types.rb', line 484

def update(patch_request)
  patch_request = PatchRequest.new(patch_request) unless patch_request.is_a? PatchRequest
  path = "v1/vault/bank-accounts/#{self.id}"
  response = api.patch(path, patch_request.to_hash, http_header)
  self.merge!(response)
  success?
end