用于安全支付网关的coldfusion哈希 [英] Hash in coldfusion for secure payment gateway

查看:13
本文介绍了用于安全支付网关的coldfusion哈希的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Coldfusion 中创建一个哈希密码,以便我们的安全支付网关接受交易.

I am trying to create a hash password in coldfusion for our secure payment gateway to accept a transaction.

很遗憾,支付网关拒绝接受我生成的哈希.

Unfortunately the payment gateway is refusing to accept my generated hash.

表单通过交易的所有元素发送,并根据五个不同的字段发送生成的哈希.

The form sends through all the elements of the transaction and sends a generated hash based on five different fields.

在 PHP 中是-:

<?php
echo hash('sha256', '
test_site1234
GBP
OrderTotal
OrderID
PASSWORD
');;
?>

我认为coldfusion中的代码应该是-:

Am I right in thinking the code in coldfusion should be -:

    <cfset sitesecurity = Hash("test_site1234"&"GBP"&#OrderTotal#&#URL.ThisOrderID#&"PASSWORD", "SHA-256")>

<cfoutput>#sitesecurity#</cfoutput>

推荐答案

我相信 Miguel-F 发布的链接会解决您的问题.Coldfusion 的哈希输出全部大写,而我见过的大多数(全部?)其他输出都是小写.根据网关处理区分大小写的方式,您应该尝试传递小写哈希.

I believe the link Miguel-F posted will fix your issue. Coldfusion's hash output is in all uppercase where most (all?) other outputs I've seen are in lowercase. Depending on how your gateway handles case sensitivity you should try passing a lowercase hash.

<cfset sitesecurity = lCase(hash("test_site1234GBP"&OrderTotal&URL.ThisOrderID&"PASSWORD", "SHA-256"))>  

这篇关于用于安全支付网关的coldfusion哈希的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆