Class: Ethikdo::Transaction
- Defined in:
- lib/ethikdo/transaction.rb
Instance Attribute Summary collapse
-
#amount_debited ⇒ Object
Returns the value of attribute amount_debited.
-
#amount_purchased ⇒ Object
Returns the value of attribute amount_purchased.
-
#cancelled ⇒ Object
Returns the value of attribute cancelled.
-
#card_number ⇒ Object
Returns the value of attribute card_number.
-
#count ⇒ Object
Returns the value of attribute count.
-
#customer_email ⇒ Object
Returns the value of attribute customer_email.
-
#date ⇒ Object
Returns the value of attribute date.
-
#message ⇒ Object
Returns the value of attribute message.
-
#next ⇒ Object
Returns the value of attribute next.
-
#previous ⇒ Object
Returns the value of attribute previous.
-
#refund_amount ⇒ Object
Returns the value of attribute refund_amount.
-
#results ⇒ Object
Returns the value of attribute results.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
- .all ⇒ Object
- .cancel(transaction_id:) ⇒ Object
- .create(capture_token:, amount_requested:, amount_purchased: 0, transaction_id:, customer_email: nil) ⇒ Object
Methods inherited from BaseModel
Constructor Details
This class inherits a constructor from Ethikdo::BaseModel
Instance Attribute Details
#amount_debited ⇒ Object
Returns the value of attribute amount_debited.
9 10 11 |
# File 'lib/ethikdo/transaction.rb', line 9 def amount_debited @amount_debited end |
#amount_purchased ⇒ Object
Returns the value of attribute amount_purchased.
8 9 10 |
# File 'lib/ethikdo/transaction.rb', line 8 def amount_purchased @amount_purchased end |
#cancelled ⇒ Object
Returns the value of attribute cancelled.
10 11 12 |
# File 'lib/ethikdo/transaction.rb', line 10 def cancelled @cancelled end |
#card_number ⇒ Object
Returns the value of attribute card_number.
7 8 9 |
# File 'lib/ethikdo/transaction.rb', line 7 def card_number @card_number end |
#count ⇒ Object
Returns the value of attribute count.
14 15 16 |
# File 'lib/ethikdo/transaction.rb', line 14 def count @count end |
#customer_email ⇒ Object
Returns the value of attribute customer_email.
18 19 20 |
# File 'lib/ethikdo/transaction.rb', line 18 def customer_email @customer_email end |
#date ⇒ Object
Returns the value of attribute date.
11 12 13 |
# File 'lib/ethikdo/transaction.rb', line 11 def date @date end |
#message ⇒ Object
Returns the value of attribute message.
13 14 15 |
# File 'lib/ethikdo/transaction.rb', line 13 def @message end |
#next ⇒ Object
Returns the value of attribute next.
15 16 17 |
# File 'lib/ethikdo/transaction.rb', line 15 def next @next end |
#previous ⇒ Object
Returns the value of attribute previous.
16 17 18 |
# File 'lib/ethikdo/transaction.rb', line 16 def previous @previous end |
#refund_amount ⇒ Object
Returns the value of attribute refund_amount.
12 13 14 |
# File 'lib/ethikdo/transaction.rb', line 12 def refund_amount @refund_amount end |
#results ⇒ Object
Returns the value of attribute results.
17 18 19 |
# File 'lib/ethikdo/transaction.rb', line 17 def results @results end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
6 7 8 |
# File 'lib/ethikdo/transaction.rb', line 6 def transaction_id @transaction_id end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'lib/ethikdo/transaction.rb', line 5 def url @url end |
Class Method Details
.all ⇒ Object
36 37 38 39 |
# File 'lib/ethikdo/transaction.rb', line 36 def self.all response = execute('get', '/sales/') self.new(response.parsed_response) end |
.cancel(transaction_id:) ⇒ Object
31 32 33 34 |
# File 'lib/ethikdo/transaction.rb', line 31 def self.cancel(transaction_id:) response = execute('get', "/sales/#{transaction_id}/cancel") self.new(response.parsed_response) end |
.create(capture_token:, amount_requested:, amount_purchased: 0, transaction_id:, customer_email: nil) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ethikdo/transaction.rb', line 20 def self.create(capture_token:, amount_requested:, amount_purchased: 0, transaction_id:, customer_email: nil) response = execute('post', '/sales/', body: { capture_token: capture_token, amount_requested: amount_requested, amount_purchased: amount_purchased, transaction_id: transaction_id, customer_email: customer_email }) self.new(response.parsed_response) end |