Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connector): [BANKOFAMERICA] PSYNC Bugfix #2897

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions crates/router/src/connector/bankofamerica/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,15 @@ 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
} else {
Self::Authorized
}
}
BankofamericaPaymentStatus::AuthorizedPendingReview => Self::Authorized,
BankofamericaPaymentStatus::Succeeded | BankofamericaPaymentStatus::Transmitted => {
Self::Charged
}
Expand Down Expand Up @@ -321,7 +321,7 @@ pub struct BankOfAmericaErrorInformationResponse {
#[derive(Debug, Deserialize)]
pub struct BankOfAmericaErrorInformation {
reason: Option<String>,
message: String,
message: Option<String>,
}

impl<F>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Loading