【问题标题】:Getting Error while using WHMCS API使用 WHMCS API 时出错
【发布时间】:2018-03-25 14:46:04
【问题描述】:

从 WHMCS API 添加客户端时,我们收到如下错误...{"result":"error","message":"You did not enter your first name"}

但我们的详细信息已存储在数据库中,但我们仍然收到相同的错误。请在下面找到代码..

Route::get('/addclient', function () {
Whmcs::AddClient([
    'clientid' =>'6',
    'firstname' => 'dfsfsd',
    'lastname' => 'Dsdfsoe',
    'email' => 'sfddfdsdfsdfsgdfg@gmail.com',
    'address1' => '123 Main Street',
    'city' => 'Anytown',
    'state' => 'State',
    'postcode' => '12345',
    'country' => 'US',
    'phonenumber' => '800-555-1234',
    'password2' => 'password',
    'responsetype' => 'json',

]);
return Whmcs::AddClient();

});

【问题讨论】:

  • 你必须为函数创建一个变量并返回它。

标签: php whmcs laravel-5.6


【解决方案1】:

试试你的代码:

Route::get('/addclient', function () {
    $results = Whmcs::AddClient([
        'clientid' =>'6',
        'firstname' => 'dfsfsd',
        'lastname' => 'Dsdfsoe',
        'email' => 'sfddfdsdfsdfsgdfg@gmail.com',
        'address1' => '123 Main Street',
        'city' => 'Anytown',
        'state' => 'State',
        'postcode' => '12345',
        'country' => 'US',
        'phonenumber' => '800-555-1234',
        'password2' => 'password',
        'responsetype' => 'json',

    ]);
    return $results;
});

return Whmcs::AddClient(); 行告诉您的函数添加客户端但没有信息,这就是您收到错误的原因。

仅供参考,AddClient API function 中未列出 clientid,因此您可以省略它。

【讨论】:

  • 很高兴它有帮助。
猜你喜欢
  • 2020-04-04
  • 2019-09-26
  • 2015-04-04
  • 1970-01-01
  • 2015-01-07
  • 1970-01-01
  • 1970-01-01
  • 2017-02-26
  • 1970-01-01
相关资源
最近更新 更多