Class: PaypalServerSdk::CardResponseWithBillingAddress

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

Overview

The payment card used to fund the payment. Card 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, billing_address: SKIP, expiry: SKIP, currency_code: SKIP) ⇒ CardResponseWithBillingAddress

Returns a new instance of CardResponseWithBillingAddress.



61
62
63
64
65
66
67
# File 'lib/paypal_server_sdk/models/card_response_with_billing_address.rb', line 61

def initialize(name: SKIP, billing_address: SKIP, expiry: SKIP,
               currency_code: SKIP)
  @name = name unless name == SKIP
  @billing_address = billing_address unless billing_address == SKIP
  @expiry = expiry unless expiry == SKIP
  @currency_code = currency_code unless currency_code == 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:



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

def billing_address
  @billing_address
end

#currency_codeString

The [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that identifies the currency.

Returns:

  • (String)


34
35
36
# File 'lib/paypal_server_sdk/models/card_response_with_billing_address.rb', line 34

def currency_code
  @currency_code
end

#expiryString

The year and month, in ISO-8601 ‘YYYY-MM` date format. See [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6).

Returns:

  • (String)


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

def expiry
  @expiry
end

#nameString

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

Returns:

  • (String)


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

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  name = hash.key?('name') ? hash['name'] : SKIP
  billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address']
  expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
  currency_code = hash.key?('currency_code') ? hash['currency_code'] : SKIP

  # Create object from extracted values.

  CardResponseWithBillingAddress.new(name: name,
                                     billing_address: billing_address,
                                     expiry: expiry,
                                     currency_code: currency_code)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



57
58
59
# File 'lib/paypal_server_sdk/models/card_response_with_billing_address.rb', line 57

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    name
    billing_address
    expiry
    currency_code
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



94
95
96
97
98
# File 'lib/paypal_server_sdk/models/card_response_with_billing_address.rb', line 94

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

#to_sObject

Provides a human-readable string representation of the object.



87
88
89
90
91
# File 'lib/paypal_server_sdk/models/card_response_with_billing_address.rb', line 87

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