Class: OffsitePayments::Integrations::Dwolla::Helper
- Defined in:
- lib/offsite_payments/integrations/dwolla.rb
Instance Attribute Summary
Attributes inherited from Helper
Instance Method Summary collapse
-
#initialize(order, account, options = {}) ⇒ Helper
constructor
A new instance of Helper.
Methods inherited from Helper
#add_field, #add_fields, #add_raw_html_field, #billing_address, #form_fields, #form_method, inherited, mapping, #raw_html_fields, #shipping_address, #test?
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Returns a new instance of Helper.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/offsite_payments/integrations/dwolla.rb', line 30 def initialize(order, account, = {}) super add_field('name', 'Store Purchase') = Time.now.to_i.to_s if OffsitePayments.mode == :test || [:test] add_field('test', 'true') # timestamp used for test signature generation: = "1370726016" end add_field('timestamp', ) add_field('allowFundingSources', 'true') key = [:credential2].to_s secret = [:credential3].to_s orderid = order.to_s signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA1.new, secret, "#{key}&#{}&#{orderid}") add_field('signature', signature) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class OffsitePayments::Helper