doushan5245 2017-10-04 19:10
浏览 19

如何在Codeigniter项目中集成WHMCS?

I hope everyone doing good. I have a question how can i integrate WHMCS in a Codeignitor project?

I have my front end i.e HTML and CSS and all routing on the Codeignitor framework. Now how do i integrate with WHMCS for automation. I have no clue where to start from or what to look for. All i know WHMCS script can be added from the control pannel but i don't think that will add it in my codeignitor project. So any help would be appreciated

Thanks

  • 写回答

1条回答 默认 最新

  • dragon8997474 2017-10-05 07:44
    关注

    You will probably use the WHMCS API, for example to order a product or domain you will use the AddOrder api function like below:

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://www.example.com/includes/api.php');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,
        http_build_query(
            array(
                'action' => 'AddOrder',
                // See https://developers.whmcs.com/api/authentication
                'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
                'password' => 'SECRET_OR_HASHED_PASSWORD',
                'clientid' => '1',
                'pid' => array(1,1),
                'domain' => array('domain1.com', 'domain2.com'),
                'billingcycle' => array('monthly','semi-annually'),
                'domaintype' => array('register', 'register'),
                'regperiod' => array(1, 2),
                'dnsmanagement' => array(0 => false, 1 => true),
                'nameserver1' => 'ns1.demo.com',
                'nameserver2' => 'ns2.demo.com',
                'paymentmethod' => 'mailin',
                'responsetype' => 'json',
            )
        )
    );
    $response = curl_exec($ch);
    curl_close($ch);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用