Class: PaypalServerSdk::GooglePayRequestCard

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

Overview

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

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, type: SKIP, brand: SKIP, billing_address: SKIP) ⇒ GooglePayRequestCard

Returns a new instance of GooglePayRequestCard.



60
61
62
63
64
65
# File 'lib/paypal_server_sdk/models/google_pay_request_card.rb', line 60

def initialize(name: SKIP, type: SKIP, brand: SKIP, billing_address: SKIP)
  @name = name unless name == SKIP
  @type = type unless type == SKIP
  @brand = brand unless brand == SKIP
  @billing_address = billing_address unless billing_address == SKIP
end

Instance Attribute Details

#billing_addressAddress

The portable international postal address. Maps to [AddressValidationMetadata](github.com/googlei18n/libaddressinput/ wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](www.w3.org/TR/html51/sec-forms.html#autofilling-form-co ntrols-the-autocomplete-attribute).

Returns:



33
34
35
# File 'lib/paypal_server_sdk/models/google_pay_request_card.rb', line 33

def billing_address
  @billing_address
end

#brandCardBrand

The card network or brand. Applies to credit, debit, gift, and payment cards.

Returns:



24
25
26
# File 'lib/paypal_server_sdk/models/google_pay_request_card.rb', line 24

def brand
  @brand
end

#nameString

The card holder’s name as it appears on the card.

Returns:

  • (String)


15
16
17
# File 'lib/paypal_server_sdk/models/google_pay_request_card.rb', line 15

def name
  @name
end

#typeCardType

Type of card. i.e Credit, Debit and so on.

Returns:



19
20
21
# File 'lib/paypal_server_sdk/models/google_pay_request_card.rb', line 19

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  brand = hash.key?('brand') ? hash['brand'] : SKIP
  billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address']

  # Create object from extracted values.
  GooglePayRequestCard.new(name: name,
                           type: type,
                           brand: brand,
                           billing_address: billing_address)
end

.namesObject

A mapping from model property names to API property names.



36
37
38
39
40
41
42
43
# File 'lib/paypal_server_sdk/models/google_pay_request_card.rb', line 36

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['type'] = 'type'
  @_hash['brand'] = 'brand'
  @_hash['billing_address'] = 'billing_address'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/paypal_server_sdk/models/google_pay_request_card.rb', line 56

def self.nullables
  []
end

.optionalsObject

An array for optional fields



46
47
48
49
50
51
52
53
# File 'lib/paypal_server_sdk/models/google_pay_request_card.rb', line 46

def self.optionals
  %w[
    name
    type
    brand
    billing_address
  ]
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_request_card.rb', line 92

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, type: #{@type.inspect}, brand: #{@brand.inspect},"\
  " billing_address: #{@billing_address.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_request_card.rb', line 85

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