@@ -273,15 +273,15 @@ pub enum BankofamericaPaymentStatus {
273
273
impl ForeignFrom < ( BankofamericaPaymentStatus , bool ) > for enums:: AttemptStatus {
274
274
fn foreign_from ( ( status, auto_capture) : ( BankofamericaPaymentStatus , bool ) ) -> Self {
275
275
match status {
276
- BankofamericaPaymentStatus :: Authorized => {
276
+ BankofamericaPaymentStatus :: Authorized
277
+ | BankofamericaPaymentStatus :: AuthorizedPendingReview => {
277
278
if auto_capture {
278
279
// Because BankOfAmerica will return Payment Status as Authorized even in AutoCapture Payment
279
280
Self :: Pending
280
281
} else {
281
282
Self :: Authorized
282
283
}
283
284
}
284
- BankofamericaPaymentStatus :: AuthorizedPendingReview => Self :: Authorized ,
285
285
BankofamericaPaymentStatus :: Succeeded | BankofamericaPaymentStatus :: Transmitted => {
286
286
Self :: Charged
287
287
}
@@ -321,7 +321,7 @@ pub struct BankOfAmericaErrorInformationResponse {
321
321
#[ derive( Debug , Deserialize ) ]
322
322
pub struct BankOfAmericaErrorInformation {
323
323
reason : Option < String > ,
324
- message : String ,
324
+ message : Option < String > ,
325
325
}
326
326
327
327
impl < F >
@@ -369,7 +369,10 @@ impl<F>
369
369
BankOfAmericaPaymentsResponse :: ErrorInformation ( error_response) => Ok ( Self {
370
370
response : Err ( types:: ErrorResponse {
371
371
code : consts:: NO_ERROR_CODE . to_string ( ) ,
372
- message : error_response. error_information . message ,
372
+ message : error_response
373
+ . error_information
374
+ . message
375
+ . unwrap_or ( consts:: NO_ERROR_MESSAGE . to_string ( ) ) ,
373
376
reason : error_response. error_information . reason ,
374
377
status_code : item. http_code ,
375
378
attempt_status : None ,
@@ -422,7 +425,10 @@ impl<F>
422
425
BankOfAmericaPaymentsResponse :: ErrorInformation ( error_response) => Ok ( Self {
423
426
response : Err ( types:: ErrorResponse {
424
427
code : consts:: NO_ERROR_CODE . to_string ( ) ,
425
- message : error_response. error_information . message ,
428
+ message : error_response
429
+ . error_information
430
+ . message
431
+ . unwrap_or ( consts:: NO_ERROR_MESSAGE . to_string ( ) ) ,
426
432
reason : error_response. error_information . reason ,
427
433
status_code : item. http_code ,
428
434
attempt_status : None ,
@@ -475,7 +481,10 @@ impl<F>
475
481
BankOfAmericaPaymentsResponse :: ErrorInformation ( error_response) => Ok ( Self {
476
482
response : Err ( types:: ErrorResponse {
477
483
code : consts:: NO_ERROR_CODE . to_string ( ) ,
478
- message : error_response. error_information . message ,
484
+ message : error_response
485
+ . error_information
486
+ . message
487
+ . unwrap_or ( consts:: NO_ERROR_MESSAGE . to_string ( ) ) ,
479
488
reason : error_response. error_information . reason ,
480
489
status_code : item. http_code ,
481
490
attempt_status : None ,
0 commit comments