接入教程
1. 联系Adyen获取API凭证和密钥
2. 在请求头中添加X-API-Key
3. 调用API创建用户账户
4. 管理余额账户、卡片或企业账户
5. 测试并部署平台
使用Python创建余额账户
python
import requests
url = 'https://api.example.com/balanceAccounts'
headers = {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
payload = {
'accountHolderId': 'AH123456789',
'description': 'Primary balance account'
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
使用PHP获取账户持有者信息
php
<?php
$url = 'https://api.example.com/accountHolders/AH123456789';
$options = [
'http' => [
'header' => "X-API-Key: YOUR_API_KEY\r\n",
'method' => 'GET'
]
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
echo $response;
?>
使用JavaScript列出卡片
javascript
const url = 'https://api.example.com/cards';
const options = {
method: 'GET',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
常见问题
如何获取API密钥?
您的Adyen联系人将提供API凭据和API密钥。请妥善保管,不要在客户端代码中暴露。
API请求需要哪些认证头信息?
每个请求必须在HTTP头中包含'X-API-Key',其值为您的API密钥。
这个API支持哪些主要功能?
配置API支持创建和管理账户持有者、余额账户、卡片及企业账户,适用于平台用户入驻。
Aitishiku.com