Class: PaypalServerSdk::ApplePayRequestCard
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::ApplePayRequestCard
- 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
-
#billing_address ⇒ Address
The portable international postal address.
-
#brand ⇒ CardBrand
The card network or brand.
-
#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(type: SKIP, brand: SKIP, billing_address: SKIP) ⇒ ApplePayRequestCard
constructor
A new instance of ApplePayRequestCard.
-
#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(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_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).
29 30 31 |
# File 'lib/paypal_server_sdk/models/apple_pay_request_card.rb', line 29 def billing_address @billing_address end |
#brand ⇒ CardBrand
The card network or brand. Applies to credit, debit, gift, and payment cards.
20 21 22 |
# File 'lib/paypal_server_sdk/models/apple_pay_request_card.rb', line 20 def brand @brand end |
#type ⇒ CardType
Type of card. i.e Credit, Debit and so on.
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
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 |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_s ⇒ Object
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 |