Class: VisaAcceptanceMergedSpec::EWallet8

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/e_wallet8.rb

Overview

EWallet8 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(account_id: SKIP, funding_source: SKIP, funding_source_sale: SKIP, user_name: SKIP, additional_properties: nil) ⇒ EWallet8

Returns a new instance of EWallet8.



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 62

def initialize(account_id: SKIP, funding_source: SKIP,
               funding_source_sale: SKIP, user_name: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_id =  unless  == SKIP
  @funding_source = funding_source unless funding_source == SKIP
  @funding_source_sale = funding_source_sale unless funding_source_sale == SKIP
  @user_name = user_name unless user_name == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

The ID of the customer, passed in the return_url field by PayPal after customer approval.

Returns:

  • (String)


15
16
17
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 15

def 
  @account_id
end

#funding_sourceString

Payment mode for the authorization or order transaction.  INSTANT_TRANSFER  MANUAL_BANK_TRANSFER  DELAYED_TRANSFER  ECHECK  UNRESTRICTED (default)—this value is available only when configured by PayPal for the merchant. INSTANT

Returns:

  • (String)


22
23
24
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 22

def funding_source
  @funding_source
end

#funding_source_saleString

Payment method for the unit purchase. Possible values:

  • UNRESTRICTED (default)—this value is only available if configured by PayPal for the merchant.
  • INSTANT

Returns:

  • (String)


31
32
33
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 31

def funding_source_sale
  @funding_source_sale
end

#user_nameString

The Venmo user name chosen by the user, also know as a Venmo handle.

Returns:

  • (String)


35
36
37
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 35

def user_name
  @user_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountId') ? hash['accountId'] : SKIP
  funding_source = hash.key?('fundingSource') ? hash['fundingSource'] : SKIP
  funding_source_sale =
    hash.key?('fundingSourceSale') ? hash['fundingSourceSale'] : SKIP
  user_name = hash.key?('userName') ? hash['userName'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  EWallet8.new(account_id: ,
               funding_source: funding_source,
               funding_source_sale: funding_source_sale,
               user_name: user_name,
               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'accountId'
  @_hash['funding_source'] = 'fundingSource'
  @_hash['funding_source_sale'] = 'fundingSourceSale'
  @_hash['user_name'] = 'userName'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



48
49
50
51
52
53
54
55
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 48

def self.optionals
  %w[
    account_id
    funding_source
    funding_source_sale
    user_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



110
111
112
113
114
115
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 110

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id.inspect}, funding_source:"\
  " #{@funding_source.inspect}, funding_source_sale: #{@funding_source_sale.inspect},"\
  " user_name: #{@user_name.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



102
103
104
105
106
107
# File 'lib/visa_acceptance_merged_spec/models/e_wallet8.rb', line 102

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id}, funding_source: #{@funding_source},"\
  " funding_source_sale: #{@funding_source_sale}, user_name: #{@user_name},"\
  " additional_properties: #{@additional_properties}>"
end