Class: OffsitePayments::Integrations::PayflowLink::Notification
- Inherits:
-
Notification
- Object
- Notification
- OffsitePayments::Integrations::PayflowLink::Notification
- Defined in:
- lib/offsite_payments/integrations/payflow_link.rb
Instance Attribute Summary
Attributes inherited from Notification
Instance Method Summary collapse
- #account ⇒ Object
- #acknowledge(authcode = nil) ⇒ Object
-
#complete? ⇒ Boolean
Was the transaction complete?.
-
#currency ⇒ Object
What currency have we been dealing with.
-
#gross ⇒ Object
the money amount we received in X.2 decimal.
-
#invoice ⇒ Object
This is the invoice which you passed to paypal.
-
#item_id ⇒ Object
This is the item number which we submitted to paypal.
-
#received_at ⇒ Object
When was this payment received by the client.
- #status ⇒ Object
-
#test? ⇒ Boolean
Was this a test transaction?.
-
#transaction_id ⇒ Object
Id of this transaction (paypal number).
-
#type ⇒ Object
What type of transaction are we dealing with?.
Methods inherited from Notification
#amount, #empty!, #gross_cents, #initialize, #iso_currency, #valid_sender?
Constructor Details
This class inherits a constructor from OffsitePayments::Notification
Instance Method Details
#account ⇒ Object
180 181 182 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 180 def account params["ACCT"] end |
#acknowledge(authcode = nil) ⇒ Object
184 185 186 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 184 def acknowledge(authcode = nil) true end |
#complete? ⇒ Boolean
Was the transaction complete?
127 128 129 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 127 def complete? status == "Completed" end |
#currency ⇒ Object
What currency have we been dealing with
157 158 159 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 157 def currency nil end |
#gross ⇒ Object
the money amount we received in X.2 decimal.
152 153 154 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 152 def gross params['AMT'] end |
#invoice ⇒ Object
This is the invoice which you passed to paypal
171 172 173 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 171 def invoice params['INVNUM'] end |
#item_id ⇒ Object
This is the item number which we submitted to paypal
166 167 168 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 166 def item_id params['USER1'] end |
#received_at ⇒ Object
When was this payment received by the client. sometimes it can happen that we get the notification much later. One possible scenario is that our web application was down. In this case paypal tries several times an hour to inform us about the notification
135 136 137 138 139 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 135 def received_at DateTime.parse(params['TRANSTIME']) if params['TRANSTIME'] rescue ArgumentError nil end |
#status ⇒ Object
161 162 163 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 161 def status params['RESULT'] == '0' ? 'Completed' : 'Failed' end |
#test? ⇒ Boolean
Was this a test transaction?
176 177 178 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 176 def test? params['USER2'] == 'true' end |
#transaction_id ⇒ Object
Id of this transaction (paypal number)
142 143 144 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 142 def transaction_id params['PNREF'] end |
#type ⇒ Object
What type of transaction are we dealing with?
147 148 149 |
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 147 def type params['TYPE'] end |