Class: ActiveMerchant::Billing::Integrations::Universal::Helper
- Inherits:
-
Helper
- Object
- Helper
- ActiveMerchant::Billing::Integrations::Universal::Helper
show all
- Defined in:
- lib/active_merchant/billing/integrations/universal/helper.rb
Instance Attribute Summary
Attributes inherited from Helper
#fields
Instance Method Summary
collapse
Methods inherited from Helper
#add_field, #add_fields, #add_raw_html_field, #billing_address, #form_method, inherited, mapping, #raw_html_fields, #shipping_address, #test?
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Returns a new instance of Helper.
6
7
8
9
10
11
12
13
14
|
# File 'lib/active_merchant/billing/integrations/universal/helper.rb', line 6
def initialize(order, account, options = {})
super
@forward_url = options[:forward_url]
@key = options[:credential2]
self.country = options[:country]
self.account_name = options[:account_name]
self.transaction_type = options[:transaction_type]
add_field 'x_test', @test.to_s
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class ActiveMerchant::Billing::Integrations::Helper
Instance Method Details
#credential_based_url ⇒ Object
16
17
18
|
# File 'lib/active_merchant/billing/integrations/universal/helper.rb', line 16
def credential_based_url
@forward_url
end
|
20
21
22
|
# File 'lib/active_merchant/billing/integrations/universal/helper.rb', line 20
def form_fields
sign_fields
end
|
#generate_signature ⇒ Object
28
29
30
|
# File 'lib/active_merchant/billing/integrations/universal/helper.rb', line 28
def generate_signature
Universal.sign(@fields, @key)
end
|
#sign_fields ⇒ Object
24
25
26
|
# File 'lib/active_merchant/billing/integrations/universal/helper.rb', line 24
def sign_fields
@fields.merge!('x_signature' => generate_signature)
end
|