From 221ace79aa264bd6396a557a4d2511d9be51b287 Mon Sep 17 00:00:00 2001 From: Bradley Garrod Date: Wed, 23 Mar 2022 21:46:04 +0000 Subject: [PATCH] Add transaction decline reason 'Authentication rejected by cardholder' --- src/endpoints/transactions.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/endpoints/transactions.rs b/src/endpoints/transactions.rs index 783ae7f..44674ab 100644 --- a/src/endpoints/transactions.rs +++ b/src/endpoints/transactions.rs @@ -105,6 +105,9 @@ pub enum DeclineReason { /// Requires SCA StrongCustomerAuthenticationRequired, + /// Transaction declined by the cardholder + AuthenticationRejectedByCardholder, + /// All other errors Other, } @@ -348,6 +351,9 @@ mod tests { "##; serde_json::from_str::(raw).expect("couldn't decode Transaction from json"); + + let new = raw.replace("SCA_NOT_AUTHENTICATED_CARD_NOT_PRESENT", "AUTHENTICATION_REJECTED_BY_CARDHOLDER"); + serde_json::from_str::(&new).expect("couldn't decode Transaction from json"); } #[test]