sveawebpay / dotnet-integration

SDK for Sveas standalone payment methods
Other
5 stars 14 forks source link

Method GetIpAddress() should be in Customer. #11

Closed irkush closed 11 years ago

irkush commented 11 years ago

At the moment the GetIpAddress() is located in the sub-classes IndividualCustomer and CompanyCustomer.

This forces an unneccessary cast which can be easily avoided.

if (order.GetIsCompanyIdentity())
            {
                if (order.GetCompanyCustomer().GetIpAddress() != null)
                {
                    WriteSimpleElement("ipaddress", order.GetCompanyCustomer().GetIpAddress());
                }
            }
            else
            {
                if (order.GetIndividualCustomer().GetIpAddress() != null)
                {
                    WriteSimpleElement("ipaddress", order.GetIndividualCustomer().GetIpAddress());
                }
            }
Sinsabre commented 11 years ago

Solved in b09f10fbf80d8b0f4db01071e08ea83c72e3c4e0