Included Modules

Class Index [+]

Quicksearch

ActiveMerchant::Billing::Integrations::Gestpay::Notification

Public Instance Methods

acknowledge() click to toggle source
    # File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 47
47:           def acknowledge
48:             true
49:           end
complete?() click to toggle source
    # File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 10
10:           def complete?
11:             status == 'Completed'
12:           end
currency() click to toggle source
    # 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
gross() click to toggle source

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
item_id() click to toggle source

The important param

    # File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 15
15:           def item_id
16:             params['PAY1_SHOPTRANSACTIONID']
17:           end
status() click to toggle source
    # 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
test?() click to toggle source
    # File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 34
34:           def test?
35:             false
36:           end
transaction_id() click to toggle source
    # File lib/active_merchant/billing/integrations/gestpay/notification.rb, line 19
19:           def transaction_id
20:             params['PAY1_BANKTRANSACTIONID']
21:           end

Private Instance Methods

decrypt_data(shop_login, encrypted_string) click to toggle source
    # 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
decryption_query_string(shop_login, encrypted_string) click to toggle source
    # 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
parse(query_string) click to toggle source

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
parse_delimited_string(string, delimiter = '&', unencode_cgi = false) click to toggle source
    # 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.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.