From fcdc016564e4fe1bbbb619544f9728d3461b7f75 Mon Sep 17 00:00:00 2001 From: sai-harsha-vardhan Date: Sat, 2 Dec 2023 23:36:18 +0530 Subject: [PATCH] fix openapi --- crates/api_models/src/payments.rs | 1 + crates/router/src/openapi.rs | 2 ++ openapi/openapi_spec.json | 51 +++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 75fefe1c5e4c..13c1da248ac3 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -2295,6 +2295,7 @@ pub struct PaymentListResponse { pub struct AuthorizationResponse { pub authorization_id: String, pub amount: i64, + #[schema(value_type= AuthorizationStatus)] pub status: common_enums::AuthorizationStatus, pub code: Option, pub message: Option, diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs index cfb0268a9f80..bf76a658701e 100644 --- a/crates/router/src/openapi.rs +++ b/crates/router/src/openapi.rs @@ -175,6 +175,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::enums::CaptureStatus, api_models::enums::ReconStatus, api_models::enums::ConnectorStatus, + api_models::enums::AuthorizationStatus, api_models::admin::MerchantConnectorCreate, api_models::admin::MerchantConnectorUpdate, api_models::admin::PrimaryBusinessDetails, @@ -315,6 +316,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::RequestSurchargeDetails, api_models::payments::PaymentAttemptResponse, api_models::payments::CaptureResponse, + api_models::payments::AuthorizationResponse, api_models::payment_methods::RequiredFieldInfo, api_models::payment_methods::MaskedBankDetails, api_models::refunds::RefundListRequest, diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index f5ad99f05752..178386cd4780 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2888,6 +2888,43 @@ "no_three_ds" ] }, + "AuthorizationResponse": { + "type": "object", + "required": [ + "authorization_id", + "amount", + "status" + ], + "properties": { + "authorization_id": { + "type": "string" + }, + "amount": { + "type": "integer", + "format": "int64" + }, + "status": { + "$ref": "#/components/schemas/AuthorizationStatus" + }, + "code": { + "type": "string", + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + } + } + }, + "AuthorizationStatus": { + "type": "string", + "enum": [ + "success", + "failure", + "created", + "unresolved" + ] + }, "BacsBankTransfer": { "type": "object", "required": [ @@ -10533,6 +10570,20 @@ "type": "boolean", "description": "If true incremental authorization can be performed on this payment", "nullable": true + }, + "authorization_count": { + "type": "integer", + "format": "int32", + "description": "Total number of authorizations happened in an incremental_authorization payment", + "nullable": true + }, + "authorizations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuthorizationResponse" + }, + "description": "List of authorizations happened to the payment", + "nullable": true } } },