Sha256: 8f3d153cdf6cd81a8a27a4ccbe5ac3b9dc30a0850131228d35b185775a9a7988

Contents?: true

Size: 509 Bytes

Versions: 2

Compression:

Stored size: 509 Bytes

Contents

require 'test_helper'

class Alipay::App::SignTest < Minitest::Test
  def test_params_to_sorted_string
    assert_equal %q(a=2&b=1), Alipay::App::Sign.params_to_sorted_string(b: 1, a: 2)
  end

  def test_params_to_encoded_string
    assert_equal %q(biz_content=%7B%3Aname%3D%3E%22%E9%A1%BA%E9%81%93%22%7D&out_trade_no=MEM1234567&total_amount=0.01), Alipay::App::Sign.params_to_encoded_string(
      biz_content: {:name=>'顺道'},
      out_trade_no: 'MEM1234567',
      total_amount: '0.01'
    )
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alipay-0.14.0 test/alipay/app/sign_test.rb
alipay-0.13.0 test/alipay/app/sign_test.rb