DIBS定期付款,没有错误消息,根本不工作

时间:2013-02-18 07:15:40

标签: php payment-gateway credit-card recurring-billing dibs

我正在使用以下代码工作,但它无法正常工作

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

这是代码输出             排列          (              [reason] =&gt; 2              [status] =&gt; DECLINED          )           授权失败

    require('DIBSFunctions.php');

此文件包含用户名和密码,我正在提供。 e.g。

    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/

1 个答案:

答案 0 :(得分:1)

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

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

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