Class: PaypalServerSdk::PaypalWalletAttributesResponse

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

Overview

Additional attributes associated with the use of a 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(vault: SKIP, cobranded_cards: SKIP) ⇒ PaypalWalletAttributesResponse

Returns a new instance of PaypalWalletAttributesResponse.



43
44
45
46
# File 'lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb', line 43

def initialize(vault: SKIP, cobranded_cards: SKIP)
  @vault = vault unless vault == SKIP
  @cobranded_cards = cobranded_cards unless cobranded_cards == SKIP
end

Instance Attribute Details

#cobranded_cardsArray[CobrandedCard]

An array of merchant cobranded cards used by buyer to complete an order. This array will be present if a merchant has onboarded their cobranded card with PayPal and provided corresponding label(s).

Returns:



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

def cobranded_cards
  @cobranded_cards
end

#vaultPaypalWalletVaultResponse

The details about a saved PayPal Wallet payment source.



14
15
16
# File 'lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb', line 14

def vault
  @vault
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb', line 49

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  vault = PaypalWalletVaultResponse.from_hash(hash['vault']) if hash['vault']
  # Parameter is an array, so we need to iterate through it
  cobranded_cards = nil
  unless hash['cobranded_cards'].nil?
    cobranded_cards = []
    hash['cobranded_cards'].each do |structure|
      cobranded_cards << (CobrandedCard.from_hash(structure) if structure)
    end
  end

  cobranded_cards = SKIP unless hash.key?('cobranded_cards')

  # Create object from extracted values.
  PaypalWalletAttributesResponse.new(vault: vault,
                                     cobranded_cards: cobranded_cards)
end

.namesObject

A mapping from model property names to API property names.



23
24
25
26
27
28
# File 'lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb', line 23

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['vault'] = 'vault'
  @_hash['cobranded_cards'] = 'cobranded_cards'
  @_hash
end

.nullablesObject

An array for nullable fields



39
40
41
# File 'lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb', line 39

def self.nullables
  []
end

.optionalsObject

An array for optional fields



31
32
33
34
35
36
# File 'lib/paypal_server_sdk/models/paypal_wallet_attributes_response.rb', line 31

def self.optionals
  %w[
    vault
    cobranded_cards
  ]
end