檢索已激活的付款方式
請求參數
參數 | 類型 | 說明 | 必需的 |
---|---|---|---|
action | string | “GetPaymentMethods” | Required |
響應參數
參數 | 類型 | 說明 |
---|---|---|
result | string | 操作結果:成功或錯誤 |
totalresults | int | 可用結果總數 |
paymentmethods | 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' => 'GetPaymentMethods',
// See https://developers.whmcs.com/api/authentication
'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
'password' => 'SECRET_OR_HASHED_PASSWORD',
'responsetype' => 'json',
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
示例請求(本地 API)
$command = 'GetPaymentMethods';
$postData = array(
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later
$results = localAPI($command, $postData, $adminUsername);
print_r($results);
示例響應 JSON
{
"result": "success",
"totalresults": 2,
"paymentmethods": {
"paymentmethod": [
{
"module": "paypal",
"displayname": "PayPal"
},
{
"module": "authorize",
"displayname": "Credit Card"
}
]
}
}
相關用法
- PHP WHMCS GetPayMethods用法及代碼示例
- PHP WHMCS GetPermissionsList用法及代碼示例
- PHP WHMCS GetPromotions用法及代碼示例
- PHP WHMCS GetProducts用法及代碼示例
- PHP WHMCS GetProjects用法及代碼示例
- PHP WHMCS GetProject用法及代碼示例
- PHP WHMCS GetTicketNotes用法及代碼示例
- PHP WHMCS GetUsers用法及代碼示例
- PHP WHMCS GetTLDPricing用法及代碼示例
- PHP WHMCS GetToDoItemStatuses用法及代碼示例
- PHP WHMCS GetCurrencies用法及代碼示例
- PHP WHMCS GetStaffOnline用法及代碼示例
- PHP WHMCS GetEmails用法及代碼示例
- PHP WHMCS GetClientPassword用法及代碼示例
- PHP WHMCS GetRegistrars用法及代碼示例
- PHP WHMCS GetAutomationLog用法及代碼示例
- PHP WHMCS GetQuotes用法及代碼示例
- PHP WHMCS GetActivityLog用法及代碼示例
- PHP WHMCS GetModuleQueue用法及代碼示例
- PHP WHMCS GetTickets用法及代碼示例
- PHP WHMCS GetInvoices用法及代碼示例
- PHP WHMCS GetServers用法及代碼示例
- PHP WHMCS GetSupportStatuses用法及代碼示例
- PHP WHMCS GetHealthStatus用法及代碼示例
- PHP WHMCS GetTicketAttachment用法及代碼示例
注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 GetPaymentMethods。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。