我有一个使用authorize.net进行信用卡交易的POS。当它处于testmode时,一切都很好,但是当我们上线时,我们遇到了这个错误:
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];
答案 0 :(得分:0)
我的问题已经解决了。
我使用print_r
来显示$this->_response_array
的数组内容。它显示响应原因代码为87和响应原因文本"此市场类型的交易无法在此系统上处理。"
我打开了授权帐户来检查市场类型。
产品类型为" Card Present"市场类型是"零售"。
使事情有效。市场类型应设置为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];
}