Skip to content

Commit

Permalink
Merge branch 'main' into change_address_to_domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Narayanbhat166 committed Dec 3, 2024
2 parents 9be1abf + 79a75ce commit 126a6bc
Show file tree
Hide file tree
Showing 150 changed files with 883 additions and 691 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow-dbg-in-tests = true
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 2024.12.03.0

### Features

- **payment_methods_v2:** Implement a barebones version of list customer payment methods v2 ([#6649](https://github.com/juspay/hyperswitch/pull/6649)) ([`797a0db`](https://github.com/juspay/hyperswitch/commit/797a0db7733c5b387564fb1bbc106d054c8dffa6))
- **routing:** Elimination routing switch for toggling the feature ([#6568](https://github.com/juspay/hyperswitch/pull/6568)) ([`f6dde13`](https://github.com/juspay/hyperswitch/commit/f6dde13d6c2920761f236969a3862fe61f3e0e3d))

### Bug Fixes

- **connector:** Adyen - propagate connector mandate details in incoming webhooks ([#6720](https://github.com/juspay/hyperswitch/pull/6720)) ([`bea4b9e`](https://github.com/juspay/hyperswitch/commit/bea4b9e7f430c3d7fbb25be0b472d2afb01135ec))
- **opensearch:** Fix empty filter array query addition in globalsearch query ([#6716](https://github.com/juspay/hyperswitch/pull/6716)) ([`063a1c6`](https://github.com/juspay/hyperswitch/commit/063a1c636ce29ca8f76c3c272c6da4d32d356cda))
- **payment_link:** Add support for hide card nickname field for open payment links ([#6700](https://github.com/juspay/hyperswitch/pull/6700)) ([`933911e`](https://github.com/juspay/hyperswitch/commit/933911eda11f32d72ffeddb948b86672cb08105b))

### Miscellaneous Tasks

- Address Rust 1.83.0 clippy lints and enable more clippy lints ([#6705](https://github.com/juspay/hyperswitch/pull/6705)) ([`9a59d0a`](https://github.com/juspay/hyperswitch/commit/9a59d0a5ff682cd7a983a63e90113afc846aeac6))

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

- - -

## 2024.12.02.1

### Bug Fixes
Expand Down
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ unused_qualifications = "warn"

[workspace.lints.clippy]
as_conversions = "warn"
cloned_instead_of_copied = "warn"
dbg_macro = "warn"
expect_used = "warn"
fn_params_excessive_bools = "warn"
index_refutable_slice = "warn"
indexing_slicing = "warn"
large_futures = "warn"
match_on_vec_items = "warn"
missing_panics_doc = "warn"
mod_module_files = "warn"
out_of_bounds_indexing = "warn"
panic = "warn"
panic_in_result_fn = "warn"
Expand All @@ -32,10 +36,12 @@ print_stderr = "warn"
print_stdout = "warn"
todo = "warn"
unimplemented = "warn"
unnecessary_self_imports = "warn"
unreachable = "warn"
unwrap_in_result = "warn"
unwrap_used = "warn"
use_self = "warn"
wildcard_dependencies = "warn"

# Lints to allow
option_map_unit_fn = "allow"
Expand Down
4 changes: 2 additions & 2 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@
],
"summary": "Routing - Create",
"description": "Create a routing algorithm",
"operationId": "Create a routing algprithm",
"operationId": "Create a routing algorithm",
"requestBody": {
"content": {
"application/json": {
Expand Down Expand Up @@ -4176,7 +4176,7 @@
},
"bank_account_bic": {
"type": "string",
"description": "Bank account details for Giropay\nBank account bic code",
"description": "Bank account bic code",
"nullable": true
},
"bank_account_iban": {
Expand Down
68 changes: 33 additions & 35 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,6 @@
"Payments"
],
"summary": "Payments - Complete Authorize",
"description": "\n",
"operationId": "Complete Authorize a Payment",
"parameters": [
{
Expand Down Expand Up @@ -918,7 +917,6 @@
"Payments"
],
"summary": "Payments - Post Session Tokens",
"description": "\n",
"operationId": "Create Post Session Tokens for a Payment",
"requestBody": {
"content": {
Expand Down Expand Up @@ -3931,7 +3929,7 @@
],
"summary": "Routing - Toggle success based dynamic routing for profile",
"description": "Create a success based dynamic routing algorithm",
"operationId": "Toggle success based dynamic routing algprithm",
"operationId": "Toggle success based dynamic routing algorithm",
"parameters": [
{
"name": "account_id",
Expand All @@ -3957,7 +3955,7 @@
"description": "Feature to enable for success based routing",
"required": true,
"schema": {
"$ref": "#/components/schemas/SuccessBasedRoutingFeatures"
"$ref": "#/components/schemas/DynamicRoutingFeatures"
}
}
],
Expand Down Expand Up @@ -6757,7 +6755,7 @@
},
"bank_account_bic": {
"type": "string",
"description": "Bank account details for Giropay\nBank account bic code",
"description": "Bank account bic code",
"nullable": true
},
"bank_account_iban": {
Expand Down Expand Up @@ -10236,6 +10234,14 @@
}
}
},
"DynamicRoutingFeatures": {
"type": "string",
"enum": [
"metrics",
"dynamic_connector_selection",
"none"
]
},
"EnabledPaymentMethod": {
"type": "object",
"description": "Object for EnabledPaymentMethod",
Expand Down Expand Up @@ -23874,14 +23880,6 @@
"destination"
]
},
"SuccessBasedRoutingFeatures": {
"type": "string",
"enum": [
"metrics",
"dynamic_connector_selection",
"none"
]
},
"SurchargeDetailsResponse": {
"type": "object",
"required": [
Expand Down Expand Up @@ -24098,6 +24096,28 @@
}
}
},
"ToggleDynamicRoutingPath": {
"type": "object",
"required": [
"profile_id"
],
"properties": {
"profile_id": {
"type": "string"
}
}
},
"ToggleDynamicRoutingQuery": {
"type": "object",
"required": [
"enable"
],
"properties": {
"enable": {
"$ref": "#/components/schemas/DynamicRoutingFeatures"
}
}
},
"ToggleKVRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -24131,28 +24151,6 @@
}
}
},
"ToggleSuccessBasedRoutingPath": {
"type": "object",
"required": [
"profile_id"
],
"properties": {
"profile_id": {
"type": "string"
}
}
},
"ToggleSuccessBasedRoutingQuery": {
"type": "object",
"required": [
"enable"
],
"properties": {
"enable": {
"$ref": "#/components/schemas/SuccessBasedRoutingFeatures"
}
}
},
"TouchNGoRedirection": {
"type": "object"
},
Expand Down
4 changes: 1 addition & 3 deletions crates/analytics/src/opensearch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,7 @@ impl OpenSearchQueryBuilder {

let should_array = self.build_auth_array();

if !bool_obj.is_empty() {
query_obj.insert("bool".to_string(), Value::Object(bool_obj));
}
query_obj.insert("bool".to_string(), Value::Object(bool_obj));

let mut sort_obj = Map::new();
sort_obj.insert(
Expand Down
1 change: 0 additions & 1 deletion crates/api_models/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,6 @@ pub struct MerchantConnectorUpdate {

#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(deny_unknown_fields)]

pub struct ConnectorWalletDetails {
/// This field contains the Apple Pay certificates and credentials for iOS and Web Apple Pay flow
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
3 changes: 0 additions & 3 deletions crates/api_models/src/analytics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ pub struct PaymentIntentFilterValue {

#[derive(Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "camelCase")]

pub struct GetRefundFilterRequest {
pub time_range: TimeRange,
#[serde(default)]
Expand All @@ -292,7 +291,6 @@ pub struct RefundFiltersResponse {

#[derive(Debug, serde::Serialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]

pub struct RefundFilterValue {
pub dimension: RefundDimensions,
pub values: Vec<String>,
Expand Down Expand Up @@ -435,7 +433,6 @@ pub struct DisputeFiltersResponse {

#[derive(Debug, serde::Serialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]

pub struct DisputeFilterValue {
pub dimension: DisputeDimensions,
pub values: Vec<String>,
Expand Down
2 changes: 1 addition & 1 deletion crates/api_models/src/api_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ mod never {
{
struct NeverVisitor;

impl<'de> serde::de::Visitor<'de> for NeverVisitor {
impl serde::de::Visitor<'_> for NeverVisitor {
type Value = ();

fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down
1 change: 0 additions & 1 deletion crates/api_models/src/conditional_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ pub struct ConditionalConfigReq {
pub algorithm: Option<Program<ConditionalConfigs>>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]

pub struct DecisionManagerRequest {
pub name: Option<String>,
pub program: Option<Program<ConditionalConfigs>>,
Expand Down
1 change: 0 additions & 1 deletion crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ pub enum FrmConnectors {
)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]

pub enum TaxConnectors {
Taxjar,
}
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions crates/api_models/src/events/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::routing::{
RoutingLinkWrapper, RoutingPayloadWrapper, RoutingRetrieveLinkQuery,
RoutingRetrieveLinkQueryWrapper, RoutingRetrieveQuery, SuccessBasedRoutingConfig,
SuccessBasedRoutingPayloadWrapper, SuccessBasedRoutingUpdateConfigQuery,
ToggleSuccessBasedRoutingQuery, ToggleSuccessBasedRoutingWrapper,
ToggleDynamicRoutingQuery, ToggleDynamicRoutingWrapper,
};

impl ApiEventMetric for RoutingKind {
Expand Down Expand Up @@ -79,7 +79,7 @@ impl ApiEventMetric for RoutingRetrieveLinkQueryWrapper {
}
}

impl ApiEventMetric for ToggleSuccessBasedRoutingQuery {
impl ApiEventMetric for ToggleDynamicRoutingQuery {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Routing)
}
Expand All @@ -97,7 +97,7 @@ impl ApiEventMetric for SuccessBasedRoutingPayloadWrapper {
}
}

impl ApiEventMetric for ToggleSuccessBasedRoutingWrapper {
impl ApiEventMetric for ToggleDynamicRoutingWrapper {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Routing)
}
Expand Down
11 changes: 3 additions & 8 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,6 @@ pub enum AdditionalPaymentData {
}

#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]

pub struct KlarnaSdkPaymentMethod {
pub payment_type: Option<String>,
}
Expand Down Expand Up @@ -2508,7 +2507,6 @@ pub enum BankRedirectData {
Giropay {
/// The billing details for bank redirection
billing_details: Option<BankRedirectBilling>,
/// Bank account details for Giropay

#[schema(value_type = Option<String>)]
/// Bank account bic code
Expand Down Expand Up @@ -3686,7 +3684,6 @@ pub enum WalletResponseData {
}

#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]

pub struct KlarnaSdkPaymentMethodResponse {
pub payment_type: Option<String>,
}
Expand Down Expand Up @@ -4200,7 +4197,6 @@ pub struct ReceiverDetails {

#[derive(Clone, Debug, PartialEq, serde::Serialize, ToSchema, router_derive::PolymorphicSchema)]
#[generate_schemas(PaymentsCreateResponseOpenApi)]

pub struct PaymentsResponse {
/// Unique identifier for the payment. This ensures idempotency for multiple payments
/// that have been done by a single merchant.
Expand Down Expand Up @@ -6365,7 +6361,7 @@ mod payment_id_type {
struct PaymentIdVisitor;
struct OptionalPaymentIdVisitor;

impl<'de> Visitor<'de> for PaymentIdVisitor {
impl Visitor<'_> for PaymentIdVisitor {
type Value = PaymentIdType;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down Expand Up @@ -6443,7 +6439,7 @@ mod payment_id_type {
struct PaymentIdVisitor;
struct OptionalPaymentIdVisitor;

impl<'de> Visitor<'de> for PaymentIdVisitor {
impl Visitor<'_> for PaymentIdVisitor {
type Value = PaymentIdType;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down Expand Up @@ -6517,7 +6513,7 @@ pub mod amount {

// This is defined to provide guarded deserialization of amount
// which itself handles zero and non-zero values internally
impl<'de> de::Visitor<'de> for AmountVisitor {
impl de::Visitor<'_> for AmountVisitor {
type Value = Amount;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down Expand Up @@ -6717,7 +6713,6 @@ pub struct PaymentLinkStatusDetails {

#[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)]
#[serde(deny_unknown_fields)]

pub struct PaymentLinkListConstraints {
/// limit on the number of objects to return
pub limit: Option<i64>,
Expand Down
1 change: 0 additions & 1 deletion crates/api_models/src/pm_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub struct LinkTokenCreateResponse {

#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]

pub struct ExchangeTokenCreateRequest {
pub public_token: String,
pub client_secret: Option<String>,
Expand Down
Loading

0 comments on commit 126a6bc

Please sign in to comment.