2014-07-25 44 views
0

我的問題是連接從我們的網站,當用戶輸入他們的訂單,並最終確定該網站應該連接到kashflow結帳時kashflow腳本,而是提供了以下錯誤。kashflow API腳本一直無法連接

公告:未定義的索引:在 /home/expressn/public_html/ajax/kashflow/includes/kashflow.inc.php $名稱上 線73

未處理的異常:客戶名稱不能爲空

它已經縮小到下面的代碼中,我們希望爲客戶名稱顯然是一個空字符串?

會有人好心地告訴我需要做來解決這個問題呢?

public function insertCustomer($customer){  

    $parameters['custr'] = array(
     "CustomerID"    => 0, 
     "Code"      => '', 
     "Name"      => $customer['Name'], 
     "Contact"     => '', 
     "Telephone"     => $customer['Telephone'], 
     "Mobile"     => '', 
     "Fax"      => '', 
     "Email"      => $customer['Email'], 
     "Address1"     => $customer['Address1'], 
     "Address2"     => $customer['Address2'], 
     "Address3"     => $customer['Address3'], 
     "Address4"     => $customer['Address4'], 
     "Postcode"     => $customer['Postcode'], 
     "Website"     => '', 
     "EC"      => 0, 
     "OutsideEC"     => 0, 
     "Notes"      => '', 
     "Source"     => $this->m_source, 
     "Discount"     => 0, 
     "ShowDiscount"    => 0, 
     "PaymentTerms"    => 0, 
     "ExtraText1"    => '', 
     "ExtraText2"    => '', 
     "ExtraText3"    => '', 
     "ExtraText4"    => '', 
     "ExtraText5"    => '', 
     "ExtraText6"    => '', 
     "ExtraText7"    => '', 
     "ExtraText8"    => '', 
     "ExtraText9"    => '', 
     "ExtraText10"    => '', 
     "ExtraText11"    => '', 
     "ExtraText12"    => '', 
     "ExtraText13"    => '', 
     "ExtraText14"    => '', 
     "ExtraText15"    => '', 
     "ExtraText16"    => '', 
     "ExtraText17"    => '', 
     "ExtraText18"    => '', 
     "ExtraText19"    => '', 
     "ExtraText20"    => '', 
     "CheckBox1"     => 0, 
     "CheckBox2"     => 0, 
     "CheckBox3"     => 0, 
     "CheckBox4"     => 0, 
     "CheckBox5"     => 0, 
     "CheckBox6"     => 0, 
     "CheckBox7"     => 0, 
     "CheckBox8"     => 0, 
     "CheckBox9"     => 0, 
     "CheckBox10"    => 0, 
     "CheckBox11"    => 0, 
     "CheckBox12"    => 0, 
     "CheckBox13"    => 0, 
     "CheckBox14"    => 0, 
     "CheckBox15"    => 0, 
     "CheckBox16"    => 0, 
     "CheckBox17"    => 0, 
     "CheckBox18"    => 0, 
     "CheckBox19"    => 0, 
     "CheckBox20"    => 0, 
     "Created"     => date("Y-m-d\TH:i:s"), 
     "Updated"     => date("Y-m-d\TH:i:s"), 
     "CurrencyID"    => 0, 
     "ContactTitle"    => '', 
     "ContactFirstName"   => '', 
     "ContactLastName"   => '', 
     "CustHasDeliveryAddress" => 1, 
     "DeliveryAddress1"   => $customer['delAddress1'], 
     "DeliveryAddress2"   => $customer['delAddress2'], 
     "DeliveryAddress3"   => $customer['delAddress3'], 
     "DeliveryAddress4"   => $customer['delAddress4'], 
     "DeliveryPostcode"   => $customer['delPostcode'], 
     "VATNumber"     => '' 
    ); 
    return $this->makeRequest("InsertCustomer",$parameters); 
} 
+0

任何人都願意給我建議? –

回答

0

你好,我知道它已經有一段時間了,但我也遇到了這個問題。

從我的經驗強制性PARAMS是:

  'CustomerID'=>0, 
      'EC'=>0, 
      'OutsideEC'=>0, 
      'Source'=>0, 
      'Discount'=>0, 
      'ShowDiscount'=>0, 
      'PaymentTerms'=>0, 
      'CheckBox1'=>0, 
      'CheckBox2'=>0, 
      'CheckBox3'=>0, 
      'CheckBox4'=>0, 
      'CheckBox5'=>0, 
      'CheckBox6'=>0, 
      'CheckBox7'=>0, 
      'CheckBox8'=>0, 
      'CheckBox9'=>0, 
      'CheckBox10'=>0, 
      'CheckBox11'=>0, 
      'CheckBox12'=>0, 
      'CheckBox13'=>0, 
      'CheckBox14'=>0, 
      'CheckBox15'=>0, 
      'CheckBox16'=>0, 
      'CheckBox17'=>0, 
      'CheckBox18'=>0, 
      'CheckBox19'=>0, 
      'CheckBox20'=>0, 
      'Created'=> '', 
      'Updated'=>'', 
      'CurrencyID'=>0, 
      'Name'=>'' 

您使用的鍵的情況也是重要的,所以「EC」是不一樣的「EC」。 API還返回一個空的對象,如果你沒有通過認證,這可以使它看起來好像是工作時,它不是。

這麼一件事是檢查你是給「用戶名」 &「密碼」不「用戶名」 &「密碼」只是另一件事是,我發現https://securedwebapp.com/api/service.asmx < <這個文檔是不是http://www.kashflow.com/developers/soap-api/ < <這個文檔更好詳細介紹如何調用API。