Class: ActiveMerchant::Billing::Integrations::Alipay::Helper

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

Constant Summary collapse

CREATE_DIRECT_PAY_BY_USER =
'create_direct_pay_by_user'
CREATE_PARTNER_TRADE_BY_BUYER =
'create_partner_trade_by_buyer'
TRADE_CREATE_BY_BUYER =
'trade_create_by_buyer'
CREATE_FOREIGN_TRADE =
'create_forex_trade'

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Helper.



72
73
74
# File 'lib/active_merchant/billing/integrations/alipay/helper.rb', line 72

def initialize(order, , options = {})
  super
end

Instance Method Details

#signObject



76
77
78
79
80
81
82
# File 'lib/active_merchant/billing/integrations/alipay/helper.rb', line 76

def sign
  add_field('sign',
            Digest::MD5.hexdigest((@fields.sort.collect{|s|s[0]+"="+CGI.unescape(s[1])}).join("&")+KEY)
           )
  add_field('sign_type', 'MD5')
  nil
end