Class: MundiApi::CreateCardTokenRequest
- Defined in:
- lib/mundi_api/models/create_card_token_request.rb
Overview
Card token data
Instance Attribute Summary collapse
-
#brand ⇒ String
Card brand.
-
#cvv ⇒ String
The card’s security code.
-
#exp_month ⇒ Integer
The expiration month.
-
#exp_year ⇒ Integer
The expiration year, that can be informed with 2 or 4 digits.
-
#holder_name ⇒ String
Holder name, as written on the card.
-
#number ⇒ String
Credit card number.
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.
Instance Method Summary collapse
-
#initialize(number = nil, holder_name = nil, exp_month = nil, exp_year = nil, cvv = nil, brand = nil) ⇒ CreateCardTokenRequest
constructor
A new instance of CreateCardTokenRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(number = nil, holder_name = nil, exp_month = nil, exp_year = nil, cvv = nil, brand = nil) ⇒ CreateCardTokenRequest
Returns a new instance of CreateCardTokenRequest.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/mundi_api/models/create_card_token_request.rb', line 45 def initialize(number = nil, holder_name = nil, exp_month = nil, exp_year = nil, cvv = nil, brand = nil) @number = number @holder_name = holder_name @exp_month = exp_month @exp_year = exp_year @cvv = cvv @brand = brand end |
Instance Attribute Details
#brand ⇒ String
Card brand
29 30 31 |
# File 'lib/mundi_api/models/create_card_token_request.rb', line 29 def brand @brand end |
#cvv ⇒ String
The card’s security code
25 26 27 |
# File 'lib/mundi_api/models/create_card_token_request.rb', line 25 def cvv @cvv end |
#exp_month ⇒ Integer
The expiration month
17 18 19 |
# File 'lib/mundi_api/models/create_card_token_request.rb', line 17 def exp_month @exp_month end |
#exp_year ⇒ Integer
The expiration year, that can be informed with 2 or 4 digits
21 22 23 |
# File 'lib/mundi_api/models/create_card_token_request.rb', line 21 def exp_year @exp_year end |
#holder_name ⇒ String
Holder name, as written on the card
13 14 15 |
# File 'lib/mundi_api/models/create_card_token_request.rb', line 13 def holder_name @holder_name end |
#number ⇒ String
Credit card number
9 10 11 |
# File 'lib/mundi_api/models/create_card_token_request.rb', line 9 def number @number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/mundi_api/models/create_card_token_request.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. number = hash['number'] holder_name = hash['holder_name'] exp_month = hash['exp_month'] exp_year = hash['exp_year'] cvv = hash['cvv'] brand = hash['brand'] # Create object from extracted values. CreateCardTokenRequest.new(number, holder_name, exp_month, exp_year, cvv, brand) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/mundi_api/models/create_card_token_request.rb', line 32 def self.names if @_hash.nil? @_hash = {} @_hash['number'] = 'number' @_hash['holder_name'] = 'holder_name' @_hash['exp_month'] = 'exp_month' @_hash['exp_year'] = 'exp_year' @_hash['cvv'] = 'cvv' @_hash['brand'] = 'brand' end @_hash end |