-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(router): Move organization_id to request header from request bod…
…y for v2 (#6277) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Narayan Bhat <[email protected]>
- Loading branch information
1 parent
e36ea18
commit aaac9aa
Showing
10 changed files
with
101 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -453,6 +453,20 @@ | |
"summary": "Merchant Account - Create", | ||
"description": "Create a new account for a *merchant* and the *merchant* could be a seller or retailer or client who likes to receive and send payments.\n\nBefore creating the merchant account, it is mandatory to create an organization.", | ||
"operationId": "Create a Merchant Account", | ||
"parameters": [ | ||
{ | ||
"name": "X-Organization-Id", | ||
"in": "header", | ||
"description": "Organization ID for which the merchant account has to be created.", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": { | ||
"X-Organization-Id": "org_abcdefghijklmnop" | ||
} | ||
} | ||
], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
|
@@ -466,8 +480,7 @@ | |
"primary_contact_person": "John Doe", | ||
"primary_email": "[email protected]" | ||
}, | ||
"merchant_name": "Cloth Store", | ||
"organization_id": "org_abcdefghijklmnop" | ||
"merchant_name": "Cloth Store" | ||
} | ||
}, | ||
"Create a merchant account with metadata": { | ||
|
@@ -476,14 +489,12 @@ | |
"metadata": { | ||
"key_1": "John Doe", | ||
"key_2": "Trends" | ||
}, | ||
"organization_id": "org_abcdefghijklmnop" | ||
} | ||
} | ||
}, | ||
"Create a merchant account with minimal fields": { | ||
"value": { | ||
"merchant_name": "Cloth Store", | ||
"organization_id": "org_abcdefghijklmnop" | ||
"merchant_name": "Cloth Store" | ||
} | ||
} | ||
} | ||
|
@@ -9385,8 +9396,7 @@ | |
"MerchantAccountCreate": { | ||
"type": "object", | ||
"required": [ | ||
"merchant_name", | ||
"organization_id" | ||
"merchant_name" | ||
], | ||
"properties": { | ||
"merchant_name": { | ||
|
@@ -9407,13 +9417,6 @@ | |
"type": "object", | ||
"description": "Metadata is useful for storing additional, unstructured information about the merchant account.", | ||
"nullable": true | ||
}, | ||
"organization_id": { | ||
"type": "string", | ||
"description": "The id of the organization to which the merchant belongs to. Please use the organization endpoint to create an organization", | ||
"example": "org_q98uSGAYbjEwqs0mJwnz", | ||
"maxLength": 64, | ||
"minLength": 1 | ||
} | ||
}, | ||
"additionalProperties": false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,22 +51,27 @@ pub async fn merchant_account_create() {} | |
#[utoipa::path( | ||
post, | ||
path = "/v2/merchant_accounts", | ||
params( | ||
( | ||
"X-Organization-Id" = String, Header, | ||
description = "Organization ID for which the merchant account has to be created.", | ||
example = json!({"X-Organization-Id": "org_abcdefghijklmnop"}) | ||
), | ||
), | ||
request_body( | ||
content = MerchantAccountCreate, | ||
examples( | ||
( | ||
"Create a merchant account with minimal fields" = ( | ||
value = json!({ | ||
"merchant_name": "Cloth Store", | ||
"organization_id": "org_abcdefghijklmnop" | ||
}) | ||
) | ||
), | ||
( | ||
"Create a merchant account with merchant details" = ( | ||
value = json!({ | ||
"merchant_name": "Cloth Store", | ||
"organization_id": "org_abcdefghijklmnop", | ||
"merchant_details": { | ||
"primary_contact_person": "John Doe", | ||
"primary_email": "[email protected]" | ||
|
@@ -78,7 +83,6 @@ pub async fn merchant_account_create() {} | |
"Create a merchant account with metadata" = ( | ||
value = json!({ | ||
"merchant_name": "Cloth Store", | ||
"organization_id": "org_abcdefghijklmnop", | ||
"metadata": { | ||
"key_1": "John Doe", | ||
"key_2": "Trends" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters