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



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

def 
  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?

Returns:

  • (Boolean)


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



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

def currency
  nil
end

#grossObject

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

#invoiceObject

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_idObject

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_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



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?

Returns:

  • (Boolean)


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

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

#transaction_idObject

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

#typeObject

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