Beispiel #1
0
            internal static Response ConvertTo(RefundResponse refundResponse)
            {
                var response = new Response();

                refundResponse.WriteBaseProperties(response);

                var properties = new List <PaymentProperty>();

                if (response.Properties != null)
                {
                    properties.AddRange(response.Properties);
                }

                var refundRespnseProperties = new List <PaymentProperty>();

                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.CardType, refundResponse.CardType);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.Last4Digits, refundResponse.Last4Digit);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.CardToken, refundResponse.CardToken);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.UniqueCardId, refundResponse.UniqueCardId);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.ProviderTransactionId, refundResponse.ProviderTransactionId);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.ApprovalCode, refundResponse.ApprovalCode);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.ResponseCode, refundResponse.ResponseCode);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.ApprovedAmount, refundResponse.ApprovedAmount);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.CurrencyCode, refundResponse.CurrencyCode);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.RefundResult, refundResponse.RefundResult);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.ProviderMessage, refundResponse.ProviderMessage);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.TransactionType, refundResponse.TransactionType);
                PaymentUtilities.AddPropertyIfPresent(refundRespnseProperties, GenericNamespace.RefundResponse, RefundResponseProperties.TransactionDateTime, refundResponse.TransactionDateTime);
                properties.Add(new PaymentProperty(GenericNamespace.RefundResponse, RefundResponseProperties.Properties, refundRespnseProperties.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);
            }
Beispiel #3
0
            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);
                PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.TransactionData, TransactionDataProperties.PaymentAcceptSubmitUrl, acceptPointResponse.PaymentAcceptSubmitUrl);
                PaymentUtilities.AddPropertyIfPresent(properties, GenericNamespace.TransactionData, TransactionDataProperties.PaymentAcceptMessageOrigin, acceptPointResponse.PaymentAcceptMessageOrigin);

                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);
                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);
            }