Class: PaysonAPI::V1::Responses::IPN
- Inherits:
-
Object
- Object
- PaysonAPI::V1::Responses::IPN
- Defined in:
- lib/payson_api/v1/responses/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
- #append_payment_type_conditionals ⇒ Object
-
#initialize(raw_data) ⇒ IPN
constructor
A new instance of IPN.
Constructor Details
#initialize(raw_data) ⇒ IPN
Returns a new instance of IPN.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 12 def initialize(raw_data) @raw = raw_data data_hash = PaysonAPI::V1::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 = PaysonAPI::V1::Funding.parse(data_hash) @receivers = PaysonAPI::V1::Receiver.parse(data_hash) @order_items = PaysonAPI::V1::OrderItem.parse(data_hash) @hash = data_hash['HASH'] append_payment_type_conditionals end |
Instance Attribute Details
#currency ⇒ Object
Returns the value of attribute currency.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def currency @currency end |
#custom ⇒ Object
Returns the value of attribute custom.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def custom @custom end |
#fundings ⇒ Object
Returns the value of attribute fundings.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def fundings @fundings end |
#guarantee_deadline_at ⇒ Object
Returns the value of attribute guarantee_deadline_at.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def guarantee_deadline_at @guarantee_deadline_at end |
#guarantee_status ⇒ Object
Returns the value of attribute guarantee_status.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def guarantee_status @guarantee_status end |
#hash ⇒ Object
Returns the value of attribute hash.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def hash @hash end |
#invoice_status ⇒ Object
Returns the value of attribute invoice_status.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def invoice_status @invoice_status end |
#order_items ⇒ Object
Returns the value of attribute order_items.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def order_items @order_items end |
#payment_type ⇒ Object
Returns the value of attribute payment_type.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def payment_type @payment_type end |
#purchase_id ⇒ Object
Returns the value of attribute purchase_id.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def purchase_id @purchase_id end |
#raw ⇒ Object
Returns the value of attribute raw.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def raw @raw end |
#receivers ⇒ Object
Returns the value of attribute receivers.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def receivers @receivers end |
#sender_email ⇒ Object
Returns the value of attribute sender_email.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def sender_email @sender_email end |
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def shipping_address @shipping_address end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def status @status end |
#token ⇒ Object
Returns the value of attribute token.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def token @token end |
#tracking_id ⇒ Object
Returns the value of attribute tracking_id.
7 8 9 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 7 def tracking_id @tracking_id end |
Instance Method Details
#append_payment_type_conditionals ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/payson_api/v1/responses/ipn.rb', line 30 def append_payment_type_conditionals 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 = PaysonAPI::V1::ShippingAddress.parse(data_hash) end end |