Class: ActiveMerchant::Billing::Integrations::Pay19::Helper
- Inherits:
-
Helper
- Object
- Helper
- ActiveMerchant::Billing::Integrations::Pay19::Helper
- Defined in:
- lib/active_merchant/billing/integrations/pay19/helper.rb
Instance Method Summary collapse
- #form_fields ⇒ Object
-
#initialize(order, account, options = {}) ⇒ Helper
constructor
A new instance of Helper.
- #sign ⇒ Object
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Returns a new instance of Helper.
17 18 19 20 21 22 |
# File 'lib/active_merchant/billing/integrations/pay19/helper.rb', line 17 def initialize(order, account, = {}) super(order, ACCOUNT, ) add_field('version_id', '2.00') add_field('order_date', DateTime.now.strftime("%Y%m%d")) add_field('pc_id', '') # Keep empty if pm_id is empty end |
Instance Method Details
#form_fields ⇒ Object
24 25 26 |
# File 'lib/active_merchant/billing/integrations/pay19/helper.rb', line 24 def form_fields @fields.merge('verifystring' => sign) end |
#sign ⇒ Object
28 29 30 31 32 33 |
# File 'lib/active_merchant/billing/integrations/pay19/helper.rb', line 28 def sign Digest::MD5.hexdigest(%w(version_id merchant_id order_date order_id amount currency returl pm_id pc_id).collect{ |name| "#{name}=#{@fields[name]}" }.join('&') + "&merchant_key=#{KEY}") end |