Skip to content

Commit 5642fef

Browse files
authored
fix(connector): Add attempt_status in field in error_response (#2794)
1 parent 6678689 commit 5642fef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+140
-15
lines changed

connector-template/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ impl ConnectorCommon for {{project-name | downcase | pascal_case}} {
105105
code: response.code,
106106
message: response.message,
107107
reason: response.reason,
108+
attempt_status: None,
108109
})
109110
}
110111
}

crates/router/src/connector/aci.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ impl ConnectorCommon for Aci {
7878
.collect::<Vec<String>>()
7979
.join("; ")
8080
}),
81+
attempt_status: None,
8182
})
8283
}
8384
}

crates/router/src/connector/adyen.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ impl ConnectorCommon for Adyen {
7373
code: response.error_code,
7474
message: response.message,
7575
reason: None,
76+
attempt_status: None,
7677
})
7778
}
7879
}
@@ -251,6 +252,7 @@ impl
251252
code: response.error_code,
252253
message: response.message,
253254
reason: None,
255+
attempt_status: None,
254256
})
255257
}
256258
}
@@ -366,6 +368,7 @@ impl
366368
code: response.error_code,
367369
message: response.message,
368370
reason: None,
371+
attempt_status: None,
369372
})
370373
}
371374
}
@@ -533,6 +536,7 @@ impl
533536
code: response.error_code,
534537
message: response.message,
535538
reason: None,
539+
attempt_status: None,
536540
})
537541
}
538542

@@ -699,6 +703,7 @@ impl
699703
code: response.error_code,
700704
message: response.message,
701705
reason: None,
706+
attempt_status: None,
702707
})
703708
}
704709
}
@@ -896,6 +901,7 @@ impl
896901
code: response.error_code,
897902
message: response.message,
898903
reason: None,
904+
attempt_status: None,
899905
})
900906
}
901907
}
@@ -1399,6 +1405,7 @@ impl services::ConnectorIntegration<api::Execute, types::RefundsData, types::Ref
13991405
code: response.error_code,
14001406
message: response.message,
14011407
reason: None,
1408+
attempt_status: None,
14021409
})
14031410
}
14041411
}

crates/router/src/connector/adyen/transformers.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,6 +2900,7 @@ pub fn get_adyen_response(
29002900
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
29012901
reason: response.refusal_reason,
29022902
status_code,
2903+
attempt_status: None,
29032904
})
29042905
} else {
29052906
None
@@ -2991,6 +2992,7 @@ pub fn get_redirection_response(
29912992
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
29922993
reason: None,
29932994
status_code,
2995+
attempt_status: None,
29942996
})
29952997
} else {
29962998
None
@@ -3052,6 +3054,7 @@ pub fn get_present_to_shopper_response(
30523054
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
30533055
reason: None,
30543056
status_code,
3057+
attempt_status: None,
30553058
})
30563059
} else {
30573060
None
@@ -3101,6 +3104,7 @@ pub fn get_qr_code_response(
31013104
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
31023105
reason: None,
31033106
status_code,
3107+
attempt_status: None,
31043108
})
31053109
} else {
31063110
None
@@ -3138,6 +3142,7 @@ pub fn get_redirection_error_response(
31383142
message: response.refusal_reason.clone(),
31393143
reason: Some(response.refusal_reason),
31403144
status_code,
3145+
attempt_status: None,
31413146
});
31423147
// We don't get connector transaction id for redirections in Adyen.
31433148
let payments_response_data = types::PaymentsResponseData::TransactionResponse {

crates/router/src/connector/airwallex.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ impl ConnectorCommon for Airwallex {
9393
code: response.code,
9494
message: response.message,
9595
reason: response.source,
96+
attempt_status: None,
9697
})
9798
}
9899
}

crates/router/src/connector/authorizedotnet.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,13 +893,15 @@ fn get_error_response(
893893
message: error.error_text.to_owned(),
894894
reason: Some(error.error_text),
895895
status_code,
896+
attempt_status: None,
896897
})
897898
})
898899
.unwrap_or_else(|| types::ErrorResponse {
899900
code: consts::NO_ERROR_CODE.to_string(), // authorizedotnet sends 200 in case of bad request so this are hard coded to NO_ERROR_CODE and NO_ERROR_MESSAGE
900901
message: consts::NO_ERROR_MESSAGE.to_string(),
901902
reason: None,
902903
status_code,
904+
attempt_status: None,
903905
})),
904906
Some(authorizedotnet::TransactionResponse::AuthorizedotnetTransactionResponseError(_))
905907
| None => {
@@ -909,6 +911,7 @@ fn get_error_response(
909911
message: message.to_string(),
910912
reason: Some(message.to_string()),
911913
status_code,
914+
attempt_status: None,
912915
})
913916
}
914917
}

crates/router/src/connector/authorizedotnet/transformers.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ impl<F, T>
573573
message: error.error_text.clone(),
574574
reason: None,
575575
status_code: item.http_code,
576+
attempt_status: None,
576577
})
577578
});
578579
let metadata = transaction_response
@@ -647,6 +648,7 @@ impl<F, T>
647648
message: error.error_text.clone(),
648649
reason: None,
649650
status_code: item.http_code,
651+
attempt_status: None,
650652
})
651653
});
652654
let metadata = transaction_response
@@ -789,6 +791,7 @@ impl<F> TryFrom<types::RefundsResponseRouterData<F, AuthorizedotnetRefundRespons
789791
message: error.error_text.clone(),
790792
reason: None,
791793
status_code: item.http_code,
794+
attempt_status: None,
792795
})
793796
});
794797

@@ -1021,6 +1024,7 @@ fn get_err_response(status_code: u16, message: ResponseMessages) -> types::Error
10211024
message: message.message[0].text.clone(),
10221025
reason: None,
10231026
status_code,
1027+
attempt_status: None,
10241028
}
10251029
}
10261030

crates/router/src/connector/bambora.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ impl ConnectorCommon for Bambora {
9595
code: response.code.to_string(),
9696
message: response.message,
9797
reason: Some(serde_json::to_string(&response.details).unwrap_or_default()),
98+
attempt_status: None,
9899
})
99100
}
100101
}

crates/router/src/connector/bankofamerica.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ impl ConnectorCommon for Bankofamerica {
111111
code: response.code,
112112
message: response.message,
113113
reason: response.reason,
114+
attempt_status: None,
114115
})
115116
}
116117
}

crates/router/src/connector/bitpay.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ impl ConnectorCommon for Bitpay {
120120
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
121121
message: response.error,
122122
reason: response.message,
123+
attempt_status: None,
123124
})
124125
}
125126
}

0 commit comments

Comments
 (0)