Skip to content

Commit

Permalink
refactor: fix open api
Browse files Browse the repository at this point in the history
  • Loading branch information
swangi-kumari committed Dec 6, 2024
1 parent df3ec15 commit bb8ae08
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 84 deletions.
93 changes: 54 additions & 39 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -12229,35 +12229,6 @@
}
}
},
"PaymentChargeResponse": {
"type": "object",
"description": "Fee information to be charged on the payment being collected",
"required": [
"charge_type",
"application_fees",
"transfer_account_id"
],
"properties": {
"charge_id": {
"type": "string",
"description": "Identifier for charge created for the payment",
"nullable": true
},
"charge_type": {
"$ref": "#/components/schemas/PaymentChargeType"
},
"application_fees": {
"type": "integer",
"format": "int64",
"description": "Platform fees collected on the payment",
"example": 6540
},
"transfer_account_id": {
"type": "string",
"description": "Identifier for the reseller's account where the funds were transferred"
}
}
},
"PaymentChargeType": {
"oneOf": [
{
Expand Down Expand Up @@ -14785,10 +14756,10 @@
"example": "2022-09-10T10:11:12Z",
"nullable": true
},
"charges": {
"split_payments": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentChargeResponse"
"$ref": "#/components/schemas/SplitPaymentsResponse"
}
],
"nullable": true
Expand Down Expand Up @@ -15685,10 +15656,10 @@
"example": "2022-09-10T10:11:12Z",
"nullable": true
},
"charges": {
"split_payments": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentChargeResponse"
"$ref": "#/components/schemas/SplitPaymentsResponse"
}
],
"nullable": true
Expand Down Expand Up @@ -17995,7 +17966,7 @@
"split_refunds": {
"allOf": [
{
"$ref": "#/components/schemas/SplitRefundRequest"
"$ref": "#/components/schemas/SplitRefund"
}
],
"nullable": true
Expand Down Expand Up @@ -19621,22 +19592,37 @@
],
"properties": {
"stripe_split_payment": {
"$ref": "#/components/schemas/StripeSplitPayment"
"$ref": "#/components/schemas/StripeSplitPaymentRequest"
}
}
}
],
"description": "Fee information for Split Payments to be charged on the payment being collected"
},
"SplitRefundRequest": {
"SplitPaymentsResponse": {
"oneOf": [
{
"type": "object",
"required": [
"stripe_split_refund_request"
"stripe_split_payment"
],
"properties": {
"stripe_split_refund_request": {
"stripe_split_payment": {
"$ref": "#/components/schemas/StripeSplitPaymentsResponse"
}
}
}
]
},
"SplitRefund": {
"oneOf": [
{
"type": "object",
"required": [
"stripe_split_refund"
],
"properties": {
"stripe_split_refund": {
"$ref": "#/components/schemas/StripeSplitRefundRequest"
}
}
Expand Down Expand Up @@ -19721,7 +19707,7 @@
"destination"
]
},
"StripeSplitPayment": {
"StripeSplitPaymentRequest": {
"type": "object",
"description": "Fee information for Split Payments to be charged on the payment being collected for Stripe",
"required": [
Expand All @@ -19746,6 +19732,35 @@
},
"additionalProperties": false
},
"StripeSplitPaymentsResponse": {
"type": "object",
"description": "Fee information to be charged on the payment being collected",
"required": [
"charge_type",
"application_fees",
"transfer_account_id"
],
"properties": {
"charge_id": {
"type": "string",
"description": "Identifier for charge created for the payment",
"nullable": true
},
"charge_type": {
"$ref": "#/components/schemas/PaymentChargeType"
},
"application_fees": {
"type": "integer",
"format": "int64",
"description": "Platform fees collected on the payment",
"example": 6540
},
"transfer_account_id": {
"type": "string",
"description": "Identifier for the reseller's account where the funds were transferred"
}
}
},
"StripeSplitRefundRequest": {
"type": "object",
"description": "Charge specific fields for controlling the revert of funds from either platform or connected account for Stripe. Check sub-fields for more details.",
Expand Down
97 changes: 56 additions & 41 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -15086,35 +15086,6 @@
}
}
},
"PaymentChargeResponse": {
"type": "object",
"description": "Fee information to be charged on the payment being collected",
"required": [
"charge_type",
"application_fees",
"transfer_account_id"
],
"properties": {
"charge_id": {
"type": "string",
"description": "Identifier for charge created for the payment",
"nullable": true
},
"charge_type": {
"$ref": "#/components/schemas/PaymentChargeType"
},
"application_fees": {
"type": "integer",
"format": "int64",
"description": "Platform fees collected on the payment",
"example": 6540
},
"transfer_account_id": {
"type": "string",
"description": "Identifier for the reseller's account where the funds were transferred"
}
}
},
"PaymentChargeType": {
"oneOf": [
{
Expand Down Expand Up @@ -17951,10 +17922,10 @@
"example": "2022-09-10T10:11:12Z",
"nullable": true
},
"charges": {
"split_payments": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentChargeResponse"
"$ref": "#/components/schemas/SplitPaymentsResponse"
}
],
"nullable": true
Expand Down Expand Up @@ -19179,10 +19150,10 @@
"example": "2022-09-10T10:11:12Z",
"nullable": true
},
"charges": {
"split_payments": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentChargeResponse"
"$ref": "#/components/schemas/SplitPaymentsResponse"
}
],
"nullable": true
Expand Down Expand Up @@ -22266,7 +22237,7 @@
"split_refunds": {
"allOf": [
{
"$ref": "#/components/schemas/SplitRefundRequest"
"$ref": "#/components/schemas/SplitRefund"
}
],
"nullable": true
Expand Down Expand Up @@ -22354,10 +22325,10 @@
"description": "The merchant_connector_id of the processor through which this payment went through",
"nullable": true
},
"charges": {
"split_refunds": {
"allOf": [
{
"$ref": "#/components/schemas/ChargeRefunds"
"$ref": "#/components/schemas/SplitRefund"
}
],
"nullable": true
Expand Down Expand Up @@ -23822,22 +23793,37 @@
],
"properties": {
"stripe_split_payment": {
"$ref": "#/components/schemas/StripeSplitPayment"
"$ref": "#/components/schemas/StripeSplitPaymentRequest"
}
}
}
],
"description": "Fee information for Split Payments to be charged on the payment being collected"
},
"SplitRefundRequest": {
"SplitPaymentsResponse": {
"oneOf": [
{
"type": "object",
"required": [
"stripe_split_payment"
],
"properties": {
"stripe_split_payment": {
"$ref": "#/components/schemas/StripeSplitPaymentsResponse"
}
}
}
]
},
"SplitRefund": {
"oneOf": [
{
"type": "object",
"required": [
"stripe_split_refund_request"
"stripe_split_refund"
],
"properties": {
"stripe_split_refund_request": {
"stripe_split_refund": {
"$ref": "#/components/schemas/StripeSplitRefundRequest"
}
}
Expand Down Expand Up @@ -23922,7 +23908,7 @@
"destination"
]
},
"StripeSplitPayment": {
"StripeSplitPaymentRequest": {
"type": "object",
"description": "Fee information for Split Payments to be charged on the payment being collected for Stripe",
"required": [
Expand All @@ -23947,6 +23933,35 @@
},
"additionalProperties": false
},
"StripeSplitPaymentsResponse": {
"type": "object",
"description": "Fee information to be charged on the payment being collected",
"required": [
"charge_type",
"application_fees",
"transfer_account_id"
],
"properties": {
"charge_id": {
"type": "string",
"description": "Identifier for charge created for the payment",
"nullable": true
},
"charge_type": {
"$ref": "#/components/schemas/PaymentChargeType"
},
"application_fees": {
"type": "integer",
"format": "int64",
"description": "Platform fees collected on the payment",
"example": 6540
},
"transfer_account_id": {
"type": "string",
"description": "Identifier for the reseller's account where the funds were transferred"
}
}
},
"StripeSplitRefundRequest": {
"type": "object",
"description": "Charge specific fields for controlling the revert of funds from either platform or connected account for Stripe. Check sub-fields for more details.",
Expand Down
4 changes: 2 additions & 2 deletions crates/api_models/src/refunds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct RefundRequest {
pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,

/// Charge specific fields for controlling the revert of funds from either platform or connected account
#[schema(value_type = Option<SplitRefundRequest>)]
#[schema(value_type = Option<SplitRefund>)]
pub split_refunds: Option<SplitRefund>,
}

Expand Down Expand Up @@ -204,7 +204,7 @@ pub struct RefundResponse {
#[schema(value_type = Option<String>)]
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
/// Charge specific fields for controlling the revert of funds from either platform or connected account
#[schema(value_type = Option<SplitRefundRequest>,)]
#[schema(value_type = Option<SplitRefund>,)]
pub split_refunds: Option<SplitRefund>,
}

Expand Down
4 changes: 3 additions & 1 deletion crates/openapi/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ Never share your secret api keys. Keep them guarded and secure.
common_utils::types::SplitPaymentsRequest,
common_utils::types::StripeSplitPaymentRequest,
common_utils::types::ChargeRefunds,
common_utils::types::SplitRefund,
common_utils::types::StripeSplitRefundRequest,
api_models::payments::SplitPaymentsResponse,
api_models::payments::StripeSplitPaymentsResponse,
api_models::refunds::RefundRequest,
api_models::refunds::RefundType,
api_models::refunds::RefundResponse,
Expand Down Expand Up @@ -617,7 +620,6 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::WebhookDeliveryAttempt,
api_models::enums::PaymentChargeType,
api_models::enums::StripeChargeType,
api_models::refunds::SplitRefundRequest,
api_models::payments::CustomerDetailsResponse,
api_models::payments::OpenBankingData,
api_models::payments::OpenBankingSessionToken,
Expand Down
4 changes: 3 additions & 1 deletion crates/openapi/src/openapi_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ Never share your secret api keys. Keep them guarded and secure.
common_utils::types::StripeSplitPaymentRequest,
common_utils::types::StripeSplitRefundRequest,
common_utils::types::ChargeRefunds,
common_utils::types::SplitRefund,
api_models::payments::SplitPaymentsResponse,
api_models::payments::StripeSplitPaymentsResponse,
api_models::refunds::RefundRequest,
api_models::refunds::RefundsCreateRequest,
api_models::refunds::RefundErrorDetails,
Expand Down Expand Up @@ -581,7 +584,6 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::WebhookDeliveryAttempt,
api_models::enums::PaymentChargeType,
api_models::enums::StripeChargeType,
api_models::refunds::SplitRefundRequest,
api_models::payments::CustomerDetailsResponse,
api_models::payments::OpenBankingData,
api_models::payments::OpenBankingSessionToken,
Expand Down

0 comments on commit bb8ae08

Please sign in to comment.