Class: PaypalServerSdk::PaypalWalletVaultInstruction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::PaypalWalletVaultInstruction
- Defined in:
- lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb
Overview
Resource consolidating common request and response attributes for vaulting PayPal Wallet.
Instance Attribute Summary collapse
-
#customer_type ⇒ PaypalPaymentTokenCustomerType
The customer type associated with the PayPal payment token.
-
#description ⇒ String
The description displayed to PayPal consumer on the approval flow for PayPal, as well as on the PayPal payment token management experience on PayPal.com.
-
#permit_multiple_payment_tokens ⇒ TrueClass | FalseClass
Create multiple payment tokens for the same payer, merchant/platform combination.
-
#usage_pattern ⇒ UsagePattern
Expected business/pricing model for the billing agreement.
-
#usage_type ⇒ PaypalPaymentTokenUsageType
The usage type associated with the PayPal payment token.
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(usage_type:, description: SKIP, usage_pattern: SKIP, customer_type: PaypalPaymentTokenCustomerType::CONSUMER, permit_multiple_payment_tokens: false) ⇒ PaypalWalletVaultInstruction
constructor
A new instance of PaypalWalletVaultInstruction.
-
#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(usage_type:, description: SKIP, usage_pattern: SKIP, customer_type: PaypalPaymentTokenCustomerType::CONSUMER, permit_multiple_payment_tokens: false) ⇒ PaypalWalletVaultInstruction
Returns a new instance of PaypalWalletVaultInstruction.
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 71 def initialize(usage_type:, description: SKIP, usage_pattern: SKIP, customer_type: PaypalPaymentTokenCustomerType::CONSUMER, permit_multiple_payment_tokens: false) @description = description unless description == SKIP @usage_pattern = usage_pattern unless usage_pattern == SKIP @usage_type = usage_type @customer_type = customer_type unless customer_type == SKIP unless permit_multiple_payment_tokens == SKIP @permit_multiple_payment_tokens = permit_multiple_payment_tokens end end |
Instance Attribute Details
#customer_type ⇒ PaypalPaymentTokenCustomerType
The customer type associated with the PayPal payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.
31 32 33 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 31 def customer_type @customer_type end |
#description ⇒ String
The description displayed to PayPal consumer on the approval flow for PayPal, as well as on the PayPal payment token management experience on PayPal.com.
17 18 19 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 17 def description @description end |
#permit_multiple_payment_tokens ⇒ TrueClass | FalseClass
Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.
42 43 44 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 42 def permit_multiple_payment_tokens @permit_multiple_payment_tokens end |
#usage_pattern ⇒ UsagePattern
Expected business/pricing model for the billing agreement.
21 22 23 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 21 def usage_pattern @usage_pattern end |
#usage_type ⇒ PaypalPaymentTokenUsageType
The usage type associated with the PayPal payment token.
25 26 27 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 25 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 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 85 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. usage_type = hash.key?('usage_type') ? hash['usage_type'] : nil description = hash.key?('description') ? hash['description'] : SKIP usage_pattern = hash.key?('usage_pattern') ? hash['usage_pattern'] : SKIP customer_type = hash['customer_type'] ||= PaypalPaymentTokenCustomerType::CONSUMER permit_multiple_payment_tokens = hash['permit_multiple_payment_tokens'] ||= false # Create object from extracted values. PaypalWalletVaultInstruction.new(usage_type: usage_type, description: description, usage_pattern: usage_pattern, customer_type: customer_type, permit_multiple_payment_tokens: permit_multiple_payment_tokens) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['description'] = 'description' @_hash['usage_pattern'] = 'usage_pattern' @_hash['usage_type'] = 'usage_type' @_hash['customer_type'] = 'customer_type' @_hash['permit_multiple_payment_tokens'] = 'permit_multiple_payment_tokens' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
57 58 59 60 61 62 63 64 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 57 def self.optionals %w[ description usage_pattern customer_type permit_multiple_payment_tokens ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 120 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} description: #{@description.inspect}, usage_pattern:"\ " #{@usage_pattern.inspect}, usage_type: #{@usage_type.inspect}, customer_type:"\ " #{@customer_type.inspect}, permit_multiple_payment_tokens:"\ " #{@permit_multiple_payment_tokens.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
106 107 108 109 110 111 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_instruction.rb', line 106 def to_s class_name = self.class.name.split('::').last "<#{class_name} description: #{@description}, usage_pattern: #{@usage_pattern}, usage_type:"\ " #{@usage_type}, customer_type: #{@customer_type}, permit_multiple_payment_tokens:"\ " #{@permit_multiple_payment_tokens}>" end |