dtv7174 2014-07-25 08:42
浏览 25

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);
}
  • 写回答

1条回答 默认 最新

  • dongtanlin0765 2014-12-15 17:45
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度