mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 21:37:41 +08:00
feat(payouts): add domain type for PayoutId (#8395)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
use common_utils::errors::ErrorSwitch;
|
||||
use common_utils::{errors::ErrorSwitch, id_type};
|
||||
use hyperswitch_domain_models::errors::api_error_response as errors;
|
||||
|
||||
use crate::core::errors::CustomersErrorResponse;
|
||||
@ -133,7 +133,7 @@ pub enum StripeErrorCode {
|
||||
EventNotFound,
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "token_already_used", message = "Duplicate payout request")]
|
||||
DuplicatePayout { payout_id: String },
|
||||
DuplicatePayout { payout_id: id_type::PayoutId },
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "parameter_missing", message = "Return url is not available")]
|
||||
ReturnUrlUnavailable,
|
||||
@ -209,9 +209,7 @@ pub enum StripeErrorCode {
|
||||
PaymentIntentMandateInvalid { message: String },
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "", message = "The payment with the specified payment_id already exists in our records.")]
|
||||
DuplicatePayment {
|
||||
payment_id: common_utils::id_type::PaymentId,
|
||||
},
|
||||
DuplicatePayment { payment_id: id_type::PaymentId },
|
||||
|
||||
#[error(error_type = StripeErrorType::ConnectorError, code = "", message = "{code}: {message}")]
|
||||
ExternalConnectorError {
|
||||
|
||||
@ -4,9 +4,12 @@ use api_models::{
|
||||
enums::{Currency, DisputeStatus, MandateStatus},
|
||||
webhooks::{self as api},
|
||||
};
|
||||
#[cfg(feature = "payouts")]
|
||||
use common_utils::pii::{self, Email};
|
||||
use common_utils::{crypto::SignMessage, date_time, ext_traits::Encode};
|
||||
#[cfg(feature = "payouts")]
|
||||
use common_utils::{
|
||||
id_type,
|
||||
pii::{self, Email},
|
||||
};
|
||||
use error_stack::ResultExt;
|
||||
use router_env::logger;
|
||||
use serde::Serialize;
|
||||
@ -94,7 +97,7 @@ pub struct StripeDisputeResponse {
|
||||
pub id: String,
|
||||
pub amount: String,
|
||||
pub currency: Currency,
|
||||
pub payment_intent: common_utils::id_type::PaymentId,
|
||||
pub payment_intent: id_type::PaymentId,
|
||||
pub reason: Option<String>,
|
||||
pub status: StripeDisputeStatus,
|
||||
}
|
||||
@ -110,7 +113,7 @@ pub struct StripeMandateResponse {
|
||||
#[cfg(feature = "payouts")]
|
||||
#[derive(Clone, Serialize, Debug)]
|
||||
pub struct StripePayoutResponse {
|
||||
pub id: String,
|
||||
pub id: id_type::PayoutId,
|
||||
pub amount: i64,
|
||||
pub currency: String,
|
||||
pub payout_type: Option<common_enums::PayoutType>,
|
||||
|
||||
Reference in New Issue
Block a user