Class: PaypalServerSdk::CardFromRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::CardFromRequest
- Defined in:
- lib/paypal_server_sdk/models/card_from_request.rb
Overview
Representation of card details as received in the request.
Instance Attribute Summary collapse
-
#expiry ⇒ String
The year and month, in ISO-8601 ‘YYYY-MM` date format.
-
#last_digits ⇒ String
The last digits of the payment 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(expiry: SKIP, last_digits: SKIP) ⇒ CardFromRequest
constructor
A new instance of CardFromRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(expiry: SKIP, last_digits: SKIP) ⇒ CardFromRequest
Returns a new instance of CardFromRequest.
42 43 44 45 |
# File 'lib/paypal_server_sdk/models/card_from_request.rb', line 42 def initialize(expiry: SKIP, last_digits: SKIP) @expiry = expiry unless expiry == SKIP @last_digits = last_digits unless last_digits == SKIP end |
Instance Attribute Details
#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).
15 16 17 |
# File 'lib/paypal_server_sdk/models/card_from_request.rb', line 15 def expiry @expiry end |
#last_digits ⇒ String
The last digits of the payment card.
19 20 21 |
# File 'lib/paypal_server_sdk/models/card_from_request.rb', line 19 def last_digits @last_digits end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/paypal_server_sdk/models/card_from_request.rb', line 48 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. expiry = hash.key?('expiry') ? hash['expiry'] : SKIP last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP # Create object from extracted values. CardFromRequest.new(expiry: expiry, last_digits: last_digits) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/paypal_server_sdk/models/card_from_request.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['expiry'] = 'expiry' @_hash['last_digits'] = 'last_digits' @_hash end |
.nullables ⇒ Object
An array for nullable fields
38 39 40 |
# File 'lib/paypal_server_sdk/models/card_from_request.rb', line 38 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
30 31 32 33 34 35 |
# File 'lib/paypal_server_sdk/models/card_from_request.rb', line 30 def self.optionals %w[ expiry last_digits ] end |