mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
refactor(payment_intent_v2): payment intent fields refactoring (#5880)
Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -332,12 +332,9 @@ impl UniqueConstraints for diesel_models::Address {
|
||||
#[cfg(all(feature = "v2", feature = "payment_v2"))]
|
||||
impl UniqueConstraints for diesel_models::PaymentIntent {
|
||||
fn unique_constraints(&self) -> Vec<String> {
|
||||
vec![format!(
|
||||
"pi_{}_{}",
|
||||
self.merchant_id.get_string_repr(),
|
||||
self.merchant_reference_id
|
||||
)]
|
||||
vec![self.id.get_string_repr().to_owned()]
|
||||
}
|
||||
|
||||
fn table_name(&self) -> &str {
|
||||
"PaymentIntent"
|
||||
}
|
||||
@ -345,6 +342,7 @@ impl UniqueConstraints for diesel_models::PaymentIntent {
|
||||
|
||||
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "payment_v2")))]
|
||||
impl UniqueConstraints for diesel_models::PaymentIntent {
|
||||
#[cfg(feature = "v1")]
|
||||
fn unique_constraints(&self) -> Vec<String> {
|
||||
vec![format!(
|
||||
"pi_{}_{}",
|
||||
@ -352,6 +350,12 @@ impl UniqueConstraints for diesel_models::PaymentIntent {
|
||||
self.payment_id.get_string_repr()
|
||||
)]
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
fn unique_constraints(&self) -> Vec<String> {
|
||||
vec![format!("pi_{}", self.id.get_string_repr())]
|
||||
}
|
||||
|
||||
fn table_name(&self) -> &str {
|
||||
"PaymentIntent"
|
||||
}
|
||||
@ -437,7 +441,7 @@ impl UniqueConstraints for diesel_models::PaymentMethod {
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
impl UniqueConstraints for diesel_models::PaymentMethod {
|
||||
fn unique_constraints(&self) -> Vec<String> {
|
||||
vec![self.id.get_string_repr()]
|
||||
vec![self.id.get_string_repr().to_owned()]
|
||||
}
|
||||
fn table_name(&self) -> &str {
|
||||
"PaymentMethod"
|
||||
|
||||
Reference in New Issue
Block a user