Skip to content

Commit

Permalink
fix openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-harsha-vardhan committed Dec 2, 2023
1 parent 9e97b46 commit fcdc016
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
pub message: Option<String>,
Expand Down
2 changes: 2 additions & 0 deletions crates/router/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
51 changes: 51 additions & 0 deletions openapi/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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
}
}
},
Expand Down

0 comments on commit fcdc016

Please sign in to comment.