我是 OpenAPI 的新手,我需要一些帮助来为 PayPal 的支付 API创建一个基本的 swagger 文件,以便从我们的平台创建支付。注意:OAuth 已配置。
下面是一个基本的招摇文件,但我不知道在哪里将付款请求信息(即意图、付款人、交易等)添加到:
{
"swagger": "2.0",
"info": {
"description": "this is a payment request to through PayPal",
"title": "Swagger PayPal Payment",
"version": "1.0.0"
},
"host": "api.sandbox.paypal.com",
"basePath": "/v1/payments", //
"schemes": [ "https" ],
"paths": {
"/payment":
{
"post": {
"summary": "Creates a payment"
"description": "Creates a payment request to Paypal",
"parameters": {
},
//"intent": "sale",
//"payer":
//{
// "payment_method": "paypal"
//},
//"transactions": [
// {
// "amount": {
// "total": "9.00",
// "currency": "EUR"
// }
// }
//],
"responses": {
"200": {
"description": "OK"
}
}
}
}
}
}
在 editor.swagger 上测试文件时,我收到有关交易、付款人和意图的“OBJECT_ADDITIONAL_PROPERTIES”错误。