Class: Moyasar::Payment
- Includes:
- Actions::Capture, Actions::Refund, Actions::Void
- Defined in:
- lib/moyasar/payment.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#amount_format ⇒ Object
readonly
Returns the value of attribute amount_format.
-
#callback_url ⇒ Object
readonly
Returns the value of attribute callback_url.
-
#captured ⇒ Object
readonly
Returns the value of attribute captured.
-
#captured_at ⇒ Object
readonly
Returns the value of attribute captured_at.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#description ⇒ Object
Returns the value of attribute description.
-
#fee ⇒ Object
readonly
Returns the value of attribute fee.
-
#fee_format ⇒ Object
readonly
Returns the value of attribute fee_format.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#invoice_id ⇒ Object
readonly
Returns the value of attribute invoice_id.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#refunded ⇒ Object
readonly
Returns the value of attribute refunded.
-
#refunded_at ⇒ Object
readonly
Returns the value of attribute refunded_at.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#voided_at ⇒ Object
readonly
Returns the value of attribute voided_at.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(attrs = {}) ⇒ Payment
constructor
A new instance of Payment.
Methods included from Actions::Void
Methods included from Actions::Capture
Methods included from Actions::Refund
Methods inherited from Resource
class_name, resource_name, resource_url
Methods included from Actions::Cancel
Methods included from Actions::Update
Methods included from Actions::Fetch
Methods included from Actions::List
Methods included from Actions::Construct
Methods included from Actions::Request
Constructor Details
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def amount @amount end |
#amount_format ⇒ Object (readonly)
Returns the value of attribute amount_format.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def amount_format @amount_format end |
#callback_url ⇒ Object (readonly)
Returns the value of attribute callback_url.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def callback_url @callback_url end |
#captured ⇒ Object (readonly)
Returns the value of attribute captured.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def captured @captured end |
#captured_at ⇒ Object (readonly)
Returns the value of attribute captured_at.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def captured_at @captured_at end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def currency @currency end |
#description ⇒ Object
Returns the value of attribute description.
10 11 12 |
# File 'lib/moyasar/payment.rb', line 10 def description @description end |
#fee ⇒ Object (readonly)
Returns the value of attribute fee.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def fee @fee end |
#fee_format ⇒ Object (readonly)
Returns the value of attribute fee_format.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def fee_format @fee_format end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def id @id end |
#invoice_id ⇒ Object (readonly)
Returns the value of attribute invoice_id.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def invoice_id @invoice_id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def ip @ip end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def @metadata end |
#refunded ⇒ Object (readonly)
Returns the value of attribute refunded.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def refunded @refunded end |
#refunded_at ⇒ Object (readonly)
Returns the value of attribute refunded_at.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def refunded_at @refunded_at end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def source @source end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def status @status end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def updated_at @updated_at end |
#voided_at ⇒ Object (readonly)
Returns the value of attribute voided_at.
7 8 9 |
# File 'lib/moyasar/payment.rb', line 7 def voided_at @voided_at end |
Class Method Details
.create(source:, amount:, currency: 'SAR', description: nil, invoice_id: nil, callback_url: nil) ⇒ Object
32 33 34 35 |
# File 'lib/moyasar/payment.rb', line 32 def create(source:, amount:, currency: 'SAR', description: nil, invoice_id: nil, callback_url: nil) params = {amount: amount, currency: currency, description: description, source: source, invoice_id: invoice_id, callback_url: callback_url} super(params) end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/moyasar/payment.rb', line 20 def ==(other) return false unless other.is_a? Payment [:id, :status, :amount, :fee, :currency, :invoice_id, :source, :refunded, :refunded_at, :captured, :captured_at, :voided_at, :ip, :created_at, :updated_at].all? do |attr| self.send(attr) == other.send(attr) end end |