Class: ActiveMerchant::Billing::Integrations::Yeepay::Helper
- Inherits:
-
Helper
- Object
- Helper
- ActiveMerchant::Billing::Integrations::Yeepay::Helper
- Defined in:
- lib/active_merchant/billing/integrations/yeepay/helper.rb
Instance Method Summary collapse
- #form_fields ⇒ Object
- #hmac_md5_hexdigest ⇒ Object
-
#initialize(order, account, options = {}) ⇒ Helper
constructor
A new instance of Helper.
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Returns a new instance of Helper.
17 18 19 20 |
# File 'lib/active_merchant/billing/integrations/yeepay/helper.rb', line 17 def initialize(order, account, = {}) super(order, account, ) add_field('p0_Cmd', 'Buy') end |
Instance Method Details
#form_fields ⇒ Object
22 23 24 |
# File 'lib/active_merchant/billing/integrations/yeepay/helper.rb', line 22 def form_fields @fields.merge('hmac' => hmac_md5_hexdigest) end |
#hmac_md5_hexdigest ⇒ Object
26 27 28 |
# File 'lib/active_merchant/billing/integrations/yeepay/helper.rb', line 26 def hmac_md5_hexdigest OpenSSL::HMAC.hexdigest("md5", KEY, @fields.sort.collect{|s| s[1]}.join) end |