Class: OffsitePayments::Integrations::PayflowLink::Notification

Inherits:
Notification
  • Object
show all
Defined in:
lib/offsite_payments/integrations/payflow_link.rb

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

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

#accountObject


184
185
186
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 184

def 
  params["ACCT"]
end

#acknowledge(authcode = nil) ⇒ Object


188
189
190
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 188

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

#currencyObject

What currency have we been dealing with


161
162
163
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 161

def currency
  nil
end

#grossObject

the money amount we received in X.2 decimal.


156
157
158
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 156

def gross
  params['AMT']
end

#invoiceObject

This is the invoice which you passed to paypal


175
176
177
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 175

def invoice
  params['INVNUM']
end

#item_idObject

This is the item number which we submitted to paypal


170
171
172
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 170

def item_id
  params['USER1']
end

#received_atObject

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

#statusObject


141
142
143
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 141

def status
  params['RESPMSG']
end

#test?Boolean

Was this a test transaction?


180
181
182
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 180

def test?
  params['USER2'] == 'true'
end

#transaction_idObject

Id of this transaction (paypal number)


146
147
148
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 146

def transaction_id
  params['PNREF']
end

#typeObject

What type of transaction are we dealing with?


151
152
153
# File 'lib/offsite_payments/integrations/payflow_link.rb', line 151

def type
  params['TYPE']
end