Class: CyberSourceMergedSpec::PostPaymentCredentialsRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb

Overview

PostPaymentCredentialsRequest 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(payment_credential_type: SKIP, transaction_type: SKIP, client_correlation_id: SKIP, order_information: SKIP, merchant_information: SKIP, device_information: SKIP, authenticated_identities: SKIP, additional_properties: nil) ⇒ PostPaymentCredentialsRequest

Returns a new instance of PostPaymentCredentialsRequest.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 90

def initialize(payment_credential_type: SKIP, transaction_type: SKIP,
               client_correlation_id: SKIP, order_information: SKIP,
               merchant_information: SKIP, device_information: SKIP,
               authenticated_identities: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @payment_credential_type = payment_credential_type unless payment_credential_type == SKIP
  @transaction_type = transaction_type unless transaction_type == SKIP
  @client_correlation_id = client_correlation_id unless client_correlation_id == SKIP
  @order_information = order_information unless order_information == SKIP
  @merchant_information = merchant_information unless merchant_information == SKIP
  @device_information = device_information unless device_information == SKIP
  @authenticated_identities = authenticated_identities unless authenticated_identities == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#authenticated_identitiesArray[AuthenticatedIdentity1]

Used to correlate authentication and payment credential requests.

Returns:



57
58
59
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 57

def authenticated_identities
  @authenticated_identities
end

#client_correlation_idString

Used to correlate authentication and payment credential requests.

Returns:

  • (String)


41
42
43
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 41

def client_correlation_id
  @client_correlation_id
end

#device_informationDeviceInformation11

Used to correlate authentication and payment credential requests.

Returns:



53
54
55
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 53

def device_information
  @device_information
end

#merchant_informationTmsMerchantInformation2

Used to correlate authentication and payment credential requests.



49
50
51
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 49

def merchant_information
  @merchant_information
end

#order_informationOrderInformation33

Used to correlate authentication and payment credential requests.

Returns:



45
46
47
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 45

def order_information
  @order_information
end

#payment_credential_typeString

The type of payment credentials to be returned. By default, payment credentials include network token and cryptogram or dynamic CVV. If "NETWORK_TOKEN" is supplied then only network token card number will be returned and no cryptogram or dynamic CVV will be requested. If "SECURITY_CODE" is supplied then dynamic CVV will be requested and returned with the network token card number. Dynamic CVV is only supported for Amex and SCOF. If "CRYPTOGRAM" is supplied then cryptogram will be requested and returned with the network token card number. Cryptogram is NOT supported for Amex. Possible Values:

- NETWORK_TOKEN
- SECURITY_CODE
- CRYPTOGRAM

Returns:

  • (String)


27
28
29
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 27

def payment_credential_type
  @payment_credential_type
end

#transaction_typeString

Specifies the type of transaction for which the network token credentials are required. Possible Values:

- ECOM: Ecommerce transaction. If transactionType is not provided, ECOM

is set as the default.

  • AFT: Account Funding Transaction. This is only supported for VISA and paymentCredentialType of CRYPTOGRAM.

Returns:

  • (String)


37
38
39
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 37

def transaction_type
  @transaction_type
end

Class Method Details

.from_element(root) ⇒ Object



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 153

def self.from_element(root)
  payment_credential_type = XmlUtilities.from_element(
    root, 'paymentCredentialType', String
  )
  transaction_type = XmlUtilities.from_element(root, 'transactionType',
                                               String)
  client_correlation_id = XmlUtilities.from_element(root,
                                                    'clientCorrelationId',
                                                    String)
  order_information = XmlUtilities.from_element(root, 'OrderInformation33',
                                                OrderInformation33)
  merchant_information = XmlUtilities.from_element(
    root, 'tmsMerchantInformation2', TmsMerchantInformation2
  )
  device_information = XmlUtilities.from_element(root,
                                                 'DeviceInformation11',
                                                 DeviceInformation11)
  authenticated_identities = XmlUtilities.from_element_to_array(
    root, 'AuthenticatedIdentity1', AuthenticatedIdentity1
  )

  new(payment_credential_type: payment_credential_type,
      transaction_type: transaction_type,
      client_correlation_id: client_correlation_id,
      order_information: order_information,
      merchant_information: merchant_information,
      device_information: device_information,
      authenticated_identities: authenticated_identities,
      additional_properties: additional_properties)
end

.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 108

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_credential_type =
    hash.key?('paymentCredentialType') ? hash['paymentCredentialType'] : SKIP
  transaction_type =
    hash.key?('transactionType') ? hash['transactionType'] : SKIP
  client_correlation_id =
    hash.key?('clientCorrelationId') ? hash['clientCorrelationId'] : SKIP
  order_information = OrderInformation33.from_hash(hash['orderInformation']) if
    hash['orderInformation']
  merchant_information = TmsMerchantInformation2.from_hash(hash['merchantInformation']) if
    hash['merchantInformation']
  device_information = DeviceInformation11.from_hash(hash['deviceInformation']) if
    hash['deviceInformation']
  # Parameter is an array, so we need to iterate through it
  authenticated_identities = nil
  unless hash['authenticatedIdentities'].nil?
    authenticated_identities = []
    hash['authenticatedIdentities'].each do |structure|
      authenticated_identities << (AuthenticatedIdentity1.from_hash(structure) if structure)
    end
  end

  authenticated_identities = SKIP unless hash.key?('authenticatedIdentities')

  # 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.
  PostPaymentCredentialsRequest.new(payment_credential_type: payment_credential_type,
                                    transaction_type: transaction_type,
                                    client_correlation_id: client_correlation_id,
                                    order_information: order_information,
                                    merchant_information: merchant_information,
                                    device_information: device_information,
                                    authenticated_identities: authenticated_identities,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



60
61
62
63
64
65
66
67
68
69
70
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 60

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_credential_type'] = 'paymentCredentialType'
  @_hash['transaction_type'] = 'transactionType'
  @_hash['client_correlation_id'] = 'clientCorrelationId'
  @_hash['order_information'] = 'orderInformation'
  @_hash['merchant_information'] = 'merchantInformation'
  @_hash['device_information'] = 'deviceInformation'
  @_hash['authenticated_identities'] = 'authenticatedIdentities'
  @_hash
end

.nullablesObject

An array for nullable fields



86
87
88
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 86

def self.nullables
  []
end

.optionalsObject

An array for optional fields



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 73

def self.optionals
  %w[
    payment_credential_type
    transaction_type
    client_correlation_id
    order_information
    merchant_information
    device_information
    authenticated_identities
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



218
219
220
221
222
223
224
225
226
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 218

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_credential_type: #{@payment_credential_type.inspect},"\
  " transaction_type: #{@transaction_type.inspect}, client_correlation_id:"\
  " #{@client_correlation_id.inspect}, order_information: #{@order_information.inspect},"\
  " merchant_information: #{@merchant_information.inspect}, device_information:"\
  " #{@device_information.inspect}, authenticated_identities:"\
  " #{@authenticated_identities.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



208
209
210
211
212
213
214
215
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 208

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_credential_type: #{@payment_credential_type}, transaction_type:"\
  " #{@transaction_type}, client_correlation_id: #{@client_correlation_id}, order_information:"\
  " #{@order_information}, merchant_information: #{@merchant_information}, device_information:"\
  " #{@device_information}, authenticated_identities: #{@authenticated_identities},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/cyber_source_merged_spec/models/post_payment_credentials_request.rb', line 184

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'paymentCredentialType',
                                 payment_credential_type)
  XmlUtilities.add_as_subelement(doc, root, 'transactionType',
                                 transaction_type)
  XmlUtilities.add_as_subelement(doc, root, 'clientCorrelationId',
                                 client_correlation_id)
  XmlUtilities.add_as_subelement(doc, root, 'OrderInformation33',
                                 order_information)
  XmlUtilities.add_as_subelement(doc, root, 'tmsMerchantInformation2',
                                 merchant_information)
  XmlUtilities.add_as_subelement(doc, root, 'DeviceInformation11',
                                 device_information)
  XmlUtilities.add_array_as_subelement(doc, root, 'AuthenticatedIdentity1',
                                       authenticated_identities)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end