Skip to content

Commit 8e9bad6

Browse files
feat(router): Add support for Proxy api (#7901)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
1 parent 8b0fd04 commit 8e9bad6

File tree

22 files changed

+707
-34
lines changed

22 files changed

+707
-34
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
openapi: post /proxy
3+
---

api-reference-v2/mint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@
142142
{
143143
"group": "Refunds",
144144
"pages": ["api-reference/refunds/refunds--create"]
145+
},
146+
{
147+
"group": "Proxy",
148+
"pages": ["api-reference/proxy/proxy"]
145149
}
146150
],
147151
"footerSocials": {

api-reference-v2/openapi_spec.json

Lines changed: 197 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@
863863
],
864864
"summary": "Profile - Connector Accounts List",
865865
"description": "List Connector Accounts for the profile",
866-
"operationId": "List all Merchant Connectors",
866+
"operationId": "List all Merchant Connectors for Profile",
867867
"parameters": [
868868
{
869869
"name": "id",
@@ -2151,7 +2151,7 @@
21512151
],
21522152
"summary": "Payments - Session token",
21532153
"description": "Creates a session object or a session token for wallets like Apple Pay, Google Pay, etc. These tokens are used by Hyperswitch's SDK to initiate these wallets' SDK.",
2154-
"operationId": "Create Session tokens for a Payment",
2154+
"operationId": "Create V2 Session tokens for a Payment",
21552155
"parameters": [
21562156
{
21572157
"name": "payment_id",
@@ -2921,7 +2921,7 @@
29212921
]
29222922
}
29232923
},
2924-
"/v2/payment-method-session/:id": {
2924+
"/v2/payment-method-session/{id}": {
29252925
"get": {
29262926
"tags": [
29272927
"Payment Method Session"
@@ -3018,7 +3018,7 @@
30183018
]
30193019
}
30203020
},
3021-
"/v2/payment-method-session/:id/list-payment-methods": {
3021+
"/v2/payment-method-session/{id}/list-payment-methods": {
30223022
"get": {
30233023
"tags": [
30243024
"Payment Method Session"
@@ -3059,7 +3059,7 @@
30593059
]
30603060
}
30613061
},
3062-
"/v2/payment-method-session/:id/update-saved-payment-method": {
3062+
"/v2/payment-method-session/{id}/update-saved-payment-method": {
30633063
"put": {
30643064
"tags": [
30653065
"Payment Method Session"
@@ -3122,7 +3122,7 @@
31223122
]
31233123
}
31243124
},
3125-
"/v2/payment-method-session/:id/confirm": {
3125+
"/v2/payment-method-session/{id}/confirm": {
31263126
"post": {
31273127
"tags": [
31283128
"Payment Method Session"
@@ -3450,6 +3450,88 @@
34503450
}
34513451
]
34523452
}
3453+
},
3454+
"/proxy": {
3455+
"post": {
3456+
"tags": [
3457+
"Proxy"
3458+
],
3459+
"summary": "Proxy",
3460+
"description": "Create a proxy request",
3461+
"operationId": "Proxy Request",
3462+
"parameters": [
3463+
{
3464+
"name": "X-Profile-Id",
3465+
"in": "header",
3466+
"description": "Profile ID for authentication",
3467+
"required": true,
3468+
"schema": {
3469+
"type": "string"
3470+
}
3471+
}
3472+
],
3473+
"requestBody": {
3474+
"content": {
3475+
"application/json": {
3476+
"schema": {
3477+
"$ref": "#/components/schemas/ProxyRequest"
3478+
},
3479+
"examples": {
3480+
"Create a proxy request": {
3481+
"value": {
3482+
"destination_url": "https://api.example.com/payments",
3483+
"headers": {
3484+
"Authorization": "Bearer sk_test_example",
3485+
"Content-Type": "application/json"
3486+
},
3487+
"method": "POST",
3488+
"request_body": {
3489+
"amount": 6540,
3490+
"capture": true,
3491+
"currency": "USD",
3492+
"reference": "ORD-5023-4E89",
3493+
"source": {
3494+
"billing_address": {
3495+
"address_line1": "123 High St.",
3496+
"city": "London",
3497+
"country": "GB"
3498+
},
3499+
"expiry_month": "{{$card_exp_month}}",
3500+
"expiry_year": "{{$card_exp_year}}",
3501+
"number": "{{$card_number}}",
3502+
"type": "card"
3503+
}
3504+
},
3505+
"token": "pm_0196ea5a42a67583863d5b1253d62931",
3506+
"token_type": "PaymentMethodId"
3507+
}
3508+
}
3509+
}
3510+
}
3511+
},
3512+
"required": true
3513+
},
3514+
"responses": {
3515+
"200": {
3516+
"description": "Proxy request",
3517+
"content": {
3518+
"application/json": {
3519+
"schema": {
3520+
"$ref": "#/components/schemas/ProxyResponse"
3521+
}
3522+
}
3523+
}
3524+
},
3525+
"400": {
3526+
"description": "Invalid data"
3527+
}
3528+
},
3529+
"security": [
3530+
{
3531+
"api_key": []
3532+
}
3533+
]
3534+
}
34533535
}
34543536
},
34553537
"components": {
@@ -7929,6 +8011,7 @@
79298011
"aci",
79308012
"adyen",
79318013
"airwallex",
8014+
"archipel",
79328015
"authorizedotnet",
79338016
"bambora",
79348017
"bamboraapac",
@@ -13184,6 +13267,16 @@
1318413267
}
1318513268
}
1318613269
},
13270+
"Method": {
13271+
"type": "string",
13272+
"enum": [
13273+
"GET",
13274+
"POST",
13275+
"PUT",
13276+
"DELETE",
13277+
"PATCH"
13278+
]
13279+
},
1318713280
"MifinityData": {
1318813281
"type": "object",
1318913282
"required": [
@@ -13804,7 +13897,8 @@
1380413897
"trigger_api",
1380513898
"display_bank_transfer_information",
1380613899
"display_wait_screen",
13807-
"collect_otp"
13900+
"collect_otp",
13901+
"redirect_inside_popup"
1380813902
]
1380913903
},
1381013904
"NoThirdPartySdkSessionResponse": {
@@ -14131,6 +14225,9 @@
1413114225
},
1413214226
"OrganizationUpdateRequest": {
1413314227
"type": "object",
14228+
"required": [
14229+
"platform_merchant_id"
14230+
],
1413414231
"properties": {
1413514232
"organization_name": {
1413614233
"type": "string",
@@ -14148,12 +14245,8 @@
1414814245
"nullable": true
1414914246
},
1415014247
"platform_merchant_id": {
14151-
"allOf": [
14152-
{
14153-
"$ref": "#/components/schemas/id_type.MerchantId"
14154-
}
14155-
],
14156-
"nullable": true
14248+
"type": "string",
14249+
"description": "Platform merchant id is unique distiguisher for special merchant in the platform org"
1415714250
}
1415814251
},
1415914252
"additionalProperties": false
@@ -18098,6 +18191,11 @@
1809818191
"type": "boolean",
1809918192
"description": "Indicates if 3ds challenge is forced",
1810018193
"nullable": true
18194+
},
18195+
"is_iframe_redirection_enabled": {
18196+
"type": "boolean",
18197+
"description": "Indicates if the redirection has to open in the iframe",
18198+
"nullable": true
1810118199
}
1810218200
},
1810318201
"additionalProperties": false
@@ -18269,6 +18367,11 @@
1826918367
],
1827018368
"default": "no_three_ds",
1827118369
"nullable": true
18370+
},
18371+
"is_iframe_redirection_enabled": {
18372+
"type": "boolean",
18373+
"description": "Indicates if the redirection has to open in the iframe",
18374+
"nullable": true
1827218375
}
1827318376
}
1827418377
},
@@ -20071,6 +20174,11 @@
2007120174
],
2007220175
"nullable": true
2007320176
},
20177+
"is_iframe_redirection_enabled": {
20178+
"type": "boolean",
20179+
"description": "Indicates if the redirection has to open in the iframe",
20180+
"nullable": true
20181+
},
2007420182
"is_external_vault_enabled": {
2007520183
"type": "boolean",
2007620184
"description": "Indicates if external vault is enabled or not.",
@@ -20334,6 +20442,11 @@
2033420442
],
2033520443
"nullable": true
2033620444
},
20445+
"is_iframe_redirection_enabled": {
20446+
"type": "boolean",
20447+
"description": "Indicates if the redirection has to open in the iframe",
20448+
"nullable": true
20449+
},
2033720450
"is_external_vault_enabled": {
2033820451
"type": "boolean",
2033920452
"description": "Indicates if external vault is enabled or not.",
@@ -20370,6 +20483,64 @@
2037020483
}
2037120484
}
2037220485
},
20486+
"ProxyRequest": {
20487+
"type": "object",
20488+
"required": [
20489+
"request_body",
20490+
"destination_url",
20491+
"headers",
20492+
"method",
20493+
"token",
20494+
"token_type"
20495+
],
20496+
"properties": {
20497+
"request_body": {
20498+
"description": "The request body that needs to be forwarded"
20499+
},
20500+
"destination_url": {
20501+
"type": "string",
20502+
"description": "The destination URL where the request needs to be forwarded",
20503+
"example": "https://api.example.com/endpoint"
20504+
},
20505+
"headers": {
20506+
"type": "object",
20507+
"description": "The headers that need to be forwarded"
20508+
},
20509+
"method": {
20510+
"$ref": "#/components/schemas/Method"
20511+
},
20512+
"token": {
20513+
"type": "string",
20514+
"description": "The vault token that is used to fetch sensitive data from the vault"
20515+
},
20516+
"token_type": {
20517+
"$ref": "#/components/schemas/TokenType"
20518+
}
20519+
}
20520+
},
20521+
"ProxyResponse": {
20522+
"type": "object",
20523+
"required": [
20524+
"response",
20525+
"status_code",
20526+
"response_headers"
20527+
],
20528+
"properties": {
20529+
"response": {
20530+
"description": "The response received from the destination"
20531+
},
20532+
"status_code": {
20533+
"type": "integer",
20534+
"format": "int32",
20535+
"description": "The status code of the response",
20536+
"minimum": 0
20537+
},
20538+
"response_headers": {
20539+
"type": "object",
20540+
"description": "The headers of the response"
20541+
}
20542+
}
20543+
},
2037320544
"PspTokenization": {
2037420545
"type": "object",
2037520546
"description": "The Payment Service Provider Configuration for payment methods that are created using the payment method session",
@@ -20614,19 +20785,18 @@
2061420785
},
2061520786
{
2061620787
"type": "object",
20788+
"required": [
20789+
"refund_id"
20790+
],
2061720791
"properties": {
2061820792
"payment_id": {
2061920793
"type": "string",
2062020794
"description": "The identifier for the payment",
2062120795
"nullable": true
2062220796
},
2062320797
"refund_id": {
20624-
"allOf": [
20625-
{
20626-
"$ref": "#/components/schemas/common_utils.id_type.GlobalRefundId"
20627-
}
20628-
],
20629-
"nullable": true
20798+
"type": "string",
20799+
"description": "The identifier for the refund"
2063020800
},
2063120801
"limit": {
2063220802
"type": "integer",
@@ -21415,6 +21585,7 @@
2141521585
"aci",
2141621586
"adyen",
2141721587
"airwallex",
21588+
"archipel",
2141821589
"authorizedotnet",
2141921590
"bankofamerica",
2142021591
"billwerk",
@@ -23093,6 +23264,13 @@
2309323264
}
2309423265
]
2309523266
},
23267+
"TokenType": {
23268+
"type": "string",
23269+
"enum": [
23270+
"tokenization_id",
23271+
"payment_method_id"
23272+
]
23273+
},
2309623274
"TokenizationType": {
2309723275
"type": "string",
2309823276
"description": "The type of tokenization to use for the payment method",

api-reference/openapi_spec.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,16 @@
622622
"description": "To list the *payments*",
623623
"operationId": "List all Payments",
624624
"parameters": [
625+
{
626+
"name": "customer_id",
627+
"in": "query",
628+
"description": "The identifier for the customer",
629+
"required": false,
630+
"schema": {
631+
"type": "string",
632+
"nullable": true
633+
}
634+
},
625635
{
626636
"name": "starting_after",
627637
"in": "query",

0 commit comments

Comments
 (0)