Class: PaysonAPI::Response::IPN
- Inherits:
-
Object
- Object
- PaysonAPI::Response::IPN
- Defined in:
- lib/payson_api/response/ipn.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#custom ⇒ Object
Returns the value of attribute custom.
-
#fundings ⇒ Object
Returns the value of attribute fundings.
-
#guarantee_deadline_at ⇒ Object
Returns the value of attribute guarantee_deadline_at.
-
#guarantee_status ⇒ Object
Returns the value of attribute guarantee_status.
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#invoice_status ⇒ Object
Returns the value of attribute invoice_status.
-
#order_items ⇒ Object
Returns the value of attribute order_items.
-
#payment_type ⇒ Object
Returns the value of attribute payment_type.
-
#purchase_id ⇒ Object
Returns the value of attribute purchase_id.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#receivers ⇒ Object
Returns the value of attribute receivers.
-
#sender_email ⇒ Object
Returns the value of attribute sender_email.
-
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
-
#status ⇒ Object
Returns the value of attribute status.
-
#token ⇒ Object
Returns the value of attribute token.
-
#tracking_id ⇒ Object
Returns the value of attribute tracking_id.
Instance Method Summary collapse
-
#initialize(raw_data) ⇒ IPN
constructor
A new instance of IPN.
Constructor Details
#initialize(raw_data) ⇒ IPN
Returns a new instance of IPN.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/payson_api/response/ipn.rb', line 9 def initialize(raw_data) @raw = raw_data data_hash = PaysonAPI::Client.params_to_hash(raw_data) @purchase_id = data_hash['purchaseId'] @payment_type = data_hash['type'] @comment = data_hash['custom'] @tracking_id = data_hash['trackingId'] @currency = data_hash['currencyCode'] @sender_email = data_hash['senderEmail'] @status = data_hash['status'] @token = data_hash['token'] @fundings = Funding.parse(data_hash) @receivers = Receiver.parse(data_hash) @order_items = OrderItem.parse(data_hash) @hash = data_hash['HASH'] case @payment_type when 'GUARANTEE' @guarantee_status = data_hash['guaranteeStatus'] @guarantee_deadline_at = Time.parse(data_hash['guaranteeDeadlineTimestamp']) when 'INVOICE' @invoice_status = data_hash['invoiceStatus'] @shipping_address = ShippingAddress.parse(data_hash) end end |
Instance Attribute Details
#currency ⇒ Object
Returns the value of attribute currency.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def currency @currency end |
#custom ⇒ Object
Returns the value of attribute custom.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def custom @custom end |
#fundings ⇒ Object
Returns the value of attribute fundings.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def fundings @fundings end |
#guarantee_deadline_at ⇒ Object
Returns the value of attribute guarantee_deadline_at.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def guarantee_deadline_at @guarantee_deadline_at end |
#guarantee_status ⇒ Object
Returns the value of attribute guarantee_status.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def guarantee_status @guarantee_status end |
#hash ⇒ Object
Returns the value of attribute hash.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def hash @hash end |
#invoice_status ⇒ Object
Returns the value of attribute invoice_status.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def invoice_status @invoice_status end |
#order_items ⇒ Object
Returns the value of attribute order_items.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def order_items @order_items end |
#payment_type ⇒ Object
Returns the value of attribute payment_type.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def payment_type @payment_type end |
#purchase_id ⇒ Object
Returns the value of attribute purchase_id.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def purchase_id @purchase_id end |
#raw ⇒ Object
Returns the value of attribute raw.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def raw @raw end |
#receivers ⇒ Object
Returns the value of attribute receivers.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def receivers @receivers end |
#sender_email ⇒ Object
Returns the value of attribute sender_email.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def sender_email @sender_email end |
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def shipping_address @shipping_address end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def status @status end |
#token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def token @token end |
#tracking_id ⇒ Object
Returns the value of attribute tracking_id.
4 5 6 |
# File 'lib/payson_api/response/ipn.rb', line 4 def tracking_id @tracking_id end |