Class: PaypalServerSdk::ApplePayRequestCard

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

Overview

The payment card to be used to fund a 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(type: SKIP, brand: SKIP, billing_address: SKIP) ⇒ ApplePayRequestCard

Returns a new instance of ApplePayRequestCard.



54
55
56
57
58
# File 'lib/paypal_server_sdk/models/apple_pay_request_card.rb', line 54

def initialize(type: SKIP, brand: SKIP, billing_address: 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:



29
30
31
# File 'lib/paypal_server_sdk/models/apple_pay_request_card.rb', line 29

def billing_address
  @billing_address
end

#brandCardBrand

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

Returns:



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

def brand
  @brand
end

#typeCardType

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

Returns:



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

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  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.
  ApplePayRequestCard.new(type: type,
                          brand: brand,
                          billing_address: billing_address)
end

.namesObject

A mapping from model property names to API property names.



32
33
34
35
36
37
38
# File 'lib/paypal_server_sdk/models/apple_pay_request_card.rb', line 32

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

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/paypal_server_sdk/models/apple_pay_request_card.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



41
42
43
44
45
46
47
# File 'lib/paypal_server_sdk/models/apple_pay_request_card.rb', line 41

def self.optionals
  %w[
    type
    brand
    billing_address
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



82
83
84
85
86
# File 'lib/paypal_server_sdk/models/apple_pay_request_card.rb', line 82

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

#to_sObject

Provides a human-readable string representation of the object.



76
77
78
79
# File 'lib/paypal_server_sdk/models/apple_pay_request_card.rb', line 76

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