Class: Levelup::Requests::CreateCard

Inherits:
Base show all
Includes:
Templates::UserAuthenticated
Defined in:
lib/levelup/requests/create_card.rb

Overview

Represents a request to add the first credit card to a specified user account. User access token must have the create_first_credit_card permission.

Constant Summary

Constants inherited from Base

Base::ALLOWED_REQUEST_METHODS

Instance Attribute Summary collapse

Attributes included from Templates::UserAuthenticated

#user_access_token

Instance Method Summary collapse

Methods included from Templates::UserAuthenticated

#auth_type

Methods inherited from Base

#auth_type, #headers, instance_variables_excluded_from_hash, #send_to_api

Methods inherited from Templates::DataParcel

excluded?, #initialize, instance_variables_excluded_from_hash

Constructor Details

This class inherits a constructor from Levelup::Templates::DataParcel

Instance Attribute Details

#encrypted_cvvObject

Returns the value of attribute encrypted_cvv


8
9
10
# File 'lib/levelup/requests/create_card.rb', line 8

def encrypted_cvv
  @encrypted_cvv
end

#encrypted_expiration_monthObject

Returns the value of attribute encrypted_expiration_month


8
9
10
# File 'lib/levelup/requests/create_card.rb', line 8

def encrypted_expiration_month
  @encrypted_expiration_month
end

#encrypted_expiration_yearObject

Returns the value of attribute encrypted_expiration_year


8
9
10
# File 'lib/levelup/requests/create_card.rb', line 8

def encrypted_expiration_year
  @encrypted_expiration_year
end

#encrypted_numberObject

Returns the value of attribute encrypted_number


8
9
10
# File 'lib/levelup/requests/create_card.rb', line 8

def encrypted_number
  @encrypted_number
end

#postal_codeObject

Returns the value of attribute postal_code


8
9
10
# File 'lib/levelup/requests/create_card.rb', line 8

def postal_code
  @postal_code
end

Instance Method Details

#bodyObject


11
12
13
# File 'lib/levelup/requests/create_card.rb', line 11

def body
  { credit_card: to_hash }
end

#response_from_hash(hash) ⇒ Object


15
16
17
# File 'lib/levelup/requests/create_card.rb', line 15

def response_from_hash(hash)
  Response::Success.new(hash['credit_card'])
end