mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	feat(connector): [BOA/CYBERSOURCE] Fix Status Mapping for Terminal St… (#3031)
This commit is contained in:
		| @ -442,11 +442,18 @@ impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus { | |||||||
|             | BankofamericaPaymentStatus::AuthorizedPendingReview => { |             | BankofamericaPaymentStatus::AuthorizedPendingReview => { | ||||||
|                 if auto_capture { |                 if auto_capture { | ||||||
|                     // Because BankOfAmerica will return Payment Status as Authorized even in AutoCapture Payment |                     // Because BankOfAmerica will return Payment Status as Authorized even in AutoCapture Payment | ||||||
|                     Self::Pending |                     Self::Charged | ||||||
|                 } else { |                 } else { | ||||||
|                     Self::Authorized |                     Self::Authorized | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  |             BankofamericaPaymentStatus::Pending => { | ||||||
|  |                 if auto_capture { | ||||||
|  |                     Self::Charged | ||||||
|  |                 } else { | ||||||
|  |                     Self::Pending | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|             BankofamericaPaymentStatus::Succeeded | BankofamericaPaymentStatus::Transmitted => { |             BankofamericaPaymentStatus::Succeeded | BankofamericaPaymentStatus::Transmitted => { | ||||||
|                 Self::Charged |                 Self::Charged | ||||||
|             } |             } | ||||||
| @ -456,7 +463,6 @@ impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus { | |||||||
|             BankofamericaPaymentStatus::Failed | BankofamericaPaymentStatus::Declined => { |             BankofamericaPaymentStatus::Failed | BankofamericaPaymentStatus::Declined => { | ||||||
|                 Self::Failure |                 Self::Failure | ||||||
|             } |             } | ||||||
|             BankofamericaPaymentStatus::Pending => Self::Pending, |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -670,8 +670,9 @@ pub struct ApplicationInformation { | |||||||
|  |  | ||||||
| fn get_payment_status(is_capture: bool, status: enums::AttemptStatus) -> enums::AttemptStatus { | fn get_payment_status(is_capture: bool, status: enums::AttemptStatus) -> enums::AttemptStatus { | ||||||
|     let is_authorized = matches!(status, enums::AttemptStatus::Authorized); |     let is_authorized = matches!(status, enums::AttemptStatus::Authorized); | ||||||
|     if is_capture && is_authorized { |     let is_pending = matches!(status, enums::AttemptStatus::Pending); | ||||||
|         return enums::AttemptStatus::Pending; |     if is_capture && (is_authorized || is_pending) { | ||||||
|  |         return enums::AttemptStatus::Charged; | ||||||
|     } |     } | ||||||
|     status |     status | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 DEEPANSHU BANSAL
					DEEPANSHU BANSAL