哈希冷灌装安全支付网关 [英] Hash in coldfusion for secure payment gateway

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

问题描述

我试图在coldfusion中为我们的安全支付网关创建一个哈希密码以接受交易。



不幸的是,支付网关拒绝接受我生成的哈希。



表单发送事务的所有元素,并根据五个不同的字段发送生成的散列。



在PHP中,它是 - :

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

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



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

< cfoutput>#sitesecurity#< / cfoutput>


解决方案

我相信连接Miguel-F问题。 Coldfusion的哈希输出是大写的,其中大多数(所有?)其他输出我看到的是小写的。根据您的网关处理大小写区分的方式,您应该尝试传递小写哈希。

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


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.

In PHP it is-:

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

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>

解决方案

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"))>  

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

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