Class: PaypalServerSdk::GooglePayWalletResponse

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

Overview

Google Pay Wallet payment data.

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(name: SKIP, email_address: SKIP, phone_number: SKIP, card: SKIP) ⇒ GooglePayWalletResponse

Returns a new instance of GooglePayWalletResponse.



58
59
60
61
62
63
64
# File 'lib/paypal_server_sdk/models/google_pay_wallet_response.rb', line 58

def initialize(name: SKIP, email_address: SKIP, phone_number: SKIP,
               card: SKIP)
  @name = name unless name == SKIP
  @email_address = email_address unless email_address == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @card = card unless card == SKIP
end

Instance Attribute Details

#cardGooglePayCardResponse

The payment card to use to fund a Google Pay payment response. Can be a credit or debit card.



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

def card
  @card
end

#email_addressString

The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.

Returns:

  • (String)


21
22
23
# File 'lib/paypal_server_sdk/models/google_pay_wallet_response.rb', line 21

def email_address
  @email_address
end

#nameString

The full name representation like Mr J Smith.

Returns:

  • (String)


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

def name
  @name
end

#phone_numberPhoneNumberWithCountryCode

The phone number in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).



26
27
28
# File 'lib/paypal_server_sdk/models/google_pay_wallet_response.rb', line 26

def phone_number
  @phone_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/paypal_server_sdk/models/google_pay_wallet_response.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
  phone_number = PhoneNumberWithCountryCode.from_hash(hash['phone_number']) if
    hash['phone_number']
  card = GooglePayCardResponse.from_hash(hash['card']) if hash['card']

  # Create object from extracted values.
  GooglePayWalletResponse.new(name: name,
                              email_address: email_address,
                              phone_number: phone_number,
                              card: card)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
# File 'lib/paypal_server_sdk/models/google_pay_wallet_response.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['email_address'] = 'email_address'
  @_hash['phone_number'] = 'phone_number'
  @_hash['card'] = 'card'
  @_hash
end

.nullablesObject

An array for nullable fields



54
55
56
# File 'lib/paypal_server_sdk/models/google_pay_wallet_response.rb', line 54

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
# File 'lib/paypal_server_sdk/models/google_pay_wallet_response.rb', line 44

def self.optionals
  %w[
    name
    email_address
    phone_number
    card
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



92
93
94
95
96
# File 'lib/paypal_server_sdk/models/google_pay_wallet_response.rb', line 92

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

#to_sObject

Provides a human-readable string representation of the object.



85
86
87
88
89
# File 'lib/paypal_server_sdk/models/google_pay_wallet_response.rb', line 85

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