mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(payment_methods_v2): Payment method Create API (#5812)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -88,7 +88,7 @@ pub struct PaymentMethod {
|
||||
pub payment_method_billing_address: Option<Encryption>,
|
||||
pub updated_by: Option<String>,
|
||||
pub locker_fingerprint_id: Option<String>,
|
||||
pub id: String,
|
||||
pub id: common_utils::id_type::GlobalPaymentMethodId,
|
||||
pub version: common_enums::ApiVersion,
|
||||
pub network_token_requestor_reference_id: Option<String>,
|
||||
pub network_token_locker_id: Option<String>,
|
||||
@ -105,7 +105,7 @@ impl PaymentMethod {
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
pub fn get_id(&self) -> &String {
|
||||
pub fn get_id(&self) -> &common_utils::id_type::GlobalPaymentMethodId {
|
||||
&self.id
|
||||
}
|
||||
}
|
||||
@ -179,7 +179,7 @@ pub struct PaymentMethodNew {
|
||||
pub payment_method_billing_address: Option<Encryption>,
|
||||
pub updated_by: Option<String>,
|
||||
pub locker_fingerprint_id: Option<String>,
|
||||
pub id: String,
|
||||
pub id: common_utils::id_type::GlobalPaymentMethodId,
|
||||
pub version: common_enums::ApiVersion,
|
||||
pub network_token_requestor_reference_id: Option<String>,
|
||||
pub network_token_locker_id: Option<String>,
|
||||
@ -200,7 +200,7 @@ impl PaymentMethodNew {
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
pub fn get_id(&self) -> &String {
|
||||
pub fn get_id(&self) -> &common_utils::id_type::GlobalPaymentMethodId {
|
||||
&self.id
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,7 +211,10 @@ impl PaymentMethod {
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
impl PaymentMethod {
|
||||
pub async fn find_by_id(conn: &PgPooledConn, id: &str) -> StorageResult<Self> {
|
||||
pub async fn find_by_id(
|
||||
conn: &PgPooledConn,
|
||||
id: &common_utils::id_type::GlobalPaymentMethodId,
|
||||
) -> StorageResult<Self> {
|
||||
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(conn, pm_id.eq(id.to_owned()))
|
||||
.await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user