獲取模塊配置參數
請求參數
參數 | 類型 | 說明 | 必需的 |
---|---|---|---|
action | string | “獲取模塊配置參數” | Required |
moduleType | string | 要激活的模塊類型 | Required |
moduleName | string | 要激活的模塊名稱 | Required |
響應參數
參數 | 類型 | 說明 |
---|---|---|
result | string | 操作結果:成功或錯誤 |
parameters | array | 可以為給定模塊設置的一組配置參數。 |
示例請求 (CURL)
$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' => 'GetModuleConfigurationParameters',
// See https://developers.whmcs.com/api/authentication
'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
'password' => 'SECRET_OR_HASHED_PASSWORD',
'moduleType' => 'gateway',
'moduleName' => 'paypal',
'responsetype' => 'json',
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
示例請求(本地 API)
$command = 'GetModuleConfigurationParameters';
$postData = array(
'moduleType' => 'gateway',
'moduleName' => 'paypal',
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later
$results = localAPI($command, $postData, $adminUsername);
print_r($results);
示例響應 JSON
{
"result": "success",
"parameters[0][name]": "FriendlyName",
"parameters[0][displayName]": "FriendlyName",
"parameters[0][fieldType]": "text",
"parameters[1][name]": "email",
"parameters[1][displayName]": "PayPal Email",
"parameters[1][fieldType]": "text",
"parameters[2][name]": "forceonetime",
"parameters[2][displayName]": "Force One Time Payments",
"parameters[2][fieldType]": "yesno",
"parameters[3][name]": "forcesubscriptions",
"parameters[3][displayName]": "Force Subscriptions",
"parameters[3][fieldType]": "yesno",
"parameters[4][name]": "requireshipping",
"parameters[4][displayName]": "Require Shipping Address",
"parameters[4][fieldType]": "yesno",
"parameters[5][name]": "overrideaddress",
"parameters[5][displayName]": "Client Address Matching",
"parameters[5][fieldType]": "yesno",
"parameters[6][name]": "apiusername",
"parameters[6][displayName]": "API Username",
"parameters[6][fieldType]": "text",
"parameters[7][name]": "apipassword",
"parameters[7][displayName]": "API Password",
"parameters[7][fieldType]": "text",
"parameters[8][name]": "apisignature",
"parameters[8][displayName]": "API Signature",
"parameters[8][fieldType]": "text",
"parameters[9][name]": "sandbox",
"parameters[9][displayName]": "Sandbox Mode",
"parameters[9][fieldType]": "yesno"
}
錯誤響應
可能的錯誤條件響應包括:
- 提供的模塊類型無效。支持的模塊類型包括:xxx
- 提供的模塊名稱無效。
- 獲取模塊類型不支持的模塊配置參數。
- 發生意外錯誤:xxx
相關用法
- PHP WHMCS GetModuleQueue用法及代碼示例
- PHP WHMCS GetTicketNotes用法及代碼示例
- PHP WHMCS GetUsers用法及代碼示例
- PHP WHMCS GetTLDPricing用法及代碼示例
- PHP WHMCS GetToDoItemStatuses用法及代碼示例
- PHP WHMCS GetPermissionsList用法及代碼示例
- PHP WHMCS GetCurrencies用法及代碼示例
- PHP WHMCS GetStaffOnline用法及代碼示例
- PHP WHMCS GetEmails用法及代碼示例
- PHP WHMCS GetClientPassword用法及代碼示例
- PHP WHMCS GetPromotions用法及代碼示例
- PHP WHMCS GetRegistrars用法及代碼示例
- PHP WHMCS GetAutomationLog用法及代碼示例
- PHP WHMCS GetQuotes用法及代碼示例
- PHP WHMCS GetActivityLog用法及代碼示例
- PHP WHMCS GetPaymentMethods用法及代碼示例
- PHP WHMCS GetTickets用法及代碼示例
- PHP WHMCS GetProducts用法及代碼示例
- PHP WHMCS GetProjects用法及代碼示例
- PHP WHMCS GetInvoices用法及代碼示例
- PHP WHMCS GetPayMethods用法及代碼示例
- PHP WHMCS GetServers用法及代碼示例
- PHP WHMCS GetSupportStatuses用法及代碼示例
- PHP WHMCS GetHealthStatus用法及代碼示例
- PHP WHMCS GetTicketAttachment用法及代碼示例
注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 GetModuleConfigurationParameters。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。