Class: PaypalServerSdk::ApplePayCard
- Defined in:
- lib/paypal_server_sdk/models/apple_pay_card.rb
Overview
The payment card to be used to fund a payment. Can be a credit or debit card.
Instance Attribute Summary collapse
-
#billing_address ⇒ Address
The portable international postal address.
-
#brand ⇒ CardBrand
The card network or brand.
-
#last_digits ⇒ String
The last digits of the payment card.
-
#name ⇒ String
The card holder’s name as it appears on the card.
-
#type ⇒ CardType
Type of card.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(name: SKIP, last_digits: SKIP, type: SKIP, brand: SKIP, billing_address: SKIP) ⇒ ApplePayCard
constructor
A new instance of ApplePayCard.
Methods inherited from BaseModel
Constructor Details
#initialize(name: SKIP, last_digits: SKIP, type: SKIP, brand: SKIP, billing_address: SKIP) ⇒ ApplePayCard
Returns a new instance of ApplePayCard.
66 67 68 69 70 71 72 73 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 66 def initialize(name: SKIP, last_digits: SKIP, type: SKIP, brand: SKIP, billing_address: SKIP) @name = name unless name == SKIP @last_digits = last_digits unless last_digits == SKIP @type = type unless type == SKIP @brand = brand unless brand == SKIP @billing_address = billing_address unless billing_address == SKIP end |
Instance Attribute Details
#billing_address ⇒ Address
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).
37 38 39 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 37 def billing_address @billing_address end |
#brand ⇒ CardBrand
The card network or brand. Applies to credit, debit, gift, and payment cards.
28 29 30 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 28 def brand @brand end |
#last_digits ⇒ String
The last digits of the payment card.
19 20 21 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 19 def last_digits @last_digits end |
#name ⇒ String
The card holder’s name as it appears on the card.
15 16 17 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 15 def name @name end |
#type ⇒ CardType
Type of card. i.e Credit, Debit and so on.
23 24 25 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 23 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP last_digits = hash.key?('last_digits') ? hash['last_digits'] : 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. ApplePayCard.new(name: name, last_digits: last_digits, type: type, brand: brand, billing_address: billing_address) end |
.names ⇒ Object
A mapping from model property names to API property names.
40 41 42 43 44 45 46 47 48 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 40 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['last_digits'] = 'last_digits' @_hash['type'] = 'type' @_hash['brand'] = 'brand' @_hash['billing_address'] = 'billing_address' @_hash end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 62 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 54 55 56 57 58 59 |
# File 'lib/paypal_server_sdk/models/apple_pay_card.rb', line 51 def self.optionals %w[ name last_digits type brand billing_address ] end |