Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(openapi): Add x-mcp extension to v1 spec (#8443)
Anurag Thakura685f6b59cb9
diff --git a/README.md b/README.mdindex a46baab524..35964d72bf 100644--- a/README.md+++ b/README.md@@ -31,7 +31,7 @@<a href="https://x.com/hyperswitchio"><img src="https://img.shields.io/badge/follow-%40hyperswitchio-white?logo=x&labelColor=grey"/></a>- <a href="https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2jqxmpsbm-WXUENx022HjNEy~Ark7Orw">+ <a href="https://inviter.co/hyperswitch-slack"><img src="https://img.shields.io/badge/chat-on_slack-blue?logo=slack&labelColor=grey&color=%233f0e40"/></a></p>@@ -196,7 +196,7 @@ We welcome contributors from around the world to help build Hyperswitch. WhetherPlease read our [contributing guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md) to get started.-Join the conversation on [Slack](https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2jqxmpsbm-WXUENx022HjNEy~Ark7Orw) or explore open issues on [GitHub](https://github.com/juspay/hyperswitch/issues).+Join the conversation on [Slack](https://inviter.co/hyperswitch-slack) or explore open issues on [GitHub](https://github.com/juspay/hyperswitch/issues).<a href="#feature-requests"><h2 id="feature-requests">Feature requests & Bugs</h2>diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.jsonindex 38c60547d9..db3e58b896 100644--- a/api-reference/v1/openapi_spec_v1.json+++ b/api-reference/v1/openapi_spec_v1.json@@ -1,5 +1,8 @@{"openapi": "3.0.3",+ "x-mcp": {+ "enabled": true+ },"info": {"title": "Hyperswitch - API Documentation","description": "\n## Get started\n\nHyperswitch provides a collection of APIs that enable you to process and manage payments.\nOur APIs accept and return JSON in the HTTP body, and return standard HTTP response codes.\n\nYou can consume the APIs directly using your favorite HTTP/REST library.\n\nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without\naffecting production data.\nCurrently, our sandbox environment is live while our production environment is under development\nand will be available soon.\nYou can sign up on our Dashboard to get API keys to access Hyperswitch API.\n\n### Environment\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n|---------------|------------------------------------|\n| Sandbox | <https://sandbox.hyperswitch.io> |\n| Production | <https://api.hyperswitch.io> |\n\n## Authentication\n\nWhen you sign up on our [dashboard](https://app.hyperswitch.io) and create a merchant\naccount, you are given a secret key (also referred as api-key) and a publishable key.\nYou may authenticate all API requests with Hyperswitch server by providing the appropriate key in\nthe request Authorization header.\n\n| Key | Description |\n|-----------------|-----------------------------------------------------------------------------------------------|\n| api-key | Private key. Used to authenticate all API requests from your merchant server |\n| publishable key | Unique identifier for your account. Used to authenticate API requests from your app's client |\n\nNever share your secret api keys. Keep them guarded and secure.\n",diff --git a/api-reference/v1/payments/payment--flows.mdx b/api-reference/v1/payments/payment--flows.mdxindex eff90a0dcb..9338f835f3 100644--- a/api-reference/v1/payments/payment--flows.mdx+++ b/api-reference/v1/payments/payment--flows.mdx@@ -226,7 +226,9 @@ sequenceDiagram**Required Fields:**- `off_session: true`-- `recurring_details: { payment_method_id: "<from_setup>" }`+- `recurring_details: {+ "type": "payment_method_id",+ "data": "<from_setup>"}`**Use Case:** Subscription charges, scheduled billing without customer interactiondiff --git a/crates/openapi/src/main.rs b/crates/openapi/src/main.rsindex cf8158cfb0..d25b24442d 100644--- a/crates/openapi/src/main.rs+++ b/crates/openapi/src/main.rs@@ -29,13 +29,33 @@ fn main() {#[allow(clippy::expect_used)]#[cfg(any(feature = "v1", feature = "v2"))]std::fs::write(- file_path,+ &file_path,openapi.to_pretty_json().expect("Failed to serialize OpenAPI specification as JSON"),).expect("Failed to write OpenAPI specification to file");+ #[allow(clippy::expect_used)]+ #[cfg(feature = "v1")]+ {+ // TODO: Do this using utoipa::extensions after we have upgraded to 5.x+ let file_content =+ std::fs::read_to_string(&file_path).expect("Failed to read OpenAPI specification file");++ let mut lines: Vec<&str> = file_content.lines().collect();++ // Insert the new text at line 3 (index 2)+ if lines.len() > 2 {+ let new_line = " \"x-mcp\": {\n \"enabled\": true\n },";+ lines.insert(2, new_line);+ }++ let modified_content = lines.join("\n");+ std::fs::write(&file_path, modified_content)+ .expect("Failed to write modified OpenAPI specification to file");+ }+#[cfg(any(feature = "v1", feature = "v2"))]println!("Successfully saved OpenAPI specification file at '{relative_file_path}'");