# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 47 47: def acknowledge 48: true 49: end
# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 10 10: def complete? 11: status == 'Completed' 12: end
# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 28 28: def currency 29: # Ruby 1.9 compat 30: method = CURRENCY_MAPPING.respond_to?(:key) ? :key : :index 31: CURRENCY_MAPPING.send(method, params['PAY1_UICCODE']) 32: end
the money amount we received in X.2 decimal.
# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 24 24: def gross 25: params['PAY1_AMOUNT'] 26: end
The important param
# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 15 15: def item_id 16: params['PAY1_SHOPTRANSACTIONID'] 17: end
# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 38 38: def status 39: case params['PAY1_TRANSACTIONRESULT'] 40: when 'OK' 41: 'Completed' 42: else 43: 'Failed' 44: end 45: end
# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 72 72: def decrypt_data(shop_login, encrypted_string) 73: response = ssl_get(Gestpay.service_url, decryption_query_string(shop_login, encrypted_string)) 74: encoded_response = parse_response(response) 75: parse_delimited_string(encoded_response, DELIMITER, true) 76: end
# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 78 78: def decryption_query_string(shop_login, encrypted_string) 79: "#{DECRYPTION_PATH}?a=" + CGI.escape(shop_login) + "&b=" + encrypted_string + "&c=" + CGI.escape(VERSION) 80: end
Take the posted data and move the relevant data into a hash
# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 53 53: def parse(query_string) 54: @raw = query_string 55: 56: return if query_string.blank? 57: encrypted_params = parse_delimited_string(query_string) 58: 59: return if encrypted_params['a'].blank? || encrypted_params['b'].blank? 60: @params = decrypt_data(encrypted_params['a'], encrypted_params['b']) 61: end
# File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 63 63: def parse_delimited_string(string, delimiter = '&', unencode_cgi = false) 64: result = {} 65: for line in string.split(delimiter) 66: key, value = *line.scan( %{^(\w+)\=(.*)$} ).flatten 67: result[key] = unencode_cgi ? CGI.unescape(value) : value 68: end 69: result 70: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.