Rails - 使用 sha384 计算

Rails - calculate with the use of sha384

我需要做这样的事情:

Checksum of parameters: {"sessionId":"str","merchantId":int,"amount":int,"currency":"str","crc":"str"}

calculated with the use of sha384

我的代码:

   sha3 = Digest::SHA384.hexdigest(

      session_.to_s + @config['seller_id'].to_s + @account['amount'].to_s + 
      currency.to_s + APP_CONFIG['payment']['pin'].to_s
    
    )
      
    sha3_ = sha3

其中:

session_ = 9c64637ebfa5ef0b3ed42a64d2ebfce7

@config['seller_id'] = 12345

@account['amount'] = 2000

currency = 'PLN'

APP_CONFIG['payment']['pin'] = 1234567890

做错还是做对?支付公司说我的sha3_不对

我打赌你需要计算 JSON 校验和。