Class: MultiSafePay::Order
Constant Summary collapse
- STATUS_CANCELLED =
"cancelled".freeze
- STATUS_COMPLETED =
"completed".freeze
- STATUS_DECLINED =
"declined".freeze
- STATUS_EXPIRED =
"expired".freeze
- STATUS_INITIALIZED =
"initialized".freeze
- STATUS_REFUNDED =
"refunded".freeze
- STATUS_RESERVED =
"reserved".freeze
- STATUS_SHIPPED =
"shipped".freeze
- STATUS_UNCLEARED =
"uncleared".freeze
- STATUS_VOID =
"void".freeze
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#amount_refunded ⇒ Object
Returns the value of attribute amount_refunded.
-
#auth_order_id ⇒ Object
Returns the value of attribute auth_order_id.
-
#costs ⇒ Object
Returns the value of attribute costs.
-
#created ⇒ Object
Returns the value of attribute created.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#delivery ⇒ Object
Returns the value of attribute delivery.
-
#description ⇒ Object
Returns the value of attribute description.
-
#fastcheckout ⇒ Object
Returns the value of attribute fastcheckout.
-
#financial_status ⇒ Object
Returns the value of attribute financial_status.
-
#gateway ⇒ Object
Returns the value of attribute gateway.
-
#items ⇒ Object
Returns the value of attribute items.
-
#modified ⇒ Object
Returns the value of attribute modified.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#payment_details ⇒ Object
Returns the value of attribute payment_details.
-
#payment_methods ⇒ Object
Returns the value of attribute payment_methods.
-
#payment_options ⇒ Object
Returns the value of attribute payment_options.
-
#payment_url ⇒ Object
Returns the value of attribute payment_url.
-
#reason ⇒ Object
Returns the value of attribute reason.
-
#reason_code ⇒ Object
Returns the value of attribute reason_code.
-
#related_transactions ⇒ Object
Returns the value of attribute related_transactions.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#shopping_cart ⇒ Object
Returns the value of attribute shopping_cart.
-
#status ⇒ Object
Returns the value of attribute status.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
-
#type ⇒ Object
Returns the value of attribute type.
-
#var1 ⇒ Object
Returns the value of attribute var1.
-
#var2 ⇒ Object
Returns the value of attribute var2.
-
#var3 ⇒ Object
Returns the value of attribute var3.
Attributes inherited from Base
Class Method Summary collapse
- .cancel_payment(order_id, data = {}) ⇒ Object
- .capture(order_id, data = {}) ⇒ Object
- .refund(order_id, data = {}) ⇒ Object
Instance Method Summary collapse
- #cancelled? ⇒ Boolean
- #completed? ⇒ Boolean
- #declined? ⇒ Boolean
- #expired? ⇒ Boolean
- #initialized? ⇒ Boolean
- #refunded? ⇒ Boolean
- #reserved? ⇒ Boolean
- #shipped? ⇒ Boolean
- #uncleared? ⇒ Boolean
- #void? ⇒ 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 MultiSafePay::Base
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def amount @amount end |
#amount_refunded ⇒ Object
Returns the value of attribute amount_refunded.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def amount_refunded @amount_refunded end |
#auth_order_id ⇒ Object
Returns the value of attribute auth_order_id.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def auth_order_id @auth_order_id end |
#costs ⇒ Object
Returns the value of attribute costs.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def costs @costs end |
#created ⇒ Object
Returns the value of attribute created.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def created @created end |
#currency ⇒ Object
Returns the value of attribute currency.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def currency @currency end |
#customer ⇒ Object
Returns the value of attribute customer.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def customer @customer end |
#delivery ⇒ Object
Returns the value of attribute delivery.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def delivery @delivery end |
#description ⇒ Object
Returns the value of attribute description.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def description @description end |
#fastcheckout ⇒ Object
Returns the value of attribute fastcheckout.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def fastcheckout @fastcheckout end |
#financial_status ⇒ Object
Returns the value of attribute financial_status.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def financial_status @financial_status end |
#gateway ⇒ Object
Returns the value of attribute gateway.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def gateway @gateway end |
#items ⇒ Object
Returns the value of attribute items.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def items @items end |
#modified ⇒ Object
Returns the value of attribute modified.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def modified @modified end |
#order_id ⇒ Object
Returns the value of attribute order_id.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def order_id @order_id end |
#payment_details ⇒ Object
Returns the value of attribute payment_details.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def payment_details @payment_details end |
#payment_methods ⇒ Object
Returns the value of attribute payment_methods.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def payment_methods @payment_methods end |
#payment_options ⇒ Object
Returns the value of attribute payment_options.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def @payment_options end |
#payment_url ⇒ Object
Returns the value of attribute payment_url.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def payment_url @payment_url end |
#reason ⇒ Object
Returns the value of attribute reason.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def reason @reason end |
#reason_code ⇒ Object
Returns the value of attribute reason_code.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def reason_code @reason_code end |
#related_transactions ⇒ Object
Returns the value of attribute related_transactions.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def @related_transactions end |
#session_id ⇒ Object
Returns the value of attribute session_id.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def session_id @session_id end |
#shopping_cart ⇒ Object
Returns the value of attribute shopping_cart.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def shopping_cart @shopping_cart end |
#status ⇒ Object
Returns the value of attribute status.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def status @status end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def transaction_id @transaction_id end |
#type ⇒ Object
Returns the value of attribute type.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def type @type end |
#var1 ⇒ Object
Returns the value of attribute var1.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def var1 @var1 end |
#var2 ⇒ Object
Returns the value of attribute var2.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def var2 @var2 end |
#var3 ⇒ Object
Returns the value of attribute var3.
14 15 16 |
# File 'lib/multisafepay/order.rb', line 14 def var3 @var3 end |
Class Method Details
.cancel_payment(order_id, data = {}) ⇒ Object
118 119 120 121 122 123 124 125 |
# File 'lib/multisafepay/order.rb', line 118 def self.cancel_payment(order_id, data = {}) raise ArgumentError, "reason is required" unless data["reason"] Client.instance.delete("capture/#{order_id}", nil, data.merge({ status: STATUS_CANCELLED, reason: data["reason"] })) end |
Instance Method Details
#cancelled? ⇒ Boolean
45 46 47 |
# File 'lib/multisafepay/order.rb', line 45 def cancelled? status == STATUS_CANCELLED end |
#completed? ⇒ Boolean
49 50 51 |
# File 'lib/multisafepay/order.rb', line 49 def completed? status == STATUS_COMPLETED end |
#declined? ⇒ Boolean
53 54 55 |
# File 'lib/multisafepay/order.rb', line 53 def declined? status == STATUS_DECLINED end |
#expired? ⇒ Boolean
57 58 59 |
# File 'lib/multisafepay/order.rb', line 57 def expired? status == STATUS_EXPIRED end |
#initialized? ⇒ Boolean
61 62 63 |
# File 'lib/multisafepay/order.rb', line 61 def initialized? status == STATUS_INITIALIZED end |
#refunded? ⇒ Boolean
65 66 67 |
# File 'lib/multisafepay/order.rb', line 65 def refunded? status == STATUS_REFUNDED end |
#reserved? ⇒ Boolean
69 70 71 |
# File 'lib/multisafepay/order.rb', line 69 def reserved? status == STATUS_RESERVED end |
#shipped? ⇒ Boolean
73 74 75 |
# File 'lib/multisafepay/order.rb', line 73 def shipped? status == STATUS_SHIPPED end |
#uncleared? ⇒ Boolean
77 78 79 |
# File 'lib/multisafepay/order.rb', line 77 def uncleared? status == STATUS_UNCLEARED end |
#void? ⇒ Boolean
81 82 83 |
# File 'lib/multisafepay/order.rb', line 81 def void? status == STATUS_VOID end |