Module: Gestpay::CustomInfo
Instance Method Summary collapse
Instance Method Details
#gestpay_decode(string) ⇒ Object
8 9 10 |
# File 'lib/gestpay/custom_info.rb', line 8 def gestpay_decode(string) string.split('*P1*').inject({}) { |mem, var| k,v=var.split('='); mem[k]=[v].pack('H*') ; mem } end |
#gestpay_encode(custom_info) ⇒ Object
4 5 6 |
# File 'lib/gestpay/custom_info.rb', line 4 def gestpay_encode(custom_info) custom_info.collect{|k,v| "#{k}=#{v.to_s.unpack('H*')[0]}"}.sort.join('*P1*') end |