Class: Jirafe::Callback::Events::Refund
- Inherits:
-
Jirafe::Callback::Event
- Object
- JirafeCallback
- Jirafe::Callback::Event
- Jirafe::Callback::Events::Refund
- Includes:
- DataHelper, Model
- Defined in:
- lib/jirafe/callback/events/refund.rb
Constant Summary
Constants inherited from Jirafe::Callback::Event
Jirafe::Callback::Event::GLOBAL_ACTION
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#discount_amount ⇒ Object
Returns the value of attribute discount_amount.
-
#grand_total ⇒ Object
Returns the value of attribute grand_total.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#items ⇒ Object
Returns the value of attribute items.
-
#order_identifier ⇒ Object
Returns the value of attribute order_identifier.
-
#shipping_amount ⇒ Object
Returns the value of attribute shipping_amount.
-
#sub_total ⇒ Object
Returns the value of attribute sub_total.
-
#tax_amount ⇒ Object
Returns the value of attribute tax_amount.
Attributes inherited from Jirafe::Callback::Event
Instance Method Summary collapse
Methods included from DataHelper
#format_amount, #format_discount_amount
Methods included from Model
#attributes, #attributes_for_change, #create, included, #initialize, #reinitialize, #update
Methods inherited from Jirafe::Callback::Event
events_url, send, #to_json, trust_callback?
Methods inherited from JirafeCallback
Methods included from ResponseParser
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/jirafe/callback/events/refund.rb', line 7 def created_at @created_at end |
#discount_amount ⇒ Object
Returns the value of attribute discount_amount.
7 8 9 |
# File 'lib/jirafe/callback/events/refund.rb', line 7 def discount_amount @discount_amount end |
#grand_total ⇒ Object
Returns the value of attribute grand_total.
7 8 9 |
# File 'lib/jirafe/callback/events/refund.rb', line 7 def grand_total @grand_total end |
#identifier ⇒ Object
Returns the value of attribute identifier.
7 8 9 |
# File 'lib/jirafe/callback/events/refund.rb', line 7 def identifier @identifier end |
#items ⇒ Object
Returns the value of attribute items.
7 8 9 |
# File 'lib/jirafe/callback/events/refund.rb', line 7 def items @items end |
#order_identifier ⇒ Object
Returns the value of attribute order_identifier.
7 8 9 |
# File 'lib/jirafe/callback/events/refund.rb', line 7 def order_identifier @order_identifier end |
#shipping_amount ⇒ Object
Returns the value of attribute shipping_amount.
7 8 9 |
# File 'lib/jirafe/callback/events/refund.rb', line 7 def shipping_amount @shipping_amount end |
#sub_total ⇒ Object
Returns the value of attribute sub_total.
7 8 9 |
# File 'lib/jirafe/callback/events/refund.rb', line 7 def sub_total @sub_total end |
#tax_amount ⇒ Object
Returns the value of attribute tax_amount.
7 8 9 |
# File 'lib/jirafe/callback/events/refund.rb', line 7 def tax_amount @tax_amount end |
Instance Method Details
#action_map ⇒ Object
11 12 13 14 15 16 |
# File 'lib/jirafe/callback/events/refund.rb', line 11 def action_map { :create => "refundCreate", :import => "refundImport", } end |
#data ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/jirafe/callback/events/refund.rb', line 18 def data { "refundId" => identifier, "orderId" => order_identifier, "time" => created_at || Time.now.to_i, "grandTotal" => format_amount(grand_total), "subTotal" => format_amount(sub_total), "taxAmount" => format_amount(tax_amount), "shippingAmount" => format_amount(shipping_amount), "discountAmount" => format_discount_amount(discount_amount), "items" => items.map { |item| item.data } } end |