Class: Mondido::CreditCard::Transaction
- Includes:
- ActiveModel::Model, BaseBehaviour
- Defined in:
- lib/mondido/credit_card/transaction.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#card_cvv ⇒ Object
Returns the value of attribute card_cvv.
-
#card_expiry ⇒ Object
Returns the value of attribute card_expiry.
-
#card_holder ⇒ Object
Returns the value of attribute card_holder.
-
#card_number ⇒ Object
Returns the value of attribute card_number.
-
#card_type ⇒ Object
Returns the value of attribute card_type.
-
#cost ⇒ Object
Returns the value of attribute cost.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#customer_ref ⇒ Object
Returns the value of attribute customer_ref.
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#id ⇒ Object
Returns the value of attribute id.
-
#items ⇒ Object
Returns the value of attribute items.
-
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#payment_details ⇒ Object
Returns the value of attribute payment_details.
-
#payment_ref ⇒ Object
Returns the value of attribute payment_ref.
-
#status ⇒ Object
Returns the value of attribute status.
-
#stored_card ⇒ Object
Returns the value of attribute stored_card.
-
#subscription ⇒ Object
Returns the value of attribute subscription.
-
#test ⇒ Object
Returns the value of attribute test.
-
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
-
#vat_amount ⇒ Object
Returns the value of attribute vat_amount.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Transaction
constructor
A new instance of Transaction.
- #set_hash! ⇒ Object
Methods inherited from BaseModel
all, #api_params, get, #update_from_response
Constructor Details
#initialize(attributes = {}) ⇒ Transaction
Returns a new instance of Transaction.
72 73 74 |
# File 'lib/mondido/credit_card/transaction.rb', line 72 def initialize(attributes={}) super end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def amount @amount end |
#card_cvv ⇒ Object
Returns the value of attribute card_cvv.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def card_cvv @card_cvv end |
#card_expiry ⇒ Object
Returns the value of attribute card_expiry.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def card_expiry @card_expiry end |
#card_holder ⇒ Object
Returns the value of attribute card_holder.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def card_holder @card_holder end |
#card_number ⇒ Object
Returns the value of attribute card_number.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def card_number @card_number end |
#card_type ⇒ Object
Returns the value of attribute card_type.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def card_type @card_type end |
#cost ⇒ Object
Returns the value of attribute cost.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def cost @cost end |
#created_at ⇒ Object
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def created_at @created_at end |
#currency ⇒ Object
Returns the value of attribute currency.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def currency @currency end |
#customer ⇒ Object
Returns the value of attribute customer.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def customer @customer end |
#customer_ref ⇒ Object
Returns the value of attribute customer_ref.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def customer_ref @customer_ref end |
#hash ⇒ Object
Returns the value of attribute hash.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def hash @hash end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def id @id end |
#items ⇒ Object
Returns the value of attribute items.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def items @items end |
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def merchant_id @merchant_id end |
#metadata ⇒ Object
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def end |
#payment_details ⇒ Object
Returns the value of attribute payment_details.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def payment_details @payment_details end |
#payment_ref ⇒ Object
Returns the value of attribute payment_ref.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def payment_ref @payment_ref end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def status @status end |
#stored_card ⇒ Object
Returns the value of attribute stored_card.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def stored_card @stored_card end |
#subscription ⇒ Object
Returns the value of attribute subscription.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def subscription @subscription end |
#test ⇒ Object
Returns the value of attribute test.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def test @test end |
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def transaction_type @transaction_type end |
#vat_amount ⇒ Object
Returns the value of attribute vat_amount.
7 8 9 |
# File 'lib/mondido/credit_card/transaction.rb', line 7 def vat_amount @vat_amount end |
Class Method Details
.create(attributes = {}) ⇒ Object
65 66 67 68 69 70 |
# File 'lib/mondido/credit_card/transaction.rb', line 65 def self.create(attributes={}) = attributes[:metadata] = .to_json if && .respond_to?(:to_json) attributes[:metadata] = super(attributes) end |
.delete(id) ⇒ Object
61 62 63 |
# File 'lib/mondido/credit_card/transaction.rb', line 61 def self.delete(id) raise Mondido::Exceptions::NotApplicable.new 'Can not delete Transaction' end |
Instance Method Details
#set_hash! ⇒ Object
76 77 78 79 |
# File 'lib/mondido/credit_card/transaction.rb', line 76 def set_hash! unhashed = [Mondido::Credentials.merchant_id, payment_ref, customer_ref, amount, currency, Mondido::Credentials.secret].map(&:to_s) self.hash = Digest::MD5.hexdigest(unhashed.join) end |