Class: VisaAcceptanceMergedSpec::TokenizedPaymentMethod2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::TokenizedPaymentMethod2
- Defined in:
- lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb
Overview
TokenizedPaymentMethod2 Model.
Instance Attribute Summary collapse
-
#allow_multiple_tokens ⇒ TrueClass | FalseClass
Create multiple payment tokens for the same payer, merchant/platform combination.
-
#description ⇒ String
Description of the vaulted payment method shown to the buyer during checkout and in their PayPal account.
-
#usage_pattern ⇒ String
Indicates how the merchant will primarily use the vaulted payment method.
-
#usage_type ⇒ String
Indicates the type of vaulting relationship.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(description: SKIP, usage_pattern: SKIP, usage_type: SKIP, allow_multiple_tokens: SKIP, additional_properties: nil) ⇒ TokenizedPaymentMethod2
constructor
A new instance of TokenizedPaymentMethod2.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(description: SKIP, usage_pattern: SKIP, usage_type: SKIP, allow_multiple_tokens: SKIP, additional_properties: nil) ⇒ TokenizedPaymentMethod2
Returns a new instance of TokenizedPaymentMethod2.
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 72 def initialize(description: SKIP, usage_pattern: SKIP, usage_type: SKIP, allow_multiple_tokens: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @description = description unless description == SKIP @usage_pattern = usage_pattern unless usage_pattern == SKIP @usage_type = usage_type unless usage_type == SKIP @allow_multiple_tokens = allow_multiple_tokens unless allow_multiple_tokens == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#allow_multiple_tokens ⇒ TrueClass | FalseClass
Create multiple payment tokens for the same payer, merchant/platform combination. This helps to identify customers distinctly even though they may share the same PayPal account.
45 46 47 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 45 def allow_multiple_tokens @allow_multiple_tokens end |
#description ⇒ String
Description of the vaulted payment method shown to the buyer during checkout and in their PayPal account.
15 16 17 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 15 def description @description end |
#usage_pattern ⇒ String
Indicates how the merchant will primarily use the vaulted payment method. Valid values:
- “IMMEDIATE”: For on-demand, instant payments. These payments are variable in both amount and frequency and will be used to pay for goods or services before they are rendered to the buyer
- “DEFERRED”: For post-pay payments; that is, payments for goods or services that have already been rendered to the buyer
- “RECURRING_PREPAID”: For recurring payments before services are rendered.
- “RECURRING_POSTPAID”: For recurring payments after services are rendered.
- “THRESHOLD_PREPAID”: For payments when a pre-defined threshold is reached before services are rendered.
- “THRESHOLD_POSTPAID”: For payments when a pre-defined threshold is reached after services are rendered.
33 34 35 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 33 def usage_pattern @usage_pattern end |
#usage_type ⇒ String
Indicates the type of vaulting relationship. Valid values:
- “MERCHANT”: Single merchant relationship.
- “PLATFORM”: Platform hosting multiple merchants.
39 40 41 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 39 def usage_type @usage_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 85 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. description = hash.key?('description') ? hash['description'] : SKIP usage_pattern = hash.key?('usagePattern') ? hash['usagePattern'] : SKIP usage_type = hash.key?('usageType') ? hash['usageType'] : SKIP allow_multiple_tokens = hash.key?('allowMultipleTokens') ? hash['allowMultipleTokens'] : 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. TokenizedPaymentMethod2.new(description: description, usage_pattern: usage_pattern, usage_type: usage_type, allow_multiple_tokens: allow_multiple_tokens, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
48 49 50 51 52 53 54 55 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 48 def self.names @_hash = {} if @_hash.nil? @_hash['description'] = 'description' @_hash['usage_pattern'] = 'usagePattern' @_hash['usage_type'] = 'usageType' @_hash['allow_multiple_tokens'] = 'allowMultipleTokens' @_hash end |
.nullables ⇒ Object
An array for nullable fields
68 69 70 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 68 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
58 59 60 61 62 63 64 65 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 58 def self.optionals %w[ description usage_pattern usage_type allow_multiple_tokens ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
119 120 121 122 123 124 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 119 def inspect class_name = self.class.name.split('::').last "<#{class_name} description: #{@description.inspect}, usage_pattern:"\ " #{@usage_pattern.inspect}, usage_type: #{@usage_type.inspect}, allow_multiple_tokens:"\ " #{@allow_multiple_tokens.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
111 112 113 114 115 116 |
# File 'lib/visa_acceptance_merged_spec/models/tokenized_payment_method2.rb', line 111 def to_s class_name = self.class.name.split('::').last "<#{class_name} description: #{@description}, usage_pattern: #{@usage_pattern}, usage_type:"\ " #{@usage_type}, allow_multiple_tokens: #{@allow_multiple_tokens}, additional_properties:"\ " #{@additional_properties}>" end |