gpt4 book ai didi

ios - 支付宝 : payment gateway integration : (incorrectly calculated hash parameter)

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:34:31 25 4
gpt4 key购买 nike

附上错误截图。

我在使用 WebView 为 iOS 应用程序集成 payUbiz 支付网关时遇到此错误。

我正在像这样从哈希字符串计算哈希码:

    let hashValue = "\(key)|\(txnid1)|\(amount)|\(productInfo)|\      (firstname)|\(email)|||||||||||\(Salt)"
let hash = self.createSHA512(hashValue)

func createSHA512(toEncrypt:String) -> String
{
let data = toEncrypt.dataUsingEncoding(NSUTF8StringEncoding)!
var digest = [UInt8](count:Int(CC_SHA512_DIGEST_LENGTH), repeatedValue: 0)
CC_SHA512(data.bytes, CC_LONG(data.length), &digest)
let hexBytes = digest.map { String(format: "%02x", $0) }
return hexBytes.joinWithSeparator("")
}

那么,我在计算哈希值时哪里出错了?

最佳答案

您计算哈希值的函数看起来是正确的。再次检查您的参数,从您的 payUbiz 仪表板检查并将它们粘贴到您的代码中。可能是输入错误。

关于ios - 支付宝 : payment gateway integration : (incorrectly calculated hash parameter),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41583615/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com