Class: Mollie::Order
- Defined in:
- lib/mollie/order.rb,
lib/mollie/order/line.rb,
lib/mollie/order/refund.rb,
lib/mollie/order/shipment.rb
Defined Under Namespace
Classes: Line, Refund, Shipment
Constant Summary collapse
- STATUS_PENDING =
'pending'.freeze
- STATUS_AUTHORIZED =
'authorized'.freeze
- STATUS_PAID =
'paid'.freeze
- STATUS_SHIPPING =
'shipping'.freeze
- STATUS_EXPIRED =
'expired'.freeze
- STATUS_CANCELED =
'canceled'.freeze
- STATUS_COMPLETED =
'completed'.freeze
Instance Attribute Summary collapse
-
#_links ⇒ Object
(also: #links)
Returns the value of attribute _links.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#amount_captured ⇒ Object
Returns the value of attribute amount_captured.
-
#amount_refunded ⇒ Object
Returns the value of attribute amount_refunded.
-
#authorized_at ⇒ Object
Returns the value of attribute authorized_at.
-
#billing_address ⇒ Object
Returns the value of attribute billing_address.
-
#canceled_at ⇒ Object
Returns the value of attribute canceled_at.
-
#completed_at ⇒ Object
Returns the value of attribute completed_at.
-
#consumer_date_of_birth ⇒ Object
Returns the value of attribute consumer_date_of_birth.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#expired_at ⇒ Object
Returns the value of attribute expired_at.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_cancelable ⇒ Object
Returns the value of attribute is_cancelable.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#method ⇒ Object
Returns the value of attribute method.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#order_number ⇒ Object
Returns the value of attribute order_number.
-
#paid_at ⇒ Object
Returns the value of attribute paid_at.
-
#profile_id ⇒ Object
Returns the value of attribute profile_id.
-
#redirect_url ⇒ Object
Returns the value of attribute redirect_url.
-
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
-
#status ⇒ Object
Returns the value of attribute status.
-
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
Attributes inherited from Base
Instance Method Summary collapse
- #authorized? ⇒ Boolean
- #cancelable? ⇒ Boolean
- #canceled? ⇒ Boolean
- #checkout_url ⇒ Object
- #completed? ⇒ Boolean
- #expired? ⇒ Boolean
- #paid? ⇒ Boolean
- #pending? ⇒ Boolean
- #refund!(options = {}) ⇒ Object
- #refunds(options = {}) ⇒ Object
- #shipping? ⇒ Boolean
Methods inherited from Base
all, #assign_attributes, cancel, create, #delete, delete, get, id_param, #initialize, parent_id, request, resource_name, update, #update
Constructor Details
This class inherits a constructor from Mollie::Base
Instance Attribute Details
#_links ⇒ Object Also known as: links
Returns the value of attribute _links.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def _links @_links end |
#amount ⇒ Object
Returns the value of attribute amount.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def amount @amount end |
#amount_captured ⇒ Object
Returns the value of attribute amount_captured.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def amount_captured @amount_captured end |
#amount_refunded ⇒ Object
Returns the value of attribute amount_refunded.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def amount_refunded @amount_refunded end |
#authorized_at ⇒ Object
Returns the value of attribute authorized_at.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def end |
#billing_address ⇒ Object
Returns the value of attribute billing_address.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def billing_address @billing_address end |
#canceled_at ⇒ Object
Returns the value of attribute canceled_at.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def canceled_at @canceled_at end |
#completed_at ⇒ Object
Returns the value of attribute completed_at.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def completed_at @completed_at end |
#consumer_date_of_birth ⇒ Object
Returns the value of attribute consumer_date_of_birth.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def consumer_date_of_birth @consumer_date_of_birth end |
#created_at ⇒ Object
Returns the value of attribute created_at.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def created_at @created_at end |
#expired_at ⇒ Object
Returns the value of attribute expired_at.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def expired_at @expired_at end |
#expires_at ⇒ Object
Returns the value of attribute expires_at.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def expires_at @expires_at end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def id @id end |
#is_cancelable ⇒ Object
Returns the value of attribute is_cancelable.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def is_cancelable @is_cancelable end |
#lines ⇒ Object
Returns the value of attribute lines.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def lines @lines end |
#locale ⇒ Object
Returns the value of attribute locale.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def locale @locale end |
#metadata ⇒ Object
Returns the value of attribute metadata.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def end |
#method ⇒ Object
Returns the value of attribute method.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def method @method end |
#mode ⇒ Object
Returns the value of attribute mode.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def mode @mode end |
#order_number ⇒ Object
Returns the value of attribute order_number.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def order_number @order_number end |
#paid_at ⇒ Object
Returns the value of attribute paid_at.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def paid_at @paid_at end |
#profile_id ⇒ Object
Returns the value of attribute profile_id.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def profile_id @profile_id end |
#redirect_url ⇒ Object
Returns the value of attribute redirect_url.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def redirect_url @redirect_url end |
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def shipping_address @shipping_address end |
#status ⇒ Object
Returns the value of attribute status.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def status @status end |
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
11 12 13 |
# File 'lib/mollie/order.rb', line 11 def webhook_url @webhook_url end |
Instance Method Details
#authorized? ⇒ Boolean
44 45 46 |
# File 'lib/mollie/order.rb', line 44 def status == STATUS_AUTHORIZED end |
#cancelable? ⇒ Boolean
68 69 70 |
# File 'lib/mollie/order.rb', line 68 def cancelable? is_cancelable end |
#canceled? ⇒ Boolean
60 61 62 |
# File 'lib/mollie/order.rb', line 60 def canceled? status == STATUS_CANCELED end |
#checkout_url ⇒ Object
72 73 74 |
# File 'lib/mollie/order.rb', line 72 def checkout_url Util.extract_url(links, 'checkout') end |
#completed? ⇒ Boolean
64 65 66 |
# File 'lib/mollie/order.rb', line 64 def completed? status == STATUS_COMPLETED end |
#expired? ⇒ Boolean
56 57 58 |
# File 'lib/mollie/order.rb', line 56 def expired? status == STATUS_EXPIRED end |
#paid? ⇒ Boolean
48 49 50 |
# File 'lib/mollie/order.rb', line 48 def paid? status == STATUS_PAID end |
#pending? ⇒ Boolean
40 41 42 |
# File 'lib/mollie/order.rb', line 40 def pending? status == STATUS_PENDING end |
#refund!(options = {}) ⇒ Object
136 137 138 139 140 |
# File 'lib/mollie/order.rb', line 136 def refund!( = {}) [:order_id] = id [:lines] ||= [] Order::Refund.create() end |
#refunds(options = {}) ⇒ Object
132 133 134 |
# File 'lib/mollie/order.rb', line 132 def refunds( = {}) Order::Refund.all(.merge(order_id: id)) end |
#shipping? ⇒ Boolean
52 53 54 |
# File 'lib/mollie/order.rb', line 52 def shipping? status == STATUS_SHIPPING end |