Class: ActiveMerchant::Billing::Integrations::PayflowLink::Notification

Inherits:
Notification
  • Object
show all
Defined in:
lib/active_merchant/billing/integrations/payflow_link/notification.rb

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

Methods inherited from Notification

#amount, #empty!, #gross_cents, #initialize, #valid_sender?

Constructor Details

This class inherits a constructor from ActiveMerchant::Billing::Integrations::Notification

Instance Method Details

#accountObject



67
68
69
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 67

def 
  params["ACCT"]
end

#acknowledgeObject



71
72
73
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 71

def acknowledge
  true
end

#complete?Boolean

Was the transaction complete?

Returns:

  • (Boolean)


10
11
12
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 10

def complete?
  status == "Completed"
end

#currencyObject

What currency have we been dealing with



44
45
46
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 44

def currency
  nil
end

#grossObject

the money amount we received in X.2 decimal.



39
40
41
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 39

def gross
  params['AMT']
end

#invoiceObject

This is the invoice which you passed to paypal



58
59
60
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 58

def invoice
  params['INVNUM']
end

#item_idObject

This is the item number which we submitted to paypal



53
54
55
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 53

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



18
19
20
21
22
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 18

def received_at
  DateTime.parse(params['TRANSTIME']) if params['TRANSTIME']
rescue ArgumentError
  nil
end

#statusObject



24
25
26
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 24

def status
  params['RESPMSG']
end

#test?Boolean

Was this a test transaction?

Returns:

  • (Boolean)


63
64
65
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 63

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

#transaction_idObject

Id of this transaction (paypal number)



29
30
31
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 29

def transaction_id
  params['PNREF']
end

#typeObject

What type of transaction are we dealing with?



34
35
36
# File 'lib/active_merchant/billing/integrations/payflow_link/notification.rb', line 34

def type
  params['TYPE']
end