Class: VisaAcceptanceMergedSpec::GenerateUnifiedCheckoutCaptureContextRequest

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

Overview

GenerateUnifiedCheckoutCaptureContextRequest 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(client_version: SKIP, target_origins: SKIP, allowed_card_networks: SKIP, allowed_payment_types: SKIP, country: SKIP, locale: SKIP, capture_mandate: SKIP, complete_mandate: SKIP, order_information: SKIP, transient_token_response_options: SKIP, additional_properties: nil) ⇒ GenerateUnifiedCheckoutCaptureContextRequest

Returns a new instance of GenerateUnifiedCheckoutCaptureContextRequest.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 179

def initialize(client_version: SKIP, target_origins: SKIP,
               allowed_card_networks: SKIP, allowed_payment_types: SKIP,
               country: SKIP, locale: SKIP, capture_mandate: SKIP,
               complete_mandate: SKIP, order_information: SKIP,
               transient_token_response_options: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_version = client_version unless client_version == SKIP
  @target_origins = target_origins unless target_origins == SKIP
  @allowed_card_networks = allowed_card_networks unless allowed_card_networks == SKIP
  @allowed_payment_types = allowed_payment_types unless allowed_payment_types == SKIP
  @country = country unless country == SKIP
  @locale = locale unless locale == SKIP
  @capture_mandate = capture_mandate unless capture_mandate == SKIP
  @complete_mandate = complete_mandate unless complete_mandate == SKIP
  @order_information = order_information unless order_information == SKIP
  unless transient_token_response_options == SKIP
    @transient_token_response_options =
      transient_token_response_options
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#allowed_card_networksArray[String]

The list of card networks you want to use for this Unified Checkout transaction. Unified Checkout currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA - PAYPAK

Returns:

  • (Array[String])


56
57
58
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 56

def allowed_card_networks
  @allowed_card_networks
end

#allowed_payment_typesArray[String]

The payment types that are allowed for the merchant.
Possible values when launching Unified Checkout:

- APPLEPAY
- CHECK
- CLICKTOPAY
- GOOGLEPAY
- PANENTRY              
- PAZE <br><br>

Unified Checkout also supports the following Alternative Payments:

- AFTERPAY<br><br>

Possible values when launching Click To Pay Drop-In UI:

  • CLICKTOPAY

    Important:
    • CLICKTOPAY only available for Visa, Mastercard and AMEX for saved cards.
    • Visa and Mastercard will look to tokenize using network tokenization for all Click to Pay requests. Click to Pay uses Click to Pay token requester IDs and not the merchant's existing token requester.
    • Apple Pay, Google Pay, Check, and Paze can be used independently without requiring PAN entry in the allowedPaymentTypes field.

      Managing Google Pay Authentication Types When you enable Google Pay on Unified Checkout you can specify optional parameters that define the types of card authentication you receive from Google Pay.

      Managing Google Pay Authentication Types Where Click to Pay is the payment type selected by the customer and the customer manually enters their card, the option to enroll their card in Click to Pay will be auto-checked if this field is set to "true". This is only available where the merchant and cardholder are based in the following countries and the billing type is set to "FULL" or "PARTIAL".
    • UAE
    • Argentina
    • Brazil
    • Chile
    • Colombia
    • Kuwait
    • Mexico
    • Peru
    • Qatar
    • Saudi Arabia
    • Ukraine
    • South Africa

      If false, this is not present or not supported in the market. Enrollment in Click to Pay is not checked for the customer when completing manual card entry.

Returns:

  • (Array[String])


104
105
106
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 104

def allowed_payment_types
  @allowed_payment_types
end

#capture_mandateCaptureMandate

Localization of the User experience conforming to the ISO 639-1 language standards and two-character ISO Standard Country Code. Please refer to list of [supported locales through Unified Checkout](

Returns:



121
122
123
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 121

def capture_mandate
  @capture_mandate
end

#client_versionString

Specify the version of Unified Checkout that you want to use.

Returns:

  • (String)


14
15
16
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 14

def client_version
  @client_version
end

#complete_mandateCompleteMandate2

Localization of the User experience conforming to the ISO 639-1 language standards and two-character ISO Standard Country Code. Please refer to list of [supported locales through Unified Checkout](

Returns:



127
128
129
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 127

def complete_mandate
  @complete_mandate
end

#countryString

Country the purchase is originating from (e.g. country of the merchant). Use the two-character ISO Standard

Returns:

  • (String)


109
110
111
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 109

def country
  @country
end

#localeString

Localization of the User experience conforming to the ISO 639-1 language standards and two-character ISO Standard Country Code. Please refer to list of [supported locales through Unified Checkout](

Returns:

  • (String)


115
116
117
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 115

def locale
  @locale
end

#order_informationOrderInformation34

Localization of the User experience conforming to the ISO 639-1 language standards and two-character ISO Standard Country Code. Please refer to list of [supported locales through Unified Checkout](

Returns:



133
134
135
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 133

def order_information
  @order_information
end

#target_originsArray[String]

The [target origin]( of the website on which you will be launching Unified Checkout is defined by the scheme (protocol), hostname (domain) and port number (if used). You must use (unless you use Wildcards are NOT supported. Ensure that subdomains are included. Any valid top-level domain is supported (e.g. .com, .co.uk, .gov.br etc) Examples:

  • If you are embedding within multiple nested iframes you need to specify the origins of all the browser contexts used, for example: targetOrigins: [ " " " ]

Returns:

  • (Array[String])


34
35
36
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 34

def target_origins
  @target_origins
end

#transient_token_response_optionsTransientTokenResponseOptions

Localization of the User experience conforming to the ISO 639-1 language standards and two-character ISO Standard Country Code. Please refer to list of [supported locales through Unified Checkout](



139
140
141
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 139

def transient_token_response_options
  @transient_token_response_options
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 205

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_version = hash.key?('clientVersion') ? hash['clientVersion'] : SKIP
  target_origins = hash.key?('targetOrigins') ? hash['targetOrigins'] : SKIP
  allowed_card_networks =
    hash.key?('allowedCardNetworks') ? hash['allowedCardNetworks'] : SKIP
  allowed_payment_types =
    hash.key?('allowedPaymentTypes') ? hash['allowedPaymentTypes'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  locale = hash.key?('locale') ? hash['locale'] : SKIP
  capture_mandate = CaptureMandate.from_hash(hash['captureMandate']) if hash['captureMandate']
  complete_mandate = CompleteMandate2.from_hash(hash['completeMandate']) if
    hash['completeMandate']
  order_information = OrderInformation34.from_hash(hash['orderInformation']) if
    hash['orderInformation']
  if hash['transientTokenResponseOptions']
    transient_token_response_options = TransientTokenResponseOptions.from_hash(hash['transientTokenResponseOptions'])
  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.
  GenerateUnifiedCheckoutCaptureContextRequest.new(client_version: client_version,
                                                   target_origins: target_origins,
                                                   allowed_card_networks: allowed_card_networks,
                                                   allowed_payment_types: allowed_payment_types,
                                                   country: country,
                                                   locale: locale,
                                                   capture_mandate: capture_mandate,
                                                   complete_mandate: complete_mandate,
                                                   order_information: order_information,
                                                   transient_token_response_options: transient_token_response_options,
                                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 142

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_version'] = 'clientVersion'
  @_hash['target_origins'] = 'targetOrigins'
  @_hash['allowed_card_networks'] = 'allowedCardNetworks'
  @_hash['allowed_payment_types'] = 'allowedPaymentTypes'
  @_hash['country'] = 'country'
  @_hash['locale'] = 'locale'
  @_hash['capture_mandate'] = 'captureMandate'
  @_hash['complete_mandate'] = 'completeMandate'
  @_hash['order_information'] = 'orderInformation'
  @_hash['transient_token_response_options'] =
    'transientTokenResponseOptions'
  @_hash
end

.nullablesObject

An array for nullable fields



175
176
177
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 175

def self.nullables
  []
end

.optionalsObject

An array for optional fields



159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 159

def self.optionals
  %w[
    client_version
    target_origins
    allowed_card_networks
    allowed_payment_types
    country
    locale
    capture_mandate
    complete_mandate
    order_information
    transient_token_response_options
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



259
260
261
262
263
264
265
266
267
268
269
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 259

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_version: #{@client_version.inspect}, target_origins:"\
  " #{@target_origins.inspect}, allowed_card_networks: #{@allowed_card_networks.inspect},"\
  " allowed_payment_types: #{@allowed_payment_types.inspect}, country: #{@country.inspect},"\
  " locale: #{@locale.inspect}, capture_mandate: #{@capture_mandate.inspect},"\
  " complete_mandate: #{@complete_mandate.inspect}, order_information:"\
  " #{@order_information.inspect}, transient_token_response_options:"\
  " #{@transient_token_response_options.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



248
249
250
251
252
253
254
255
256
# File 'lib/visa_acceptance_merged_spec/models/generate_unified_checkout_capture_context_request.rb', line 248

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_version: #{@client_version}, target_origins: #{@target_origins},"\
  " allowed_card_networks: #{@allowed_card_networks}, allowed_payment_types:"\
  " #{@allowed_payment_types}, country: #{@country}, locale: #{@locale}, capture_mandate:"\
  " #{@capture_mandate}, complete_mandate: #{@complete_mandate}, order_information:"\
  " #{@order_information}, transient_token_response_options:"\
  " #{@transient_token_response_options}, additional_properties: #{@additional_properties}>"
end