# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 10 10: def account 11: params['instId'] 12: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 109 109: def acknowledge 110: return true 111: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 54 54: def address 55: params['address'] 56: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 101 101: def address_status 102: return avs_value_to_symbol(params['AVS'][2].chr) 103: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 78 78: def card_type 79: params['cardType'] 80: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 6 6: def complete? 7: status == 'Completed' 8: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 62 62: def country 63: params['country'] 64: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 105 105: def country_status 106: return avs_value_to_symbol(params['AVS'][3].chr) 107: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 37 37: def currency 38: params['authCurrency'] 39: end
WorldPay supports the passing of custom parameters through to the callback script
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 114 114: def custom_params 115: return @custom_params ||= read_custom_params 116: end
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
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 93 93: def cvv_status 94: return avs_value_to_symbol(params['AVS'][0].chr) 95: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 74 74: def email_address 75: params['email'] 76: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 70 70: def fax_number 71: params['fax'] 72: end
the money amount we received in X.2 decimal.
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 33 33: def gross 34: params['authAmount'] 35: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 14 14: def item_id 15: params['cartId'] 16: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 50 50: def name 51: params['name'] 52: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 66 66: def phone_number 67: params['tel'] 68: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 58 58: def postcode 59: params['postcode'] 60: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 97 97: def postcode_status 98: return avs_value_to_symbol(params['AVS'][1].chr) 99: end
Time this payment was received by the client in UTC time.
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 23 23: def received_at 24: Time.at(params['transTime'].to_i / 1000).utc 25: end
Callback password set in the WorldPay CMS
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 28 28: def security_key 29: params['callbackPW'] 30: end
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 46 46: def status 47: params['transStatus'] == 'Y' ? 'Completed' : 'Cancelled' 48: end
Convert a AVS value to a symbol - see above for more about AVS
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 142 142: def avs_value_to_symbol(value) 143: case value.to_s 144: when '8' 145: :partial_match 146: when '4' 147: :no_match 148: when '2' 149: :matched 150: when '1' 151: :not_checked 152: else 153: :not_supported 154: end 155: end
Take the posted data and move the relevant data into a hash
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 122 122: def parse(post) 123: @raw = post 124: for line in post.split('&') 125: key, value = *line.scan( %{^(\w+)\=(.*)$} ).flatten 126: params[key] = value 127: end 128: end
Read the custom params into a hash
# File lib/active_merchant/billing/integrations/world_pay/notification.rb, line 131 131: def read_custom_params 132: custom = {} 133: params.each do |key, value| 134: if /\A(M_|MC_|CM_)/ === key 135: custom[key.gsub(/\A(M_|MC_|CM_)/, '').to_sym] = value 136: end 137: end 138: custom 139: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.