Class: ActiveMerchant::Billing::Integrations::Tenpay::Helper

Inherits:
Helper
  • Object
show all
Defined in:
lib/active_merchant/billing/integrations/tenpay/helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(order, account, options = {}) ⇒ Helper

Returns a new instance of Helper.



22
23
24
25
# File 'lib/active_merchant/billing/integrations/tenpay/helper.rb', line 22

def initialize(order, , options = {})
  super
  add_field('bank_type', 0)
end

Instance Method Details

#signObject



27
28
29
30
31
32
33
# File 'lib/active_merchant/billing/integrations/tenpay/helper.rb', line 27

def sign
  add_field('sign',
            Digest::MD5.hexdigest("cmdno=#{cmdno}&date=#{date}&bargainor_id=#{}" +
            "&transaction_id=#{transaction_id}&sp_billno=#{order}&total_fee=#{amount}" +
            "&fee_type=#{currency}&return_url=#{return_url}&attach=#{attach}&key=#{KEY}"))
  nil
end