Class: BreadMachine::Card
- Inherits:
-
Object
- Object
- BreadMachine::Card
- Defined in:
- lib/breadmachine/dto/card.rb
Overview
A data transfer object that represents the user’s credit card.
Instance Attribute Summary collapse
-
#expiry_date ⇒ Object
Returns the value of attribute expiry_date.
-
#issue ⇒ Object
Returns the value of attribute issue.
-
#issuer ⇒ Object
Returns the value of attribute issuer.
-
#number ⇒ Object
Returns the value of attribute number.
-
#security_code ⇒ Object
Returns the value of attribute security_code.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#transaction_reference ⇒ Object
Returns the value of attribute transaction_reference.
-
#transaction_verifier ⇒ Object
Returns the value of attribute transaction_verifier.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Card
constructor
Required properties include :issuer, :number, and :expiry_date.
Constructor Details
#initialize(attributes = {}) ⇒ Card
Required properties include :issuer, :number, and :expiry_date.
:issuer should be a downcased string (“amex”, “visa”, “mastercard”) :number should be an integer :expiry_date should be a string in the format “mm/yy”
:issue is required for Solo cards. :start_date is required for “some” cards. The XPay spec says “for a full
list of cards requiring start_date, please contact your acquiring bank".
TODO: make expiry_date and start_date into Date objects to save crappy string munging.
29 30 31 |
# File 'lib/breadmachine/dto/card.rb', line 29 def initialize(attributes = {}) attributes.each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#expiry_date ⇒ Object
Returns the value of attribute expiry_date.
9 10 11 |
# File 'lib/breadmachine/dto/card.rb', line 9 def expiry_date @expiry_date end |
#issue ⇒ Object
Returns the value of attribute issue.
11 12 13 |
# File 'lib/breadmachine/dto/card.rb', line 11 def issue @issue end |
#issuer ⇒ Object
Returns the value of attribute issuer.
7 8 9 |
# File 'lib/breadmachine/dto/card.rb', line 7 def issuer @issuer end |
#number ⇒ Object
Returns the value of attribute number.
8 9 10 |
# File 'lib/breadmachine/dto/card.rb', line 8 def number @number end |
#security_code ⇒ Object
Returns the value of attribute security_code.
12 13 14 |
# File 'lib/breadmachine/dto/card.rb', line 12 def security_code @security_code end |
#start_date ⇒ Object
Returns the value of attribute start_date.
10 11 12 |
# File 'lib/breadmachine/dto/card.rb', line 10 def start_date @start_date end |
#transaction_reference ⇒ Object
Returns the value of attribute transaction_reference.
14 15 16 |
# File 'lib/breadmachine/dto/card.rb', line 14 def transaction_reference @transaction_reference end |
#transaction_verifier ⇒ Object
Returns the value of attribute transaction_verifier.
13 14 15 |
# File 'lib/breadmachine/dto/card.rb', line 13 def transaction_verifier @transaction_verifier end |