Closed fredrik-stigsson closed 10 years ago
As far as I can tell the code does what it's supposed to do. Do you have an example on a case where it doesn't?
It will set the nationalIdNumber to the VAT-number or to an empty string. I got a InvalidCustomerData response or NationalId is missing response.
It will set CustomerId.NationalIdNumber to CustomerId.CompanyIdentity.CompanyVatNumber if CustomerId.CompanyIdentity.CompanyVatNumber isn't NULL. If CustomerId.CompanyIdentity.CompanyVatNumber is NULL it will set CustomerId.NationalIdNumber to CustomerId.NationalIdNumber. As I see it the only way to make it set CustomerId.NationalIdNumber to an empty string is to either specify CustomerId.CompanyIdentity.CompanyVatNumber or CustomerId.NationalIdNumber as "".
When I got the first error I had the VatNumber as "". Then I entered SE460814222201 as the VAT-number and got the second error.
Why do you want to set the VAT-number as the NationalId number? I think it is better to just remove those lines in the code. I have done that and it works fine.
Is this code for Germany and Holland? Should I not set the CustomerId.CompanyIdentity.CompanyVatNumber for customers with a NationalIdNumber?
In other words the code performed correctly since it wasn't NULL in the first case and 4608142222 would have been the correct formatting in the second case. All code in the integration package serves a purpose in talking with the internal systems at SveaWebpay so you can't just remove parts of the code and hope for the best.
No the code is for Swedish companied only: "if (CountryCode == CountryCode.SE".
Since this is obviously not a bug or code problem but rather an integration issue I would urge you to contact Svea Webpay on support-webpay@sveaekonomi.se instead.
Thank you for the email-address and thank you for taking the time to answer my questions.
The part that I have commented out does not provide a good result when it is running.
public override CreateOrderBuilder SetCountryCode(CountryCode countryCode) { CountryCode = countryCode; if (CustomerId != null) { CustomerId.CountryCode = countryCode.ToString().ToUpper();