Class: ActiveMerchant::Billing::Integrations::WorldPay::Notification
- Inherits:
-
Notification
- Object
- Notification
- ActiveMerchant::Billing::Integrations::WorldPay::Notification
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
#amount, #empty!, #gross_cents, #initialize, #valid_sender?
Instance Method Details
#account ⇒ Object
10
11
12
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 10
def account
params['instId']
end
|
#acknowledge ⇒ Object
109
110
111
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 109
def acknowledge
return true
end
|
#address ⇒ Object
54
55
56
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 54
def address
params['address']
end
|
#address_status ⇒ Object
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_type ⇒ Object
78
79
80
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 78
def card_type
params['cardType']
end
|
#complete? ⇒ Boolean
6
7
8
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 6
def complete?
status == 'Completed'
end
|
#country ⇒ Object
62
63
64
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 62
def country
params['country']
end
|
#country_status ⇒ Object
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
|
#currency ⇒ Object
37
38
39
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 37
def currency
params['authCurrency']
end
|
#custom_params ⇒ Object
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_status ⇒ Object
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_address ⇒ Object
74
75
76
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 74
def email_address
params['email']
end
|
#fax_number ⇒ Object
70
71
72
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 70
def fax_number
params['fax']
end
|
#gross ⇒ Object
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_id ⇒ Object
14
15
16
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 14
def item_id
params['cartId']
end
|
#name ⇒ Object
50
51
52
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 50
def name
params['name']
end
|
#phone_number ⇒ Object
66
67
68
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 66
def phone_number
params['tel']
end
|
#postcode ⇒ Object
58
59
60
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 58
def postcode
params['postcode']
end
|
#postcode_status ⇒ Object
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_at ⇒ Object
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_key ⇒ Object
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
|
#status ⇒ Object
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?
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_id ⇒ Object
18
19
20
|
# File 'lib/active_merchant/billing/integrations/world_pay/notification.rb', line 18
def transaction_id
params['transId']
end
|