/// <summary> /// Verifies if the authorization was declined or not. /// </summary> /// <param name="response">Authorization response.</param> /// <returns>If the authorization was declined or not.</returns> private bool WasDeclined(AcceptorAuthorisationResponse response) { if (response == null) { return(true); } return(response.Data.AuthorisationResponse.TransactionResponse.AuthorisationResult.ResponseToAuthorisation.Response != ResponseCode.Approved); }
/// <summary> /// Gets the message returned by the POI in case of a declined authorization. /// </summary> /// <param name="response">Response from the POI.</param> /// <returns>Declining message.</returns> private string GetDeclinedMessage(AcceptorAuthorisationResponse response) { if (response == null) { return(""); } return(string.Format("{0} (ERRO: {1})", response.Data.AuthorisationResponse.TransactionResponse.AuthorisationResult.ResponseToAuthorisation.ResponseReason, (int)response.Data.AuthorisationResponse.TransactionResponse.AuthorisationResult.ResponseToAuthorisation.Response)); }