mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-04 05:59:48 +08:00 
			
		
		
		
	refactor(dynamic_routing): perform db operations for dynamic_routing_stats table only when payments are in terminal state (#6900)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		@ -1304,6 +1304,20 @@ pub enum IntentStatus {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl IntentStatus {
 | 
			
		||||
    /// Indicates whether the payment intent is in terminal state or not
 | 
			
		||||
    pub fn is_in_terminal_state(self) -> bool {
 | 
			
		||||
        match self {
 | 
			
		||||
            Self::Succeeded | Self::Failed | Self::Cancelled | Self::PartiallyCaptured => true,
 | 
			
		||||
            Self::Processing
 | 
			
		||||
            | Self::RequiresCustomerAction
 | 
			
		||||
            | Self::RequiresMerchantAction
 | 
			
		||||
            | Self::RequiresPaymentMethod
 | 
			
		||||
            | Self::RequiresConfirmation
 | 
			
		||||
            | Self::RequiresCapture
 | 
			
		||||
            | Self::PartiallyCapturedAndCapturable => false,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// Indicates whether the syncing with the connector should be allowed or not
 | 
			
		||||
    pub fn should_force_sync_with_connector(self) -> bool {
 | 
			
		||||
        match self {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user