Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch into refactor-cu…
Browse files Browse the repository at this point in the history
…stomer-pm-list
  • Loading branch information
Sarthak1799 committed Jul 30, 2024
2 parents 5328c9f + a791391 commit 300b09a
Show file tree
Hide file tree
Showing 31 changed files with 807 additions and 164 deletions.
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,47 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 2024.07.30.0

### Features

- Add env variable for enable key manager service ([#5442](https://github.com/juspay/hyperswitch/pull/5442)) ([`db26d32`](https://github.com/juspay/hyperswitch/commit/db26d32d8465e20cf3835fbfe6d0a19688078b8c))

### Refactors

- **router:** Remove `connector_account_details` and `connector_webhook_details` in merchant_connector_account list response ([#5457](https://github.com/juspay/hyperswitch/pull/5457)) ([`45a1494`](https://github.com/juspay/hyperswitch/commit/45a149418f1dad0cd27f975dc3dd56c68172b9dd))

**Full Changelog:** [`2024.07.29.0...2024.07.30.0`](https://github.com/juspay/hyperswitch/compare/2024.07.29.0...2024.07.30.0)

- - -

## 2024.07.29.0

### Features

- **connector:**
- [FISERV] Move connector to hyperswitch_connectors ([#5441](https://github.com/juspay/hyperswitch/pull/5441)) ([`2bee694`](https://github.com/juspay/hyperswitch/commit/2bee694d5bb7393c11817bbee26b459609f6dd8c))
- [Bambora APAC] add mandate flow ([#5376](https://github.com/juspay/hyperswitch/pull/5376)) ([`dbfa006`](https://github.com/juspay/hyperswitch/commit/dbfa006b475736bf415588680d7fc1a16bf16891))
- **payments:** Support sort criteria in payments list ([#5389](https://github.com/juspay/hyperswitch/pull/5389)) ([`043ea6d`](https://github.com/juspay/hyperswitch/commit/043ea6d8dc9fe8108e0b7eb8113217bc37fa488a))

### Bug Fixes

- Added created at and modified at keys in PaymentAttemptResponse ([#5412](https://github.com/juspay/hyperswitch/pull/5412)) ([`9795397`](https://github.com/juspay/hyperswitch/commit/979539702190363c67045d509be04498efd9a1fa))

### Refactors

- **connector:** Add amount conversion framework to placetopay ([#4988](https://github.com/juspay/hyperswitch/pull/4988)) ([`08334da`](https://github.com/juspay/hyperswitch/commit/08334dae82145e1fd699e0008fedcbd8bb7b23c7))
- **merchant_account_v2:** Recreate id for `merchant_account` v2 ([#5439](https://github.com/juspay/hyperswitch/pull/5439)) ([`93976db`](https://github.com/juspay/hyperswitch/commit/93976db30a91b3e67d854681fb4b9db8eea7e295))
- **opensearch:** Add Error Handling for Empty Query and Filters in Request ([#5432](https://github.com/juspay/hyperswitch/pull/5432)) ([`b60933e`](https://github.com/juspay/hyperswitch/commit/b60933e310abb4ee56355f28dfb56d9c60083f04))

### Miscellaneous Tasks

- Address Rust 1.80 clippy lints ([#5447](https://github.com/juspay/hyperswitch/pull/5447)) ([`074e90c`](https://github.com/juspay/hyperswitch/commit/074e90c9f9fbc26255ed27400a6a781aa6958339))

**Full Changelog:** [`2024.07.26.0...2024.07.29.0`](https://github.com/juspay/hyperswitch/compare/2024.07.26.0...2024.07.29.0)

- - -

## 2024.07.26.0

### Features
Expand Down
152 changes: 151 additions & 1 deletion api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MerchantConnectorResponse"
"$ref": "#/components/schemas/MerchantConnectorListResponse"
}
}
}
Expand Down Expand Up @@ -12033,6 +12033,156 @@
}
}
},
"MerchantConnectorListResponse": {
"type": "object",
"required": [
"connector_type",
"connector_name",
"merchant_connector_id",
"status"
],
"properties": {
"connector_type": {
"$ref": "#/components/schemas/ConnectorType"
},
"connector_name": {
"$ref": "#/components/schemas/Connector"
},
"connector_label": {
"type": "string",
"description": "A unique label to identify the connector account created under a business profile",
"example": "stripe_US_travel",
"nullable": true
},
"merchant_connector_id": {
"type": "string",
"description": "Unique ID of the merchant connector account",
"example": "mca_5apGeP94tMts6rg3U3kR"
},
"profile_id": {
"type": "string",
"description": "Identifier for the business profile, if not provided default will be chosen from merchant account",
"nullable": true,
"maxLength": 64
},
"payment_methods_enabled": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PaymentMethodsEnabled"
},
"description": "An object containing the details about the payment methods that need to be enabled under this merchant connector account",
"example": [
{
"accepted_countries": {
"list": [
"FR",
"DE",
"IN"
],
"type": "disable_only"
},
"accepted_currencies": {
"list": [
"USD",
"EUR"
],
"type": "enable_only"
},
"installment_payment_enabled": true,
"maximum_amount": 68607706,
"minimum_amount": 1,
"payment_method": "wallet",
"payment_method_issuers": [
"labore magna ipsum",
"aute"
],
"payment_method_types": [
"upi_collect",
"upi_intent"
],
"payment_schemes": [
"Discover",
"Discover"
],
"recurring_enabled": true
}
],
"nullable": true
},
"metadata": {
"type": "object",
"description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
"nullable": true
},
"test_mode": {
"type": "boolean",
"description": "A boolean value to indicate if the connector is in Test mode. By default, its value is false.",
"default": false,
"example": false,
"nullable": true
},
"disabled": {
"type": "boolean",
"description": "A boolean value to indicate if the connector is disabled. By default, its value is false.",
"default": false,
"example": false,
"nullable": true
},
"frm_configs": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FrmConfigs"
},
"description": "Contains the frm configs for the merchant connector",
"example": "\n[{\"gateway\":\"stripe\",\"payment_methods\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"card_networks\":[\"Visa\"],\"flow\":\"pre\",\"action\":\"cancel_txn\"},{\"payment_method_type\":\"debit\",\"card_networks\":[\"Visa\"],\"flow\":\"pre\"}]}]}]\n",
"nullable": true
},
"business_country": {
"allOf": [
{
"$ref": "#/components/schemas/CountryAlpha2"
}
],
"nullable": true
},
"business_label": {
"type": "string",
"description": "The business label to which the connector account is attached. To be deprecated soon. Use the 'profile_id' instead",
"example": "travel",
"nullable": true
},
"business_sub_label": {
"type": "string",
"description": "The business sublabel to which the connector account is attached. To be deprecated soon. Use the 'profile_id' instead",
"example": "chase",
"nullable": true
},
"applepay_verified_domains": {
"type": "array",
"items": {
"type": "string"
},
"description": "identifier for the verified domains of a particular connector account",
"nullable": true
},
"pm_auth_config": {
"type": "object",
"nullable": true
},
"status": {
"$ref": "#/components/schemas/ConnectorStatus"
},
"additional_merchant_data": {
"allOf": [
{
"$ref": "#/components/schemas/AdditionalMerchantData"
}
],
"nullable": true
}
},
"additionalProperties": false
},
"MerchantConnectorResponse": {
"type": "object",
"description": "Response of creating a new Merchant Connector for the merchant account.\"",
Expand Down
2 changes: 1 addition & 1 deletion crates/analytics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ v2 = ["api_models/v2", "diesel_models/v2", "hyperswitch_domain_models/v2", "stor
api_models = { version = "0.1.0", path = "../api_models", features = ["errors"] }
common_enums = { version = "0.1.0", path = "../common_enums" }
common_utils = { version = "0.1.0", path = "../common_utils" }
diesel_models = { version = "0.1.0", path = "../diesel_models", features = ["kv_store"] }
diesel_models = { version = "0.1.0", path = "../diesel_models", features = ["kv_store"], default-features = false }
hyperswitch_domain_models = { version = "0.1.0", path = "../hyperswitch_domain_models", default-features = false }
hyperswitch_interfaces = { version = "0.1.0", path = "../hyperswitch_interfaces", default-features = false }
masking = { version = "0.1.0", path = "../masking" }
Expand Down
104 changes: 104 additions & 0 deletions crates/api_models/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,110 @@ impl MerchantConnectorResponse {
}
}

#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(deny_unknown_fields)]
pub struct MerchantConnectorListResponse {
/// Type of the Connector for the financial use case. Could range from Payments to Accounting to Banking.
#[schema(value_type = ConnectorType, example = "payment_processor")]
pub connector_type: api_enums::ConnectorType,
/// Name of the Connector
#[schema(value_type = Connector, example = "stripe")]
pub connector_name: String,

/// A unique label to identify the connector account created under a business profile
#[schema(example = "stripe_US_travel")]
pub connector_label: Option<String>,

/// Unique ID of the merchant connector account
#[schema(example = "mca_5apGeP94tMts6rg3U3kR")]
pub merchant_connector_id: String,

/// Identifier for the business profile, if not provided default will be chosen from merchant account
#[schema(max_length = 64)]
pub profile_id: Option<String>,

/// An object containing the details about the payment methods that need to be enabled under this merchant connector account
#[schema(example = json!([
{
"payment_method": "wallet",
"payment_method_types": [
"upi_collect",
"upi_intent"
],
"payment_method_issuers": [
"labore magna ipsum",
"aute"
],
"payment_schemes": [
"Discover",
"Discover"
],
"accepted_currencies": {
"type": "enable_only",
"list": ["USD", "EUR"]
},
"accepted_countries": {
"type": "disable_only",
"list": ["FR", "DE","IN"]
},
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]))]
pub payment_methods_enabled: Option<Vec<PaymentMethodsEnabled>>,

/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.
#[schema(value_type = Option<Object>,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))]
pub metadata: Option<pii::SecretSerdeValue>,

/// A boolean value to indicate if the connector is in Test mode. By default, its value is false.
#[schema(default = false, example = false)]
pub test_mode: Option<bool>,

/// A boolean value to indicate if the connector is disabled. By default, its value is false.
#[schema(default = false, example = false)]
pub disabled: Option<bool>,

/// Contains the frm configs for the merchant connector
#[schema(example = json!(consts::FRM_CONFIGS_EG))]
pub frm_configs: Option<Vec<FrmConfigs>>,

/// The business country to which the connector account is attached. To be deprecated soon. Use the 'profile_id' instead
#[schema(value_type = Option<CountryAlpha2>, example = "US")]
pub business_country: Option<api_enums::CountryAlpha2>,

///The business label to which the connector account is attached. To be deprecated soon. Use the 'profile_id' instead
#[schema(example = "travel")]
pub business_label: Option<String>,

/// The business sublabel to which the connector account is attached. To be deprecated soon. Use the 'profile_id' instead
#[schema(example = "chase")]
pub business_sub_label: Option<String>,

/// identifier for the verified domains of a particular connector account
pub applepay_verified_domains: Option<Vec<String>>,

#[schema(value_type = Option<Object>)]
pub pm_auth_config: Option<pii::SecretSerdeValue>,

#[schema(value_type = ConnectorStatus, example = "inactive")]
pub status: api_enums::ConnectorStatus,

#[schema(value_type = Option<AdditionalMerchantData>)]
pub additional_merchant_data: Option<AdditionalMerchantData>,
}

impl MerchantConnectorListResponse {
pub fn to_merchant_connector_info(&self, connector_label: &String) -> MerchantConnectorInfo {
MerchantConnectorInfo {
connector_label: connector_label.to_string(),
merchant_connector_id: self.merchant_connector_id.clone(),
}
}
}

/// Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc."
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(deny_unknown_fields)]
Expand Down
1 change: 1 addition & 0 deletions crates/common_utils/src/types/keymanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::{

#[derive(Debug)]
pub struct KeyManagerState {
pub enabled: Option<bool>,
pub url: String,
pub client_idle_timeout: Option<u64>,
#[cfg(feature = "keymanager_mtls")]
Expand Down
Loading

0 comments on commit 300b09a

Please sign in to comment.