internal static Response ConvertTo(VoidResponse voidResponse) { var response = new Response(); voidResponse.WriteBaseProperties(response); var properties = new List <PaymentProperty>(); if (response.Properties != null) { properties.AddRange(response.Properties); } var voidRespnseProperties = new List <PaymentProperty>(); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.CardType, voidResponse.CardType); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.Last4Digits, voidResponse.Last4Digit); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.UniqueCardId, voidResponse.UniqueCardId); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.ProviderTransactionId, voidResponse.ProviderTransactionId); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.ResponseCode, voidResponse.ResponseCode); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.CurrencyCode, voidResponse.CurrencyCode); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.VoidResult, voidResponse.VoidResult); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.ProviderMessage, voidResponse.ProviderMessage); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.TransactionType, voidResponse.TransactionType); PaymentUtilities.AddPropertyIfPresent(voidRespnseProperties, GenericNamespace.VoidResponse, VoidResponseProperties.TransactionDateTime, voidResponse.TransactionDateTime); properties.Add(new PaymentProperty(GenericNamespace.VoidResponse, VoidResponseProperties.Properties, voidRespnseProperties.ToArray())); response.Properties = properties.ToArray(); return(response); }
internal static Response ConvertTo(GenerateCardTokenResponse tokenizeResponse) { var response = new Response(); tokenizeResponse.WriteBaseProperties(response); var properties = new List <PaymentProperty>(); if (response.Properties != null) { properties.AddRange(response.Properties); } PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.CardType, tokenizeResponse.CardType); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.Last4Digits, tokenizeResponse.Last4Digit); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.CardToken, tokenizeResponse.CardToken); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.UniqueCardId, tokenizeResponse.UniqueCardId); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.ExpirationYear, tokenizeResponse.ExpirationYear); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.ExpirationMonth, tokenizeResponse.ExpirationMonth); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.Name, tokenizeResponse.Name); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.StreetAddress, tokenizeResponse.StreetAddress); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.StreetAddress2, tokenizeResponse.StreetAddress2); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.City, tokenizeResponse.City); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.State, tokenizeResponse.State); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.PostalCode, tokenizeResponse.PostalCode); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.Country, tokenizeResponse.Country); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.Phone, tokenizeResponse.Phone); PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.PaymentCard, PaymentCardProperties.AccountType, tokenizeResponse.AccountType); properties.AddRange(tokenizeResponse.OtherCardProperties); response.Properties = properties.ToArray(); return(response); }
internal static Response ConvertTo(GetPaymentAcceptPointResponse acceptPointResponse) { var response = new Response(); acceptPointResponse.WriteBaseProperties(response); var properties = new List <PaymentProperty>(); if (response.Properties != null) { properties.AddRange(response.Properties); } PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.TransactionData, TransactionDataProperties.PaymentAcceptUrl, acceptPointResponse.PaymentAcceptUrl); response.Properties = properties.ToArray(); return(response); }
internal static Response ConvertTo(AuthorizeResponse authorizeResponse) { var response = new Response(); authorizeResponse.WriteBaseProperties(response); var properties = new List <PaymentProperty>(); if (response.Properties != null) { properties.AddRange(response.Properties); } var authorizationRespnseProperties = new List <PaymentProperty>(); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.CardType, authorizeResponse.CardType); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.IsSwiped, authorizeResponse.IsSwipe.ToString()); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.Last4Digits, authorizeResponse.Last4Digit); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.CardToken, authorizeResponse.CardToken); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.UniqueCardId, authorizeResponse.UniqueCardId); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.VoiceAuthorizationCode, authorizeResponse.VoiceAuthorizationCode); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.CashBackAmount, authorizeResponse.CashBackAmount); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.AccountType, authorizeResponse.AccountType); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.ProviderTransactionId, authorizeResponse.ProviderTransactionId); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.ApprovalCode, authorizeResponse.ApprovalCode); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.ResponseCode, authorizeResponse.ResponseCode); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.ApprovedAmount, authorizeResponse.ApprovedAmount); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.CurrencyCode, authorizeResponse.CurrencyCode); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.AuthorizationResult, authorizeResponse.AuthorizationResult); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.ProviderMessage, authorizeResponse.ProviderMessage); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.AVSResult, authorizeResponse.AVSResult); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.AVSDetail, authorizeResponse.AVSDetail); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.CVV2Result, authorizeResponse.CVV2Result); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.AvailableBalance, authorizeResponse.AvailableBalance); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.TransactionType, authorizeResponse.TransactionType); PaymentUtilities.AddPropertyIfPresent(authorizationRespnseProperties, GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.TransactionDateTime, authorizeResponse.TransactionDateTime); properties.Add(new PaymentProperty(GenericNamespace.AuthorizationResponse, AuthorizationResponseProperties.Properties, authorizationRespnseProperties.ToArray())); response.Properties = properties.ToArray(); return(response); }