设置为实时时出现 AuthorizeNetAIM 错误

AuthorizeNetAIM Error when set to live

我有一个使用 authorize.net 进行信用卡交易的 POS。在测试模式下一切都很好,但是当我们上线时,我们遇到了这个错误:

     A PHP Error was encountered
    Severity: Notice
    Message: Undefined offset: 22
    Filename: lib/AuthorizeNetAIM.php
    Line Number: 446
    A PHP Error was encountered
    Severity: Notice
    Message: Undefined offset: 23
    Filename: lib/AuthorizeNetAIM.php
    Line Number: 447
    A PHP Error was encountered
    Severity: Notice
    Message: Undefined offset: 24
    Filename: lib/AuthorizeNetAIM.php
    Line Number: 448
    A PHP Error was encountered
    Severity: Notice
    Message: Undefined offset: 25
    Filename: lib/AuthorizeNetAIM.php
    Line Number: 449

我打开了AuthorizeNetAIM.php 这是代码行:

        $this->fax                  = $this->_response_array[22];
        $this->email_address        = $this->_response_array[23];
        $this->ship_to_first_name   = $this->_response_array[24];
        $this->ship_to_last_name    = $this->_response_array[25];
        $this->ship_to_company      = $this->_response_array[26];
        $this->ship_to_address      = $this->_response_array[27];
        $this->ship_to_city         = $this->_response_array[28];
        $this->ship_to_state        = $this->_response_array[29];
        $this->ship_to_zip_code     = $this->_response_array[30];
        $this->ship_to_country      = $this->_response_array[31];
        $this->tax                  = $this->_response_array[32];
        $this->duty                 = $this->_response_array[33];
        $this->freight              = $this->_response_array[34];
        $this->tax_exempt           = $this->_response_array[35];
        $this->purchase_order_number= $this->_response_array[36];
        $this->md5_hash             = $this->_response_array[37];
        $this->card_code_response   = $this->_response_array[38];
        $this->cavv_response        = $this->_response_array[39];
        $this->account_number       = $this->_response_array[50];
        $this->card_type            = $this->_response_array[51];
        $this->split_tender_id      = $this->_response_array[52];
        $this->requested_amount     = $this->_response_array[53];
        $this->balance_on_card      = $this->_response_array[54];

我的问题解决了。

我用print_r来显示$this->_response_array的数组内容。它显示响应原因代码 87 和响应原因文本 "Transactions of this market type cannot be processed on this system."

我打开授权账户查看市场类型。 产品类型为 "Card Present",市场类型为 "Retail"。 让事情顺利进行。市场类型应设置为 2。 我更新了 AuthorizeNetAim.php,下面是我的代码:

     protected $_x_post_fields = array(
    "version" => "3.1", 
    "delim_char" => ",",
    "delim_data" => "TRUE",
    "relay_response" => "FALSE",
    "encap_char" => "|",
    "market_type" => "2",
    "device_type" => "8"
    );

但是还是显示错误。所以我使用下面的代码:

     if(isset($this->_response_array[22]))
        {
            $this->fax                  = $this->_response_array[22];
            $this->email_address        = $this->_response_array[23];
            $this->ship_to_first_name   = $this->_response_array[24];
            $this->ship_to_last_name    = $this->_response_array[25];
            $this->ship_to_company      = $this->_response_array[26];
            $this->ship_to_address      = $this->_response_array[27];
            $this->ship_to_city         = $this->_response_array[28];
            $this->ship_to_state        = $this->_response_array[29];
            $this->ship_to_zip_code     = $this->_response_array[30];
            $this->ship_to_country      = $this->_response_array[31];
            $this->tax                  = $this->_response_array[32];
            $this->duty                 = $this->_response_array[33];
            $this->freight              = $this->_response_array[34];
            $this->tax_exempt           = $this->_response_array[35];
            $this->purchase_order_number= $this->_response_array[36];
            $this->md5_hash             = $this->_response_array[37];
            $this->card_code_response   = $this->_response_array[38];
            $this->cavv_response        = $this->_response_array[39];
            $this->account_number       = $this->_response_array[50];
            $this->card_type            = $this->_response_array[51];
            $this->split_tender_id      = $this->_response_array[52];
            $this->requested_amount     = $this->_response_array[53];
            $this->balance_on_card      = $this->_response_array[54];
        }