Class: PaypalServerSdk::ApplePayTokenizedCard
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::ApplePayTokenizedCard
- Defined in:
- lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb
Overview
The payment card to use 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.
-
#card_type ⇒ CardBrand
The card brand or network.
-
#expiry ⇒ String
The year and month, in ISO-8601 ‘YYYY-MM` date format.
-
#name ⇒ String
The card holder’s name as it appears on the card.
-
#number ⇒ String
The primary account number (PAN) for the payment 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, number: SKIP, expiry: SKIP, card_type: SKIP, type: SKIP, brand: SKIP, billing_address: SKIP) ⇒ ApplePayTokenizedCard
constructor
A new instance of ApplePayTokenizedCard.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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, number: SKIP, expiry: SKIP, card_type: SKIP, type: SKIP, brand: SKIP, billing_address: SKIP) ⇒ ApplePayTokenizedCard
Returns a new instance of ApplePayTokenizedCard.
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 78 def initialize(name: SKIP, number: SKIP, expiry: SKIP, card_type: SKIP, type: SKIP, brand: SKIP, billing_address: SKIP) @name = name unless name == SKIP @number = number unless number == SKIP @expiry = expiry unless expiry == SKIP @card_type = card_type unless card_type == 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).
45 46 47 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 45 def billing_address @billing_address end |
#brand ⇒ CardBrand
The card network or brand. Applies to credit, debit, gift, and payment cards.
36 37 38 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 36 def brand @brand end |
#card_type ⇒ CardBrand
The card brand or network. Typically used in the response.
27 28 29 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 27 def card_type @card_type end |
#expiry ⇒ String
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).
23 24 25 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 23 def expiry @expiry end |
#name ⇒ String
The card holder’s name as it appears on the card.
14 15 16 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 14 def name @name end |
#number ⇒ String
The primary account number (PAN) for the payment card.
18 19 20 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 18 def number @number end |
#type ⇒ CardType
Type of card. i.e Credit, Debit and so on.
31 32 33 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 31 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 90 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP number = hash.key?('number') ? hash['number'] : SKIP expiry = hash.key?('expiry') ? hash['expiry'] : SKIP card_type = hash.key?('card_type') ? hash['card_type'] : 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. ApplePayTokenizedCard.new(name: name, number: number, expiry: expiry, card_type: card_type, type: type, brand: brand, billing_address: billing_address) end |
.names ⇒ Object
A mapping from model property names to API property names.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 48 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['number'] = 'number' @_hash['expiry'] = 'expiry' @_hash['card_type'] = 'card_type' @_hash['type'] = 'type' @_hash['brand'] = 'brand' @_hash['billing_address'] = 'billing_address' @_hash end |
.nullables ⇒ Object
An array for nullable fields
74 75 76 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 74 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 61 def self.optionals %w[ name number expiry card_type type brand billing_address ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
120 121 122 123 124 125 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 120 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, number: #{@number.inspect}, expiry:"\ " #{@expiry.inspect}, card_type: #{@card_type.inspect}, type: #{@type.inspect}, brand:"\ " #{@brand.inspect}, billing_address: #{@billing_address.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
113 114 115 116 117 |
# File 'lib/paypal_server_sdk/models/apple_pay_tokenized_card.rb', line 113 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, number: #{@number}, expiry: #{@expiry}, card_type:"\ " #{@card_type}, type: #{@type}, brand: #{@brand}, billing_address: #{@billing_address}>" end |