1

我正在使用以下代码工作,但它不工作

  require('DIBSFunctions.php');

     //Define input variables (here simply static variables)
  $Merchant     = "123456";
  $OrderID      = "AHJ798123AH-BH";
  $Currency     = "208"; //DKK
  $Amount       = "30000"; //In smallest possible unit 30000 Øre = DKK 300 
  $CardNo       = "5019100000000000"; //DIBS test Dankort values
  $ExpMon       = "06"; //DIBS test Dankort value
  $ExpYear      = "13"; //DIBS test Dankort value
  $CVC          = "684"; //DIBS test Dankort value
  $MD5['K1']    = "~.(S96%u|(UV,~ifxTt.DAKSNb&SKAHD"; //K1 and K2 MUST be gathered through
  $MD5['K2']    = "qJuH6vjXHLSDB*%¤&/hbnkjlBHGhjJKJ"; //ones DIBS admin-webinterface.

//Call function DIBSAuth to authorise payment
  $RES = DIBSAuth($Merchant,$Amount,$Currency,$CardNo,$ExpMon,$ExpYear,$CVC,$OrderID,$MD5);

  echo '<pre>';
  print_r($RES);


//Check the response (the DIBS API returns the variable transact on success)
  if ( $RES['transact'] != "" ) 
  {
    printf ("Authorisation successful! TransaktionID = %s",$RES['transact']);   

//Call function DIBSCapt to capture payment
    $RES2 = DIBSCapt($Merchant, $Amount, $RES['transact'], $OrderID);

    if ( $RES2['status'] == "ACCEPTED" ) 
    {
      printf ("Transaction completed");
    } else {
      printf ("Capture failed!");  
    }
  } else {
    printf ("Authorisation failed");
  }

这是代码输出 Array ( [reason] => 2 [status] => DECLINED ) 授权失败

    require('DIBSFunctions.php');

这个文件包含用户名和密码,我提供。例如

    function http_post($host, $path, $data, $auth="") {
        $auth['username']       = '123456';
        $auth['password']       = '987656656';
       //rest of the code
    }

如果有人想查看“DIBSFunctions.php”文件,可以从这里下载http://tech.dibspayment.com/toolbox/downloads/dibs_php_functions/

4

1 回答 1

1

我联系了技术支持并得到以下答案:

您遇到的问题是由于您试图向我们发送真实的卡号(测试或实时)。这种集成形式需要对您的系统进行 PCI 认证。

大多数客户使用所谓的托管解决方案,您使用我们的付款窗口。有关文档,请参阅 tech.dibs.dk。

于 2013-02-19T04:31:01.393 回答