Class: VisaAcceptanceMergedSpec::PostPaymentCredentialsRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_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, additional_properties: nil) ⇒ PostPaymentCredentialsRequest

Returns a new instance of PostPaymentCredentialsRequest.



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

def initialize(payment_credential_type: SKIP, transaction_type: 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
  @additional_properties = additional_properties
end

Instance Attribute Details

#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/visa_acceptance_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/visa_acceptance_merged_spec/models/post_payment_credentials_request.rb', line 37

def transaction_type
  @transaction_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/visa_acceptance_merged_spec/models/post_payment_credentials_request.rb', line 71

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

  # 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,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_credential_type'] = 'paymentCredentialType'
  @_hash['transaction_type'] = 'transactionType'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    payment_credential_type
    transaction_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_sObject

Provides a human-readable string representation of the object.



94
95
96
97
98
# File 'lib/visa_acceptance_merged_spec/models/post_payment_credentials_request.rb', line 94

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