Class: ActiveMerchant::Billing::Integrations::Paydollar::Helper
- Defined in:
- lib/active_merchant/billing/integrations/paydollar/helper.rb
Instance Attribute Summary
Attributes inherited from Helper
Instance Method Summary collapse
- #currency=(currency_code) ⇒ Object
- #form_fields ⇒ Object
- #generate_secure_hash ⇒ Object
-
#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_method, mapping, #raw_html_fields, #shipping_address, #test?
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Returns a new instance of Helper.
7 8 9 10 11 |
# File 'lib/active_merchant/billing/integrations/paydollar/helper.rb', line 7 def initialize(order, account, = {}) super add_field('payType', 'N') # normal sale and not just auth @secret = [:credential2] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveMerchant::Billing::Integrations::Helper
Instance Method Details
#currency=(currency_code) ⇒ Object
26 27 28 |
# File 'lib/active_merchant/billing/integrations/paydollar/helper.rb', line 26 def currency=(currency_code) add_field(mappings[:currency], CURRENCY_MAP[currency_code]) end |
#form_fields ⇒ Object
13 14 15 |
# File 'lib/active_merchant/billing/integrations/paydollar/helper.rb', line 13 def form_fields @fields.merge('secureHash' => generate_secure_hash) end |
#generate_secure_hash ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/active_merchant/billing/integrations/paydollar/helper.rb', line 17 def generate_secure_hash fields = [@fields[mappings[:account]], @fields[mappings[:order]], @fields[mappings[:currency]], @fields[mappings[:amount]], @fields['payType']] Paydollar.sign(fields, @secret) end |