Class: PaypalServerSdk::VaultPaypalWalletRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb

Overview

A resource representing a request to vault PayPal Wallet.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(description: SKIP, shipping: SKIP, permit_multiple_payment_tokens: false, usage_type: SKIP, customer_type: SKIP, experience_context: SKIP) ⇒ VaultPaypalWalletRequest

Returns a new instance of VaultPaypalWalletRequest.



77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 77

def initialize(description: SKIP, shipping: SKIP,
               permit_multiple_payment_tokens: false, usage_type: SKIP,
               customer_type: SKIP, experience_context: SKIP)
  @description = description unless description == SKIP
  @shipping = shipping unless shipping == SKIP
  unless permit_multiple_payment_tokens == SKIP
    @permit_multiple_payment_tokens =
      permit_multiple_payment_tokens
  end
  @usage_type = usage_type unless usage_type == SKIP
  @customer_type = customer_type unless customer_type == SKIP
  @experience_context = experience_context unless experience_context == SKIP
end

Instance Attribute Details

#customer_typeString

The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.

Returns:

  • (String)


41
42
43
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 41

def customer_type
  @customer_type
end

#descriptionString

The description displayed to the consumer on the approval flow for a digital wallet, as well as on the merchant view of the payment token management experience. exp: PayPal.com.

Returns:

  • (String)


16
17
18
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 16

def description
  @description
end

#experience_contextVaultExperienceContext

Customizes the Vault creation flow experience for your customers.



45
46
47
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 45

def experience_context
  @experience_context
end

#permit_multiple_payment_tokensTrueClass | 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.

Returns:

  • (TrueClass | FalseClass)


31
32
33
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 31

def permit_multiple_payment_tokens
  @permit_multiple_payment_tokens
end

#shippingVaultedDigitalWalletShippingDetails

The shipping details.



20
21
22
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 20

def shipping
  @shipping
end

#usage_typeString

The usage type associated with a digital wallet payment token.

Returns:

  • (String)


35
36
37
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 35

def usage_type
  @usage_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 92

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  description = hash.key?('description') ? hash['description'] : SKIP
  shipping = VaultedDigitalWalletShippingDetails.from_hash(hash['shipping']) if
    hash['shipping']
  permit_multiple_payment_tokens =
    hash['permit_multiple_payment_tokens'] ||= false
  usage_type = hash.key?('usage_type') ? hash['usage_type'] : SKIP
  customer_type = hash.key?('customer_type') ? hash['customer_type'] : SKIP
  experience_context = VaultExperienceContext.from_hash(hash['experience_context']) if
    hash['experience_context']

  # Create object from extracted values.
  VaultPaypalWalletRequest.new(description: description,
                               shipping: shipping,
                               permit_multiple_payment_tokens: permit_multiple_payment_tokens,
                               usage_type: usage_type,
                               customer_type: customer_type,
                               experience_context: experience_context)
end

.namesObject

A mapping from model property names to API property names.



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 48

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['description'] = 'description'
  @_hash['shipping'] = 'shipping'
  @_hash['permit_multiple_payment_tokens'] =
    'permit_multiple_payment_tokens'
  @_hash['usage_type'] = 'usage_type'
  @_hash['customer_type'] = 'customer_type'
  @_hash['experience_context'] = 'experience_context'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/paypal_server_sdk/models/vault_paypal_wallet_request.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    description
    shipping
    permit_multiple_payment_tokens
    usage_type
    customer_type
    experience_context
  ]
end