Module: ActiveMerchant::Billing::Integrations::Ogone
- Defined in:
- lib/active_merchant_ogone.rb,
lib/active_merchant_ogone/helper.rb,
lib/active_merchant_ogone/notification.rb
Defined Under Namespace
Classes: Helper, Notification
Class Method Summary
collapse
Class Method Details
.inbound_message_signature(fields, signature = nil) ⇒ Object
46
47
48
49
50
51
|
# File 'lib/active_merchant_ogone.rb', line 46
def self.inbound_message_signature(fields, signature=nil)
signature ||= self.inbound_signature
keys = %w( orderID currency amount PM ACCEPTANCE STATUS CARDNO PAYID NCERROR BRAND )
datastring = keys.collect{|key| fields[key]}.join('')
Digest::SHA1.hexdigest("#{datastring}#{signature}").upcase
end
|
.notification(post, options = {}) ⇒ Object
35
36
37
|
# File 'lib/active_merchant_ogone.rb', line 35
def self.notification(post, options={})
Notification.new(post, options={})
end
|
.outbound_message_signature(fields, signature = nil) ⇒ Object
39
40
41
42
43
44
|
# File 'lib/active_merchant_ogone.rb', line 39
def self.outbound_message_signature(fields, signature=nil)
signature ||= self.outbound_signature
keys = %w( orderID amount currency PSPID )
datastring = keys.collect{|key| fields[key]}.join('')
Digest::SHA1.hexdigest("#{datastring}#{signature}").upcase
end
|
.service_url ⇒ Object
25
26
27
28
29
30
31
32
33
|
# File 'lib/active_merchant_ogone.rb', line 25
def self.service_url
mode = ActiveMerchant::Billing::Base.integration_mode
case mode
when :production then self.live_service_url
when :test then self.test_service_url
else
raise StandardError, "Integration mode set to an invalid value: #{mode}"
end
end
|
.setup {|_self| ... } ⇒ Object
21
22
23
|
# File 'lib/active_merchant_ogone.rb', line 21
def self.setup
yield(self)
end
|