Skip to content

Commit 3fa4554

Browse files
committed
Merge branch 'main' of github.com:juspay/hyperswitch into variation-cypress-x2
* 'main' of github.com:juspay/hyperswitch: refactor(cypress): pass `connector_type` externally (#5522) refactor(router): refactor merchant_connector update v2 flow (#5484) feat(router): add accept language header middleware (#5500) chore(version): 2024.08.05.0 chore(postman): update Postman collection files fix(pm_auth): Added mca status check in pml (#5421) refactor(payment_methods): List the Payment Methods for Merchant , based on the connector type (#4909) fix(router): [Iatapay] make error status and error message optional (#5382) chore(version): 2024.08.02.0 feat(business_profile): introduce domain models for business profile v1 and v2 APIs (#5497) feat(auth): Add `profile_id` in `AuthenticationData` (#5492) feat(core): accept business profile in core functions for payments, refund, payout and disputes (#5498) refactor(router): domain and diesel model changes for merchant_connector_account create v2 flow (#5462) fix(open_payment_links): send displaySavedPaymentMethods as false explicitly for open payment links (#5501) refactor(role): determine level of role entity (#5488)
2 parents e21ff8b + 7743255 commit 3fa4554

File tree

169 files changed

+4693
-1008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+4693
-1008
lines changed

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,52 @@ All notable changes to HyperSwitch will be documented here.
44

55
- - -
66

7+
## 2024.08.05.0
8+
9+
### Bug Fixes
10+
11+
- **pm_auth:** Added mca status check in pml ([#5421](https://github.com/juspay/hyperswitch/pull/5421)) ([`e9bd345`](https://github.com/juspay/hyperswitch/commit/e9bd345464f28133aeaab638c33b77f31dd1fcb5))
12+
- **router:** [Iatapay] make error status and error message optional ([#5382](https://github.com/juspay/hyperswitch/pull/5382)) ([`37e34e3`](https://github.com/juspay/hyperswitch/commit/37e34e3bfde9281b3a69b0769c901a887dcf400f))
13+
14+
### Refactors
15+
16+
- **payment_methods:** List the Payment Methods for Merchant , based on the connector type ([#4909](https://github.com/juspay/hyperswitch/pull/4909)) ([`f3677f2`](https://github.com/juspay/hyperswitch/commit/f3677f268ca18879bc8a9e4c7ab8c96011eb56c3))
17+
18+
### Miscellaneous Tasks
19+
20+
- **postman:** Update Postman collection files ([`1737d74`](https://github.com/juspay/hyperswitch/commit/1737d74183a77910ea764c8cf2cdb148ba77ab74))
21+
22+
**Full Changelog:** [`2024.08.02.0...2024.08.05.0`](https://github.com/juspay/hyperswitch/compare/2024.08.02.0...2024.08.05.0)
23+
24+
- - -
25+
26+
## 2024.08.02.0
27+
28+
### Features
29+
30+
- **auth:**
31+
- Add support for partial-auth, by facilitating injection of authentication parameters in headers ([#4802](https://github.com/juspay/hyperswitch/pull/4802)) ([`1d4c87a`](https://github.com/juspay/hyperswitch/commit/1d4c87a9e37ab1fc05754208ba4fbbcf15ad895a))
32+
- Add `profile_id` in `AuthenticationData` ([#5492](https://github.com/juspay/hyperswitch/pull/5492)) ([`b4eb601`](https://github.com/juspay/hyperswitch/commit/b4eb6016a4e696acf155732592a6571363c24e64))
33+
- **business_profile:** Introduce domain models for business profile v1 and v2 APIs ([#5497](https://github.com/juspay/hyperswitch/pull/5497)) ([`537630f`](https://github.com/juspay/hyperswitch/commit/537630f00482939d4c0b49c643dee3763fe0e046))
34+
- **connector:** [Paybox] add connector template code ([#5485](https://github.com/juspay/hyperswitch/pull/5485)) ([`5e1eb4a`](https://github.com/juspay/hyperswitch/commit/5e1eb4af863265c94299189de983e02a255e7e62))
35+
- **core:** Accept business profile in core functions for payments, refund, payout and disputes ([#5498](https://github.com/juspay/hyperswitch/pull/5498)) ([`fb32b61`](https://github.com/juspay/hyperswitch/commit/fb32b61edfa2b4190a5717850aeca6b3b0d7db54))
36+
- **cypress:** Add corner cases ([#5481](https://github.com/juspay/hyperswitch/pull/5481)) ([`c0f4577`](https://github.com/juspay/hyperswitch/commit/c0f45771b0b4d7d60918ae03aca9f14162ff3218))
37+
- **opensearch:** Updated status filter field name to match index and added time-range based search ([#5468](https://github.com/juspay/hyperswitch/pull/5468)) ([`625f5ae`](https://github.com/juspay/hyperswitch/commit/625f5ae289ca93a1a6d469d6a0f71d7492f22bc5))
38+
39+
### Bug Fixes
40+
41+
- **open_payment_links:** Send displaySavedPaymentMethods as false explicitly for open payment links ([#5501](https://github.com/juspay/hyperswitch/pull/5501)) ([`b4e7717`](https://github.com/juspay/hyperswitch/commit/b4e77170559d5912758f18d2db46bf25eb5277b2))
42+
43+
### Refactors
44+
45+
- **role:** Determine level of role entity ([#5488](https://github.com/juspay/hyperswitch/pull/5488)) ([`c036fd7`](https://github.com/juspay/hyperswitch/commit/c036fd7f41a21eb481859671db672b0bcebdca97))
46+
- **router:** Domain and diesel model changes for merchant_connector_account create v2 flow ([#5462](https://github.com/juspay/hyperswitch/pull/5462)) ([`85209d1`](https://github.com/juspay/hyperswitch/commit/85209d12ae3439b555983d62b2cc3bf764c1b441))
47+
- **routing:** Api v2 for routing create and activate endpoints ([#5423](https://github.com/juspay/hyperswitch/pull/5423)) ([`6140cfe`](https://github.com/juspay/hyperswitch/commit/6140cfe04ea7b3f895f8989dbf2803a06b1a6dd2))
48+
49+
**Full Changelog:** [`2024.08.01.0...2024.08.02.0`](https://github.com/juspay/hyperswitch/compare/2024.08.01.0...2024.08.02.0)
50+
51+
- - -
52+
753
## 2024.08.01.0
854

955
### Bug Fixes

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/deployments/integration_test.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ outgoing_enabled = true
357357
connectors_with_webhook_source_verification_call = "paypal" # List of connectors which has additional source verification api-call
358358

359359
[unmasked_headers]
360-
keys = "user-agent"
360+
keys = "accept-language,user-agent"
361361

362362
[saved_payment_methods]
363363
sdk_eligible_payment_methods = "card"

config/deployments/production.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ outgoing_enabled = true
370370
connectors_with_webhook_source_verification_call = "paypal" # List of connectors which has additional source verification api-call
371371

372372
[unmasked_headers]
373-
keys = "user-agent"
373+
keys = "accept-language,user-agent"
374374

375375
[saved_payment_methods]
376376
sdk_eligible_payment_methods = "card"

config/deployments/sandbox.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ outgoing_enabled = true
374374
connectors_with_webhook_source_verification_call = "paypal" # List of connectors which has additional source verification api-call
375375

376376
[unmasked_headers]
377-
keys = "user-agent"
377+
keys = "accept-language,user-agent"
378378

379379
[saved_payment_methods]
380380
sdk_eligible_payment_methods = "card"

config/development.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ enabled = true
682682
file_storage_backend = "file_system"
683683

684684
[unmasked_headers]
685-
keys = "user-agent"
685+
keys = "accept-language,user-agent"
686686

687687
[opensearch]
688688
host = "https://localhost:9200"

config/docker_compose.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ source = "logs"
506506
file_storage_backend = "file_system"
507507

508508
[unmasked_headers]
509-
keys = "user-agent"
509+
keys = "accept-language,user-agent"
510510

511511
[opensearch]
512512
host = "https://opensearch:9200"

crates/api_models/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ frm = []
1717
olap = []
1818
openapi = ["common_enums/openapi", "olap", "recon", "dummy_connector", "olap"]
1919
recon = []
20-
v1 =[]
20+
v1 = []
2121
v2 = []
22-
routing_v2 = []
23-
merchant_connector_account_v2 = []
22+
business_profile_v2 = []
2423
customer_v2 = []
2524
merchant_account_v2 = []
25+
merchant_connector_account_v2 = []
2626
payment_v2 = []
27+
routing_v2 = []
2728

2829
[dependencies]
2930
actix-web = { version = "4.5.1", optional = true }

crates/api_models/src/admin.rs

Lines changed: 202 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ pub struct MerchantConnectorResponse {
951951

952952
/// Unique ID of the merchant connector account
953953
#[schema(example = "mca_5apGeP94tMts6rg3U3kR")]
954-
pub connector_id: String,
954+
pub id: String,
955955

956956
/// Identifier for the business profile, if not provided default will be chosen from merchant account
957957
#[schema(max_length = 64)]
@@ -1032,7 +1032,7 @@ impl MerchantConnectorResponse {
10321032
pub fn to_merchant_connector_info(&self, connector_label: &String) -> MerchantConnectorInfo {
10331033
MerchantConnectorInfo {
10341034
connector_label: connector_label.to_string(),
1035-
merchant_connector_id: self.connector_id.clone(),
1035+
merchant_connector_id: self.id.clone(),
10361036
}
10371037
}
10381038
}
@@ -1162,6 +1162,10 @@ impl MerchantConnectorResponse {
11621162
}
11631163
}
11641164

1165+
#[cfg(all(
1166+
any(feature = "v1", feature = "v2"),
1167+
not(feature = "merchant_connector_account_v2")
1168+
))]
11651169
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
11661170
#[serde(deny_unknown_fields)]
11671171
pub struct MerchantConnectorListResponse {
@@ -1257,6 +1261,10 @@ pub struct MerchantConnectorListResponse {
12571261
pub additional_merchant_data: Option<AdditionalMerchantData>,
12581262
}
12591263

1264+
#[cfg(all(
1265+
any(feature = "v1", feature = "v2"),
1266+
not(feature = "merchant_connector_account_v2")
1267+
))]
12601268
impl MerchantConnectorListResponse {
12611269
pub fn to_merchant_connector_info(&self, connector_label: &String) -> MerchantConnectorInfo {
12621270
MerchantConnectorInfo {
@@ -1266,7 +1274,101 @@ impl MerchantConnectorListResponse {
12661274
}
12671275
}
12681276

1277+
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
1278+
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
1279+
#[serde(deny_unknown_fields)]
1280+
pub struct MerchantConnectorListResponse {
1281+
/// Type of the Connector for the financial use case. Could range from Payments to Accounting to Banking.
1282+
#[schema(value_type = ConnectorType, example = "payment_processor")]
1283+
pub connector_type: api_enums::ConnectorType,
1284+
/// Name of the Connector
1285+
#[schema(value_type = Connector, example = "stripe")]
1286+
pub connector_name: String,
1287+
1288+
/// A unique label to identify the connector account created under a business profile
1289+
#[schema(example = "stripe_US_travel")]
1290+
pub connector_label: Option<String>,
1291+
1292+
/// Unique ID of the merchant connector account
1293+
#[schema(example = "mca_5apGeP94tMts6rg3U3kR")]
1294+
pub id: String,
1295+
1296+
/// Identifier for the business profile, if not provided default will be chosen from merchant account
1297+
#[schema(max_length = 64)]
1298+
pub profile_id: Option<String>,
1299+
1300+
/// An object containing the details about the payment methods that need to be enabled under this merchant connector account
1301+
#[schema(example = json!([
1302+
{
1303+
"payment_method": "wallet",
1304+
"payment_method_types": [
1305+
"upi_collect",
1306+
"upi_intent"
1307+
],
1308+
"payment_method_issuers": [
1309+
"labore magna ipsum",
1310+
"aute"
1311+
],
1312+
"payment_schemes": [
1313+
"Discover",
1314+
"Discover"
1315+
],
1316+
"accepted_currencies": {
1317+
"type": "enable_only",
1318+
"list": ["USD", "EUR"]
1319+
},
1320+
"accepted_countries": {
1321+
"type": "disable_only",
1322+
"list": ["FR", "DE","IN"]
1323+
},
1324+
"minimum_amount": 1,
1325+
"maximum_amount": 68607706,
1326+
"recurring_enabled": true,
1327+
"installment_payment_enabled": true
1328+
}
1329+
]))]
1330+
pub payment_methods_enabled: Option<Vec<PaymentMethodsEnabled>>,
1331+
1332+
/// 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.
1333+
#[schema(value_type = Option<Object>,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))]
1334+
pub metadata: Option<pii::SecretSerdeValue>,
1335+
1336+
/// A boolean value to indicate if the connector is disabled. By default, its value is false.
1337+
#[schema(default = false, example = false)]
1338+
pub disabled: Option<bool>,
1339+
1340+
/// Contains the frm configs for the merchant connector
1341+
#[schema(example = json!(consts::FRM_CONFIGS_EG))]
1342+
pub frm_configs: Option<Vec<FrmConfigs>>,
1343+
1344+
/// identifier for the verified domains of a particular connector account
1345+
pub applepay_verified_domains: Option<Vec<String>>,
1346+
1347+
#[schema(value_type = Option<Object>)]
1348+
pub pm_auth_config: Option<pii::SecretSerdeValue>,
1349+
1350+
#[schema(value_type = ConnectorStatus, example = "inactive")]
1351+
pub status: api_enums::ConnectorStatus,
1352+
1353+
#[schema(value_type = Option<AdditionalMerchantData>)]
1354+
pub additional_merchant_data: Option<AdditionalMerchantData>,
1355+
}
1356+
1357+
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
1358+
impl MerchantConnectorListResponse {
1359+
pub fn to_merchant_connector_info(&self, connector_label: &String) -> MerchantConnectorInfo {
1360+
MerchantConnectorInfo {
1361+
connector_label: connector_label.to_string(),
1362+
merchant_connector_id: self.id.clone(),
1363+
}
1364+
}
1365+
}
1366+
12691367
/// 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."
1368+
#[cfg(all(
1369+
any(feature = "v1", feature = "v2"),
1370+
not(feature = "merchant_connector_account_v2")
1371+
))]
12701372
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
12711373
#[serde(deny_unknown_fields)]
12721374
pub struct MerchantConnectorUpdate {
@@ -1346,6 +1448,104 @@ pub struct MerchantConnectorUpdate {
13461448
pub status: Option<api_enums::ConnectorStatus>,
13471449
}
13481450

1451+
/// 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."
1452+
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
1453+
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
1454+
#[serde(deny_unknown_fields)]
1455+
pub struct MerchantConnectorUpdate {
1456+
/// Type of the Connector for the financial use case. Could range from Payments to Accounting to Banking.
1457+
#[schema(value_type = ConnectorType, example = "payment_processor")]
1458+
pub connector_type: api_enums::ConnectorType,
1459+
1460+
/// This is an unique label you can generate and pass in order to identify this connector account on your Hyperswitch dashboard and reports. Eg: if your profile label is `default`, connector label can be `stripe_default`
1461+
#[schema(example = "stripe_US_travel")]
1462+
pub connector_label: Option<String>,
1463+
1464+
/// An object containing the required details/credentials for a Connector account.
1465+
#[schema(value_type = Option<MerchantConnectorDetails>,example = json!({ "auth_type": "HeaderKey","api_key": "Basic MyVerySecretApiKey" }))]
1466+
pub connector_account_details: Option<pii::SecretSerdeValue>,
1467+
1468+
/// An object containing the details about the payment methods that need to be enabled under this merchant connector account
1469+
#[schema(example = json!([
1470+
{
1471+
"payment_method": "wallet",
1472+
"payment_method_types": [
1473+
"upi_collect",
1474+
"upi_intent"
1475+
],
1476+
"payment_method_issuers": [
1477+
"labore magna ipsum",
1478+
"aute"
1479+
],
1480+
"payment_schemes": [
1481+
"Discover",
1482+
"Discover"
1483+
],
1484+
"accepted_currencies": {
1485+
"type": "enable_only",
1486+
"list": ["USD", "EUR"]
1487+
},
1488+
"accepted_countries": {
1489+
"type": "disable_only",
1490+
"list": ["FR", "DE","IN"]
1491+
},
1492+
"minimum_amount": 1,
1493+
"maximum_amount": 68607706,
1494+
"recurring_enabled": true,
1495+
"installment_payment_enabled": true
1496+
}
1497+
]))]
1498+
pub payment_methods_enabled: Option<Vec<PaymentMethodsEnabled>>,
1499+
1500+
/// Webhook details of this merchant connector
1501+
#[schema(example = json!({
1502+
"connector_webhook_details": {
1503+
"merchant_secret": "1234567890987654321"
1504+
}
1505+
}))]
1506+
pub connector_webhook_details: Option<MerchantConnectorWebhookDetails>,
1507+
1508+
/// 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.
1509+
#[schema(value_type = Option<Object>,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))]
1510+
pub metadata: Option<pii::SecretSerdeValue>,
1511+
1512+
/// A boolean value to indicate if the connector is disabled. By default, its value is false.
1513+
#[schema(default = false, example = false)]
1514+
pub disabled: Option<bool>,
1515+
1516+
/// Contains the frm configs for the merchant connector
1517+
#[schema(example = json!(consts::FRM_CONFIGS_EG))]
1518+
pub frm_configs: Option<Vec<FrmConfigs>>,
1519+
1520+
/// pm_auth_config will relate MCA records to their respective chosen auth services, based on payment_method and pmt
1521+
#[schema(value_type = Option<Object>)]
1522+
pub pm_auth_config: Option<pii::SecretSerdeValue>,
1523+
1524+
#[schema(value_type = ConnectorStatus, example = "inactive")]
1525+
pub status: Option<api_enums::ConnectorStatus>,
1526+
1527+
/// The identifier for the Merchant Account
1528+
#[schema(value_type = String, max_length = 64, min_length = 1, example = "y3oqhf46pyzuxjbcn2giaqnb44")]
1529+
pub merchant_id: id_type::MerchantId,
1530+
}
1531+
1532+
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
1533+
impl MerchantConnectorUpdate {
1534+
pub fn get_frm_config_as_secret(&self) -> Option<Vec<Secret<serde_json::Value>>> {
1535+
match self.frm_configs.as_ref() {
1536+
Some(frm_value) => {
1537+
let configs_for_frm_value: Vec<Secret<serde_json::Value>> = frm_value
1538+
.iter()
1539+
.map(|config| config.encode_to_value().map(Secret::new))
1540+
.collect::<Result<Vec<_>, _>>()
1541+
.ok()?;
1542+
Some(configs_for_frm_value)
1543+
}
1544+
None => None,
1545+
}
1546+
}
1547+
}
1548+
13491549
///Details of FrmConfigs are mentioned here... it should be passed in payment connector create api call, and stored in merchant_connector_table
13501550
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
13511551
#[serde(deny_unknown_fields)]

0 commit comments

Comments
 (0)