Class: ActiveMerchant::Billing::Integrations::WorldPay::Notification

Inherits:
Notification
  • Object
show all
Defined in:
lib/active_merchant/billing/integrations/world_pay/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



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

def 
  params['instId']
end

#acknowledgeObject



109
110
111
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 109

def acknowledge
  return true
end

#addressObject



54
55
56
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 54

def address
  params['address']
end

#address_statusObject



101
102
103
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 101

def address_status
  return avs_value_to_symbol(params['AVS'][2].chr)
end

#card_typeObject



78
79
80
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 78

def card_type
  params['cardType']
end

#complete?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 6

def complete?
  status == 'Completed'
end

#countryObject



62
63
64
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 62

def country
  params['country']
end

#country_statusObject



105
106
107
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 105

def country_status
  return avs_value_to_symbol(params['AVS'][3].chr)
end

#currencyObject



37
38
39
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 37

def currency
  params['authCurrency']
end

#custom_paramsObject

WorldPay supports the passing of custom parameters through to the callback script



114
115
116
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 114

def custom_params
  return @custom_params ||= read_custom_params
end

#cvv_statusObject

WorldPay extended fraud checks returned as a 4 character string

1st char: Credit card CVV check
2nd char: Postcode AVS check
3rd char: Address AVS check
4th char: Country comparison check

Possible values are:

:not_supported   -  0
:not_checked     -  1
:matched         -  2
:not_matched     -  4
:partial_match   -  8


93
94
95
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 93

def cvv_status
  return avs_value_to_symbol(params['AVS'][0].chr)
end

#email_addressObject



74
75
76
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 74

def email_address
  params['email']
end

#fax_numberObject



70
71
72
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 70

def fax_number
  params['fax']
end

#grossObject

the money amount we received in X.2 decimal.



33
34
35
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 33

def gross
  params['authAmount']
end

#item_idObject



14
15
16
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 14

def item_id
  params['cartId']
end

#nameObject



50
51
52
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 50

def name
  params['name']
end

#phone_numberObject



66
67
68
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 66

def phone_number
  params['tel']
end

#postcodeObject



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

def postcode
  params['postcode']
end

#postcode_statusObject



97
98
99
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 97

def postcode_status
  return avs_value_to_symbol(params['AVS'][1].chr)
end

#received_atObject

Time this payment was received by the client in UTC time.



23
24
25
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 23

def received_at
  Time.at(params['transTime'].to_i / 1000).utc
end

#security_keyObject

Callback password set in the WorldPay CMS



28
29
30
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 28

def security_key
  params['callbackPW']
end

#statusObject



46
47
48
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 46

def status
  params['transStatus'] == 'Y' ? 'Completed' : 'Cancelled'
end

#test?Boolean

Was this a test transaction?

Returns:

  • (Boolean)


42
43
44
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 42

def test?
  params.key?('testMode') && params['testMode'] != '0'
end

#transaction_idObject



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

def transaction_id
  params['transId']
end