0

我一直试图让 PayOne FrontEnd 接口接受我的请求中的哈希值,但绝对无济于事。我有一张支持票,但需要一个相对较快的解决方案,所以我来了。

返回的错误是“Hashwert Nicht Korrekt”(哈希值不正确)。

这是我的代码:

$request="authorization"; 
$portalid = 2017373; 
$aid = 24413; 
$key = "secretkeychangedforsecuritoyreasons"; // Key (configurable in the payment portal) 

$id[1]=  "PART_100"; 
$pr[1]=  2000;
$no[1] = 1; 
$de[1] = "Registration Fee";
$va[1] = 19; 
$amount = round($pr[1]*$no[1]);
$clearingtype = "cc";
$mode = "test";
$currency="EUR"; 
$reference="24393"; 
$customerid="24393"; 

    $hash = md5(
             $aid . 
             $amount . 
             $currency . 
             $customerid .
             $clearingtype . 
             $de[1] . 
             $id[1] . 
             $mode .
             $no[1] . 
             $portalid . 
             $pr[1] . 
             $reference . 
             $request . 
             $va[1] . 
             $key
     ); 

$url="https://secure.pay1.de/frontend/?request=" . $request . 
"&aid=" . $aid . 
"&mode=" . $mode .
"&clearingtype=" . $clearingtype .
"&portalid=" . $portalid . 
"&customerid=" . $customerid . 
"&currency=" . $currency . 
"&amount=" . $amount . 
"&reference=" . $reference . 
"&id[1]=" . $id[1] . 
"&pr[1]=" . $pr[1] . 
"&no[1]=" . $no[1] . 
"&de[1]=" . $de[1] . 
"&va[1]=" . $va[1] . 
"&hash=" . $hash; 

header("Location: $url");

我已经检查并重新检查了文档,并且在我将它们放在一起的方式中没有发现任何错误。如果我更改单个值(例如 portalid 等),则会引发相应的错误。

任何帮助,将不胜感激。

4

2 回答 2

1

我在 client-api-documentation 中找到了以下部分:

注意:PAYONE 平台期望计算的哈希值转换为小写;例如 87dbc7c369b85b7a699adff1a2b27bab

也许你的哈希中有一些大写字母?我对加密的哈希执行“.toLowerCase()”(Java 中)。

另一种选择:您忘记了一些参数。乍一看,我看不到以下内容:中

于 2014-07-09T06:16:41.137 回答
0

我们使用以下内容:

$req['aid']          = 09876; // Sub-AccountID
$req['portalid']     = 6789012; // portal-ID
$req['mode']         = "live"; // Live || test
$req['request']      = "authorization"; // Request
$req['id[1]']        = $YourProductID; // e.g. articleno
$req['pr[1]']        = $singleprice;
$req['no[1]']        = $count; // count or pieces
$req['de[1]']        = $articledescription;
$req['amount']       = $summary; // price summary
$req['currency']     = "EUR";
$req['reference']    = $unique_ref.$YourProductId; //my unique is time()
$req['customerid']   = $userId;
$req['clearingtype'] = $clearing; // cc || wlt
$req['encoding']     = "UTF-8";
$req['targetwindow'] = "top";

ksort($req); //so i know its important to sort

//building the hash
foreach ($req as $key => $val) {
    $req['hash'] = $req['hash'] . $val;
}

// all in md5() ... note your own payment ID
$req['hash'] = md5($req['hash'] . $YourPayOneID);

希望能帮助到你 ;)

于 2015-10-13T07:47:25.767 回答