PayPal MCP 服务器由 DynamicEndpoints 维护,为用户提供与 PayPal 支付相关的功能服务,可实现订单创建、发票生成、汇款处理等操作。
若你想使用本 PayPal MCP 服务器,可按以下步骤进行操作:
git clone https://github.com/your-repository.git
cd your-repository
npm install
node index.js
const result = await mcpClient.useTool('paypal', 'create_order', {
intent: 'CAPTURE',
purchase_units: [{
amount: {
currency_code: 'USD',
value: '100.00'
},
description: '高级订阅'
}]
});
const result = await mcpClient.useTool('paypal', 'create_invoice', {
invoice_number: 'INV-2024-001',
reference: 'REF-2024-001',
currency_code: 'USD',
recipient_email: 'customer@example.com',
items: [{
name: '咨询服务',
quantity: '1',
unit_amount: {
currency_code: 'USD',
value: '500.00'
}
}]
});
const result = await mcpClient.useTool('paypal', 'create_payout', {
sender_batch_header: {
sender_batch_id: 'PAY-2024_001',
email_subject: '您已收到款项'
},
items: [{
recipient_type: 'EMAIL',
amount: {
value: '1000.00',
currency: 'USD'
},
receiver: 'employee@example.com',
note: '月度工资支付'
}]
});
该服务器实现了全面的错误处理,涵盖输入验证错误(带有详细消息)、PayPal API 错误(包含响应详情)、网络和身份验证错误以及速率限制和超时处理。同时,在安全方面,所有敏感数据经过验证和清理,使用 PayPal 的 OAuth 2.0 身份验证,通过环境变量管理安全凭证,验证所有 API 参数,且错误消息不泄露敏感信息。
npm run build
npm test
服务器输出详细日志以帮助调试,可处理身份验证问题、API 调用失败、验证错误以及查看请求/响应详情。
git clone https://github.com/your-repository.git
cd your-repository
git checkout -b feature/your-feature
git add .
git commit -m '添加新功能'
git push origin feature/your-feature
本项目采用 MIT 许可证。