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

- (Object) account



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

def 
  params["ACCT"]
end

- (Object) acknowledge(authcode = nil)



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

def acknowledge(authcode = nil)
  true
end

- (Boolean) complete?

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

- (Object) currency

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

- (Object) gross

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

- (Object) invoice

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

- (Object) item_id

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

- (Object) received_at

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

- (Object) status



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

def status
  params['RESPMSG']
end

- (Boolean) test?

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

- (Object) transaction_id

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

- (Object) type

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