เมนูหลัก

API WHMCS 4.1.2

เริ่มโดย Tanut007, 06 ตุลาคม 2010, 10:08:08

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

Tanut007

มีใครพอจะทราบวิธีการตั้งค่า API ของ WHMCS 4.1.2 ไหมครับ ตามนี้เลยครับ

WHMCS API Username
WHMCS API Password
WHMCS API Access Key

ขอบคุณครับ  :wanwan017:
เว็บผมเอง [direct=http://vps.tanut007.com]สอนการใช้ VPS[/direct][direct=http://www.tanut007.com]บล็อกของผม ฝากด้วย[/direct][direct=http://www.mym2h.com]ระบบบิลลิ่งฮัฟ[/direct][direct=http://www.mini2hosting.com]โฮสราคาถูก คุณภาพสูง[/direct]
เรียนเทคโน ขายโฮสต์ อยู่บางแสน ...
[direct=http://www.mini2vps.com]Mini2VPS.com VPS คุณภาพสูง กำกับดูแลโดยป๋าฟลุ๊คเองหะ

หลานยายปริก

โทษครับมันคืออะไรเหรอ พึ่งเคยได้ยินชื่อ
บริการเก็บเมลล์และเบอร์โทรลูกค้าจากคอมเม้นเพจCLICK!!

s_ra_i

<?php

$url = "http://www.yourdomain.com/whmcs/includes/api.php"; # URL to WHMCS API file
$username = "Admin"; # Admin username goes here
$password = "demo"; # Admin password goes here

$postfields["username"] = $username;
$postfields["password"] = md5($password);
$postfields["action"] = "addinvoicepayment"; #action performed by the API:Functions
$postfields["invoiceid"] = "1";
$postfields["transid"] = "TEST";
$postfields["gateway"] = "mailin";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);

$data = explode(";",$data);
foreach ($data AS $temp) {
  $temp = explode("=",$temp);
  $results[$temp[0]] = $temp[1];
}

if ($results["result"]=="success") {
  # Result was OK!
} else {
  # An error occured
  echo "The following error occured: ".$results["message"];
}

?>
:wanwan009: