for verifying the signature of the URL parameters
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 7 def initialize(data, options) if options[:credential4].nil? raise ArgumentError, "You need to provide the notification password (SH1) as the option :credential4 to verify that the notification originated from Directebanking (Payment Networks AG)" end super end
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 111 def acknowledge # signature_is_valid? generate_signature.to_s == params['hash'].to_s end
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 14 def complete? status == 'Completed' end
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 40 def currency params['currency_id'] end
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 107 def generate_signature Digest::SHA1.hexdigest(generate_signature_string) end
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 102 def generate_signature_string #format is: transaction|user_id|project_id|sender_holder|sender_account_number|sender_bank_code|sender_bank_name|sender_bank_bic|sender_iban|sender_country_id|recipient_holder|recipient_account_number|recipient_bank_code|recipient_bank_name|recipient_bank_bic|recipient_iban|recipient_country_id|international_transaction|amount|currency_id|reason_1|reason_2|security_criteria|user_variable_0|user_variable_1|user_variable_2|user_variable_3|user_variable_4|user_variable_5|created|notification_password PAYMENT_HOOK_SIGNATURE_FIELDS.map {|key| params[key.to_s]} * "|" + "|#{@options[:credential4]}" end
the money amount we received in X.2 decimal.
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 32 def gross "%.2f" % params['amount'].to_f end
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 18 def item_id params['user_variable_0'] end
When was this payment received by the client.
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 27 def received_at Time.parse(params['created']) if params['created'] end
# File lib/active_merchant/billing/integrations/directebanking/notification.rb, line 36 def status 'Completed' end
Generated with the Darkfish Rdoc Generator 2.