尝试在未支付的抄送发票上获取付款
请求参数
参数 | 类型 | 说明 | 必需的 |
---|---|---|---|
action | string | “CapturePayment” | Required |
invoiceid | int | 挂单ID | Required |
cvv | string | 正在尝试的卡的 CVV 编号 | Optional |
响应参数
参数 | 类型 | 说明 |
---|---|---|
result | string | 操作结果:成功或错误 |
示例请求 (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' => 'CapturePayment',
// See https://developers.whmcs.com/api/authentication
'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
'password' => 'SECRET_OR_HASHED_PASSWORD',
'invoiceid' => '1',
'responsetype' => 'json',
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
示例请求(本地 API)
$command = 'CapturePayment';
$postData = array(
'invoiceid' => '1',
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later
$results = localAPI($command, $postData, $adminUsername);
print_r($results);
示例响应 JSON
{
"result": "success"
}
错误响应
可能的错误条件响应包括:
- 未找到或未支付发票
- 付款尝试失败
相关用法
- PHP WHMCS CartTotalAdjustment用法及代码示例
- PHP CachingIterator __construct()用法及代码示例
- PHP CachingIterator getCache()用法及代码示例
- PHP CachingIterator current()用法及代码示例
- PHP WHMCS CalcAffiliateCommission用法及代码示例
- PHP CachingIterator key()用法及代码示例
- PHP CachingIterator setFlags()用法及代码示例
- PHP WHMCS CartSubdomainValidation用法及代码示例
- PHP WHMCS CartItemsTax用法及代码示例
- PHP CachingIterator next()用法及代码示例
- PHP CachingIterator rewind()用法及代码示例
- PHP WHMCS CancellationRequest用法及代码示例
- PHP CachingIterator getFlags()用法及代码示例
- PHP CachingIterator getInnerIterator()用法及代码示例
- PHP WHMCS CancelOrder用法及代码示例
- PHP WHMCS CancelAndRefundOrder用法及代码示例
- PHP WHMCS ClientAreaPageDownloads用法及代码示例
- PHP WHMCS ClientAreaHeaderOutput用法及代码示例
- PHP WHMCS CreateProject用法及代码示例
- PHP WHMCS ClientAreaPageSupportTickets用法及代码示例
- PHP WHMCS ClientAreaPageDomainDNSManagement用法及代码示例
- PHP WHMCS ClientAreaPageAffiliates用法及代码示例
- PHP WHMCS ClientAreaPageViewInvoice用法及代码示例
- PHP WHMCS ClientAreaPageProductsServices用法及代码示例
- PHP WHMCS CustomFieldSave用法及代码示例
注:本文由纯净天空筛选整理自whmcs.com大神的英文原创作品 CapturePayment。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。