Skip to content

Commit

Permalink
chore: fix v2 clippy error
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshayaFoiger committed Jan 7, 2025
1 parent b081c08 commit 794aea5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
7 changes: 6 additions & 1 deletion crates/diesel_models/src/schema_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,10 @@ diesel::table! {
shipping_cost -> Nullable<Int8>,
order_tax_amount -> Nullable<Int8>,
connector_mandate_detail -> Nullable<Jsonb>,
#[max_length = 32]
request_overcapture -> Nullable<Varchar>,
#[max_length = 32]
overcapture_status -> Nullable<Varchar>,
}
}

Expand Down Expand Up @@ -937,7 +941,8 @@ diesel::table! {
split_payments -> Nullable<Jsonb>,
#[max_length = 64]
platform_merchant_id -> Nullable<Varchar>,
request_overcapture -> Nullable<Bool>,
#[max_length = 32]
request_overcapture -> Nullable<Varchar>,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ impl PaymentAttempt {
error: None,
connector_mandate_detail: None,
id,
overcapture_status: None,
request_overcapture: None,
})
}
}
Expand Down Expand Up @@ -1802,6 +1804,8 @@ impl behaviour::Conversion for PaymentAttempt {
payment_method_billing_address,
connector,
connector_mandate_detail,
request_overcapture,
overcapture_status,
} = self;

let AttemptAmountDetails {
Expand Down Expand Up @@ -1879,6 +1883,8 @@ impl behaviour::Conversion for PaymentAttempt {
payment_method_billing_address: payment_method_billing_address.map(Encryption::from),
connector_payment_data,
connector_mandate_detail,
overcapture_status,
request_overcapture,
})
}

Expand Down Expand Up @@ -1990,6 +1996,8 @@ impl behaviour::Conversion for PaymentAttempt {
connector: storage_model.connector,
payment_method_billing_address,
connector_mandate_detail: storage_model.connector_mandate_detail,
request_overcapture: storage_model.request_overcapture,
overcapture_status: storage_model.overcapture_status,
})
}
.await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ impl behaviour::Conversion for PaymentIntent {
psd2_sca_exemption_type: None,
platform_merchant_id,
split_payments: None,
request_overcapture: Some(request_overcapture.as_bool()),
request_overcapture: Some(request_overcapture),
})
}
async fn convert_back(
Expand Down Expand Up @@ -1528,7 +1528,7 @@ impl behaviour::Conversion for PaymentIntent {
payment_link_config: storage_model.payment_link_config,
routing_algorithm_id: storage_model.routing_algorithm_id,
platform_merchant_id: storage_model.platform_merchant_id,
request_overcapture: storage_model.request_overcapture.into(),
request_overcapture: storage_model.request_overcapture.unwrap_or_default(),
})
}
.await
Expand Down Expand Up @@ -1602,7 +1602,7 @@ impl behaviour::Conversion for PaymentIntent {
enable_payment_link: Some(self.enable_payment_link.as_bool()),
apply_mit_exemption: Some(self.apply_mit_exemption.as_bool()),
platform_merchant_id: self.platform_merchant_id,
request_overcapture: Some(self.request_overcapture.as_bool()),
request_overcapture: Some(self.request_overcapture),
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/connector/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ where
.map(MinorUnit::new)
.map(|captured_amount| {
if total_capturable_amount == captured_amount
|| (overcapture_status == Some(enums::OverCaptureStatus::Available)
|| (overcapture_status == Some(enums::OverCaptureStatus::Applicable)
&& captured_amount > total_capturable_amount)
{
enums::AttemptStatus::Charged
Expand Down

0 comments on commit 794aea5

Please sign in to comment.