Class: OffsitePayments::Integrations::WorldPay::Notification
- Inherits:
-
Notification
- Object
- Notification
- OffsitePayments::Integrations::WorldPay::Notification
show all
- Defined in:
- lib/offsite_payments/integrations/world_pay.rb
Instance Attribute Summary
Attributes inherited from Notification
#params, #raw
Instance Method Summary
collapse
#amount, #empty!, #gross_cents, #initialize, #iso_currency, #valid_sender?
Instance Method Details
#account ⇒ Object
125
126
127
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 125
def account
params['instId']
end
|
#acknowledge(authcode = nil) ⇒ Object
224
225
226
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 224
def acknowledge(authcode = nil)
return true
end
|
#address ⇒ Object
169
170
171
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 169
def address
params['address']
end
|
#address_status ⇒ Object
216
217
218
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 216
def address_status
return avs_value_to_symbol(params['AVS'][2].chr)
end
|
#card_type ⇒ Object
193
194
195
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 193
def card_type
params['cardType']
end
|
#complete? ⇒ Boolean
121
122
123
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 121
def complete?
status == 'Completed'
end
|
#country ⇒ Object
177
178
179
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 177
def country
params['country']
end
|
#country_status ⇒ Object
220
221
222
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 220
def country_status
return avs_value_to_symbol(params['AVS'][3].chr)
end
|
#currency ⇒ Object
152
153
154
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 152
def currency
params['authCurrency']
end
|
#custom_params ⇒ Object
WorldPay supports the passing of custom parameters through to the callback script
229
230
231
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 229
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
208
209
210
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 208
def cvv_status
return avs_value_to_symbol(params['AVS'][0].chr)
end
|
#email_address ⇒ Object
189
190
191
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 189
def email_address
params['email']
end
|
#fax_number ⇒ Object
185
186
187
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 185
def fax_number
params['fax']
end
|
#gross ⇒ Object
the money amount we received in X.2 decimal.
148
149
150
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 148
def gross
params['authAmount']
end
|
#item_id ⇒ Object
129
130
131
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 129
def item_id
params['cartId']
end
|
#name ⇒ Object
165
166
167
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 165
def name
params['name']
end
|
#phone_number ⇒ Object
181
182
183
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 181
def phone_number
params['tel']
end
|
#postcode ⇒ Object
173
174
175
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 173
def postcode
params['postcode']
end
|
#postcode_status ⇒ Object
212
213
214
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 212
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.
138
139
140
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 138
def received_at
Time.at(params['transTime'].to_i / 1000).utc
end
|
#security_key ⇒ Object
Callback password set in the WorldPay CMS
143
144
145
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 143
def security_key
params['callbackPW']
end
|
#status ⇒ Object
161
162
163
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 161
def status
params['transStatus'] == 'Y' ? 'Completed' : 'Cancelled'
end
|
#test? ⇒ Boolean
Was this a test transaction?
157
158
159
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 157
def test?
params.key?('testMode') && params['testMode'] != '0'
end
|
#transaction_id ⇒ Object
133
134
135
|
# File 'lib/offsite_payments/integrations/world_pay.rb', line 133
def transaction_id
params['transId']
end
|