Class: MusicTodayApiWrapper::Resources::Checkout::Billing::Payment
- Inherits:
-
Object
- Object
- MusicTodayApiWrapper::Resources::Checkout::Billing::Payment
- Defined in:
- lib/resources/checkout/billing/payment.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#card_number ⇒ Object
Returns the value of attribute card_number.
-
#card_type ⇒ Object
Returns the value of attribute card_type.
-
#expiration_month ⇒ Object
Returns the value of attribute expiration_month.
-
#expiration_year ⇒ Object
Returns the value of attribute expiration_year.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #as_hash ⇒ Object
-
#initialize(card_number, name, amount, expiration_year, expiration_month) ⇒ Payment
constructor
A new instance of Payment.
Constructor Details
#initialize(card_number, name, amount, expiration_year, expiration_month) ⇒ Payment
Returns a new instance of Payment.
16 17 18 19 20 21 22 23 24 |
# File 'lib/resources/checkout/billing/payment.rb', line 16 def initialize(card_number, name, amount, expiration_year, expiration_month) @card_number = card_number @expiration_year = expiration_year.to_i @expiration_month = expiration_month.to_i @name = name @amount = amount.to_f credit_card_type end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
9 10 11 |
# File 'lib/resources/checkout/billing/payment.rb', line 9 def amount @amount end |
#card_number ⇒ Object
Returns the value of attribute card_number.
9 10 11 |
# File 'lib/resources/checkout/billing/payment.rb', line 9 def card_number @card_number end |
#card_type ⇒ Object
Returns the value of attribute card_type.
9 10 11 |
# File 'lib/resources/checkout/billing/payment.rb', line 9 def card_type @card_type end |
#expiration_month ⇒ Object
Returns the value of attribute expiration_month.
9 10 11 |
# File 'lib/resources/checkout/billing/payment.rb', line 9 def expiration_month @expiration_month end |
#expiration_year ⇒ Object
Returns the value of attribute expiration_year.
9 10 11 |
# File 'lib/resources/checkout/billing/payment.rb', line 9 def expiration_year @expiration_year end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/resources/checkout/billing/payment.rb', line 9 def name @name end |
Instance Method Details
#as_hash ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/resources/checkout/billing/payment.rb', line 26 def as_hash { type: @card_type, accountNumber: @card_number, expYear: @expiration_year, expMonth: @expiration_month, nameOnCard: @name, amount: @amount }.compact end |