Class: VisaAcceptanceMergedSpec::Initiator26

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

Overview

Initiator26 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(type: SKIP, credential_stored_on_file: SKIP, stored_credential_used: SKIP, merchant_initiated_transaction: SKIP, additional_properties: nil) ⇒ Initiator26

Returns a new instance of Initiator26.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 87

def initialize(type: SKIP, credential_stored_on_file: SKIP,
               stored_credential_used: SKIP,
               merchant_initiated_transaction: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @type = type unless type == SKIP
  unless credential_stored_on_file == SKIP
    @credential_stored_on_file =
      credential_stored_on_file
  end
  @stored_credential_used = stored_credential_used unless stored_credential_used == SKIP
  unless merchant_initiated_transaction == SKIP
    @merchant_initiated_transaction =
      merchant_initiated_transaction
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#credential_stored_on_fileString

Indicates to the issuing bank two things:

  • The merchant has received consent from the cardholder to store their card details on file
  • The merchant wants the issuing bank to check out the card details before the merchant initiates their first transaction for this cardholder. The purpose of the merchant-initiated transaction is to ensure that the cardholder’s credentials are valid (that the card is not stolen or has restrictions) and that the card details are good to be stored on the merchant’s file for future transactions. Valid values:
  • Y means merchant will use this transaction to store payment credentials for follow-up merchant-initiated transactions.
  • N means merchant will not use this transaction to store payment credentials for follow-up merchant-initiated transactions. NOTE: The value for this field does not correspond to any data in the TC 33 capture file5. This field is supported only for Visa transactions on Visa Acceptance through VisaNet.

Returns:

  • (String)


39
40
41
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 39

def credential_stored_on_file
  @credential_stored_on_file
end

#merchant_initiated_transactionMerchantInitiatedTransactionObject

Indicates to an issuing bank whether a merchant-initiated transaction came from a card that was already stored on file. Possible values:

  • Y means the merchant-initiated transaction came from a card that was already stored on file.
  • N means the merchant-initiated transaction came from a card that was not stored on file.


59
60
61
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 59

def merchant_initiated_transaction
  @merchant_initiated_transaction
end

#stored_credential_usedString

Indicates to an issuing bank whether a merchant-initiated transaction came from a card that was already stored on file. Possible values:

  • Y means the merchant-initiated transaction came from a card that was already stored on file.
  • N means the merchant-initiated transaction came from a card that was not stored on file.

Returns:

  • (String)


49
50
51
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 49

def stored_credential_used
  @stored_credential_used
end

#typeString

This field indicates whether the transaction is a merchant-initiated transaction or customer-initiated transaction. Valid values:

  • customer
  • merchant

Returns:

  • (String)


18
19
20
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 18

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 108

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  type = hash.key?('type') ? hash['type'] : SKIP
  credential_stored_on_file =
    hash.key?('credentialStoredOnFile') ? hash['credentialStoredOnFile'] : SKIP
  stored_credential_used =
    hash.key?('storedCredentialUsed') ? hash['storedCredentialUsed'] : SKIP
  if hash['merchantInitiatedTransaction']
    merchant_initiated_transaction = MerchantInitiatedTransactionObject.from_hash(hash['merchantInitiatedTransaction'])
  end

  # 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.
  Initiator26.new(type: type,
                  credential_stored_on_file: credential_stored_on_file,
                  stored_credential_used: stored_credential_used,
                  merchant_initiated_transaction: merchant_initiated_transaction,
                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['type'] = 'type'
  @_hash['credential_stored_on_file'] = 'credentialStoredOnFile'
  @_hash['stored_credential_used'] = 'storedCredentialUsed'
  @_hash['merchant_initiated_transaction'] =
    'merchantInitiatedTransaction'
  @_hash
end

.nullablesObject

An array for nullable fields



83
84
85
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 83

def self.nullables
  []
end

.optionalsObject

An array for optional fields



73
74
75
76
77
78
79
80
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 73

def self.optionals
  %w[
    type
    credential_stored_on_file
    stored_credential_used
    merchant_initiated_transaction
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



145
146
147
148
149
150
151
152
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 145

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} type: #{@type.inspect}, credential_stored_on_file:"\
  " #{@credential_stored_on_file.inspect}, stored_credential_used:"\
  " #{@stored_credential_used.inspect}, merchant_initiated_transaction:"\
  " #{@merchant_initiated_transaction.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



137
138
139
140
141
142
# File 'lib/visa_acceptance_merged_spec/models/initiator26.rb', line 137

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} type: #{@type}, credential_stored_on_file: #{@credential_stored_on_file},"\
  " stored_credential_used: #{@stored_credential_used}, merchant_initiated_transaction:"\
  " #{@merchant_initiated_transaction}, additional_properties: #{@additional_properties}>"
end