kashflow api脚本无法连接

The problem I have is with the script that connects to kashflow from our website, when a customer enters their order and finalises the checkout the site is supposed to connect to kashflow but instead gives the following error.

Notice: Undefined index: $Name in /home/expressn/public_html/ajax/kashflow/includes/kashflow.inc.php on line 73

Unhandled exception: Customer name cannot be empty

It's been narrowed down to the following code we hope as Customer Name is apparently a blank string?

Would anyone be kind enough to tell me what needs to be done to solve this problem?

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

Hello I know it has been a while now but I also ran into this problem.

From my experience the mandatory params are:

            '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'=>''

The case that you use for the keys is also important so "EC" is not the same as "ec". The api also returns a blank object if you are not authenticated, this can make it seem as if it is working when it is not.

So one thing to check is that you are giving 'UserName' & 'Password' not 'username' & 'password' just another thing is that I found https://securedwebapp.com/api/service.asmx << this doc is much better than http://www.kashflow.com/developers/soap-api/ << this doc for detailing how to call the APIs.