mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
feat(connector): [BANKOFAMERICA] PSYNC Bugfix (#2897)
This commit is contained in:
@ -273,7 +273,8 @@ pub enum BankofamericaPaymentStatus {
|
||||
impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus {
|
||||
fn foreign_from((status, auto_capture): (BankofamericaPaymentStatus, bool)) -> Self {
|
||||
match status {
|
||||
BankofamericaPaymentStatus::Authorized => {
|
||||
BankofamericaPaymentStatus::Authorized
|
||||
| BankofamericaPaymentStatus::AuthorizedPendingReview => {
|
||||
if auto_capture {
|
||||
// Because BankOfAmerica will return Payment Status as Authorized even in AutoCapture Payment
|
||||
Self::Pending
|
||||
@ -281,7 +282,6 @@ impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus {
|
||||
Self::Authorized
|
||||
}
|
||||
}
|
||||
BankofamericaPaymentStatus::AuthorizedPendingReview => Self::Authorized,
|
||||
BankofamericaPaymentStatus::Succeeded | BankofamericaPaymentStatus::Transmitted => {
|
||||
Self::Charged
|
||||
}
|
||||
@ -321,7 +321,7 @@ pub struct BankOfAmericaErrorInformationResponse {
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct BankOfAmericaErrorInformation {
|
||||
reason: Option<String>,
|
||||
message: String,
|
||||
message: Option<String>,
|
||||
}
|
||||
|
||||
impl<F>
|
||||
@ -369,7 +369,10 @@ impl<F>
|
||||
BankOfAmericaPaymentsResponse::ErrorInformation(error_response) => Ok(Self {
|
||||
response: Err(types::ErrorResponse {
|
||||
code: consts::NO_ERROR_CODE.to_string(),
|
||||
message: error_response.error_information.message,
|
||||
message: error_response
|
||||
.error_information
|
||||
.message
|
||||
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
|
||||
reason: error_response.error_information.reason,
|
||||
status_code: item.http_code,
|
||||
attempt_status: None,
|
||||
@ -422,7 +425,10 @@ impl<F>
|
||||
BankOfAmericaPaymentsResponse::ErrorInformation(error_response) => Ok(Self {
|
||||
response: Err(types::ErrorResponse {
|
||||
code: consts::NO_ERROR_CODE.to_string(),
|
||||
message: error_response.error_information.message,
|
||||
message: error_response
|
||||
.error_information
|
||||
.message
|
||||
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
|
||||
reason: error_response.error_information.reason,
|
||||
status_code: item.http_code,
|
||||
attempt_status: None,
|
||||
@ -475,7 +481,10 @@ impl<F>
|
||||
BankOfAmericaPaymentsResponse::ErrorInformation(error_response) => Ok(Self {
|
||||
response: Err(types::ErrorResponse {
|
||||
code: consts::NO_ERROR_CODE.to_string(),
|
||||
message: error_response.error_information.message,
|
||||
message: error_response
|
||||
.error_information
|
||||
.message
|
||||
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
|
||||
reason: error_response.error_information.reason,
|
||||
status_code: item.http_code,
|
||||
attempt_status: None,
|
||||
|
||||
Reference in New Issue
Block a user