Skip to content

Commit

Permalink
feat(router): add endpoint for listing connector features (#6612)
Browse files Browse the repository at this point in the history
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Pa1NarK <[email protected]>
  • Loading branch information
3 people authored Dec 24, 2024
1 parent 5e4eded commit a423ff5
Show file tree
Hide file tree
Showing 124 changed files with 1,490 additions and 252 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

132 changes: 132 additions & 0 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -6700,6 +6700,43 @@
"zsl"
]
},
"ConnectorFeatureMatrixResponse": {
"type": "object",
"required": [
"name",
"supported_payment_methods"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"category": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentConnectorCategory"
}
],
"nullable": true
},
"supported_payment_methods": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SupportedPaymentMethod"
}
},
"supported_webhook_flows": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EventClass"
},
"nullable": true
}
}
},
"ConnectorMetadata": {
"type": "object",
"description": "Some connectors like Apple Pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.",
Expand Down Expand Up @@ -8672,6 +8709,38 @@
}
}
},
"FeatureMatrixListResponse": {
"type": "object",
"required": [
"connector_count",
"connectors"
],
"properties": {
"connector_count": {
"type": "integer",
"description": "The number of connectors included in the response",
"minimum": 0
},
"connectors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ConnectorFeatureMatrixResponse"
}
}
}
},
"FeatureMatrixRequest": {
"type": "object",
"properties": {
"connectors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Connector"
},
"nullable": true
}
}
},
"FeatureMetadata": {
"type": "object",
"description": "additional data that might be required by hyperswitch",
Expand Down Expand Up @@ -8702,6 +8771,14 @@
}
}
},
"FeatureStatus": {
"type": "string",
"description": "The status of the feature",
"enum": [
"not_supported",
"supported"
]
},
"FieldType": {
"oneOf": [
{
Expand Down Expand Up @@ -12746,6 +12823,15 @@
}
]
},
"PaymentConnectorCategory": {
"type": "string",
"description": "Connector Access Method",
"enum": [
"payment_gateway",
"alternative_payment_method",
"bank_acquirer"
]
},
"PaymentCreatePaymentLinkConfig": {
"allOf": [
{
Expand Down Expand Up @@ -20591,6 +20677,52 @@
},
"additionalProperties": false
},
"SupportedPaymentMethod": {
"type": "object",
"required": [
"payment_method",
"payment_method_type",
"mandates",
"refunds",
"supported_capture_methods"
],
"properties": {
"payment_method": {
"$ref": "#/components/schemas/PaymentMethod"
},
"payment_method_type": {
"$ref": "#/components/schemas/PaymentMethodType"
},
"mandates": {
"$ref": "#/components/schemas/FeatureStatus"
},
"refunds": {
"$ref": "#/components/schemas/FeatureStatus"
},
"supported_capture_methods": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CaptureMethod"
}
},
"supported_countries": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CountryAlpha2"
},
"uniqueItems": true,
"nullable": true
},
"supported_currencies": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Currency"
},
"uniqueItems": true,
"nullable": true
}
}
},
"SurchargeCalculationOverride": {
"type": "string",
"enum": [
Expand Down
132 changes: 132 additions & 0 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -9319,6 +9319,43 @@
"zsl"
]
},
"ConnectorFeatureMatrixResponse": {
"type": "object",
"required": [
"name",
"supported_payment_methods"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"category": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentConnectorCategory"
}
],
"nullable": true
},
"supported_payment_methods": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SupportedPaymentMethod"
}
},
"supported_webhook_flows": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EventClass"
},
"nullable": true
}
}
},
"ConnectorMetadata": {
"type": "object",
"description": "Some connectors like Apple Pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.",
Expand Down Expand Up @@ -11269,6 +11306,38 @@
}
}
},
"FeatureMatrixListResponse": {
"type": "object",
"required": [
"connector_count",
"connectors"
],
"properties": {
"connector_count": {
"type": "integer",
"description": "The number of connectors included in the response",
"minimum": 0
},
"connectors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ConnectorFeatureMatrixResponse"
}
}
}
},
"FeatureMatrixRequest": {
"type": "object",
"properties": {
"connectors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Connector"
},
"nullable": true
}
}
},
"FeatureMetadata": {
"type": "object",
"description": "additional data that might be required by hyperswitch",
Expand Down Expand Up @@ -11299,6 +11368,14 @@
}
}
},
"FeatureStatus": {
"type": "string",
"description": "The status of the feature",
"enum": [
"not_supported",
"supported"
]
},
"FieldType": {
"oneOf": [
{
Expand Down Expand Up @@ -15782,6 +15859,15 @@
}
]
},
"PaymentConnectorCategory": {
"type": "string",
"description": "Connector Access Method",
"enum": [
"payment_gateway",
"alternative_payment_method",
"bank_acquirer"
]
},
"PaymentCreatePaymentLinkConfig": {
"allOf": [
{
Expand Down Expand Up @@ -25077,6 +25163,52 @@
}
}
},
"SupportedPaymentMethod": {
"type": "object",
"required": [
"payment_method",
"payment_method_type",
"mandates",
"refunds",
"supported_capture_methods"
],
"properties": {
"payment_method": {
"$ref": "#/components/schemas/PaymentMethod"
},
"payment_method_type": {
"$ref": "#/components/schemas/PaymentMethodType"
},
"mandates": {
"$ref": "#/components/schemas/FeatureStatus"
},
"refunds": {
"$ref": "#/components/schemas/FeatureStatus"
},
"supported_capture_methods": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CaptureMethod"
}
},
"supported_countries": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CountryAlpha2"
},
"uniqueItems": true,
"nullable": true
},
"supported_currencies": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Currency"
},
"uniqueItems": true,
"nullable": true
}
}
},
"SurchargeDetailsResponse": {
"type": "object",
"required": [
Expand Down
4 changes: 4 additions & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ seicomart = { country = "JP", currency = "JPY" }
pay_easy = { country = "JP", currency = "JPY" }
boleto = { country = "BR", currency = "BRL" }

[pm_filters.bambora]
credit = { country = "US,CA", currency = "USD" }
debit = { country = "US,CA", currency = "USD" }

[pm_filters.volt]
open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "EUR,GBP,DKK,NOK,PLN,SEK,AUD,BRL" }

Expand Down
4 changes: 4 additions & 0 deletions config/deployments/integration_test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ we_chat_pay = { country = "AU,NZ,CN,JP,HK,SG,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK
google_pay.currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"
paypal.currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"

[pm_filters.bambora]
credit = { country = "US,CA", currency = "USD" }
debit = { country = "US,CA", currency = "USD" }

[pm_filters.bankofamerica]
credit = { currency = "USD" }
debit = { currency = "USD" }
Expand Down
4 changes: 4 additions & 0 deletions config/deployments/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ we_chat_pay = { country = "AU,NZ,CN,JP,HK,SG,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK
google_pay.currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"
paypal.currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"

[pm_filters.bambora]
credit = { country = "US,CA", currency = "USD" }
debit = { country = "US,CA", currency = "USD" }

[pm_filters.bankofamerica]
credit = { currency = "USD" }
debit = { currency = "USD" }
Expand Down
4 changes: 4 additions & 0 deletions config/deployments/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ pix = { country = "BR", currency = "BRL" }
google_pay.currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"
paypal.currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD"

[pm_filters.bambora]
credit = { country = "US,CA", currency = "USD" }
debit = { country = "US,CA", currency = "USD" }

[pm_filters.bankofamerica]
credit = { currency = "USD" }
debit = { currency = "USD" }
Expand Down
4 changes: 4 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ pay_easy = { country = "JP", currency = "JPY" }
pix = { country = "BR", currency = "BRL" }
boleto = { country = "BR", currency = "BRL" }

[pm_filters.bambora]
credit = { country = "US,CA", currency = "USD" }
debit = { country = "US,CA", currency = "USD" }

[pm_filters.bankofamerica]
credit = { currency = "USD" }
debit = { currency = "USD" }
Expand Down
Loading

0 comments on commit a423ff5

Please sign in to comment.