{KlarnaPayment} #INCLUDE("INC-IsTestTransaction")

#SET("BillingCountryType", 0) #SET("RequiredGender", 0) #SET("RequiredBirthdate", 0) #SET("RequiredPhone", 0) #SET("RequiredAddress", 0) #SET("ReqFields", 0) #IF(#BillingAddress.Country.Code2 EQ "SE" OR #BillingAddress.Country.Code2 EQ "DK" OR #BillingAddress.Country.Code2 EQ "FI" OR #BillingAddress.Country.Code2 EQ "NO" ) #SET("BillingCountryType", 1) #ELSE #IF(NOT #DEFINED(#BillingAddress.Gender)) #SET("RequiredGender", 1) #ENDIF #IF(NOT #DEFINED(#BillingAddress.Birthday)) #SET("RequiredBirthdate", 1) #ENDIF #IF(#LineItemContainer.Payment.InternalMethod NGT 1 AND #BillingAddress.Country.Code2 EQ "DK") #SET("BillingCountryType", 2) #ELSE #SET("BillingCountryType", 3) #IF(NOT #DEFINED(#BillingAddress.Phone) AND (NOT #DEFINED(#BillingAddress.PhoneBusiness)) AND (NOT #DEFINED(#BillingAddress.PhoneCell)) AND (NOT #DEFINED(#BillingAddress.PhonePrivate)) ) #SET("RequiredPhone", 1) #ENDIF #IF((NOT (#Kl_Street)) OR (NOT (#Kl_HouseNo))) #SET("RequiredAddress", 1) #ENDIF #ENDIF #ENDIF #IF(#BillingCountryType==1 OR #BillingCountryType==2 OR #RequiredGender>0 OR #RequiredBirthdate>0 OR #RequiredPhone>0 OR #RequiredAddress>0) #SET("ReqFields", 1)

{StartPayment}

#ENDIF #WITH_ERROR(#FormError)
#IF(#FormError)

{Error}

#LOOP(#FormErrors.Errors) #IF(#Reason EQ "STRING_EMPTY" OR #Reason EQ "FORMAT_NOT_FLOAT" OR #Reason EQ "FORMAT_NOT_INTEGER") {PleaseCorrectErrors}
#ELSE {Error}: #Message
#ENDIF #ENDLOOP

#ENDIF #IF(#BillingAddress.Country.Code2 EQ "NL" AND #LineItemContainer.Payment.InternalMethod NE 1) #ENDIF
#IF(#ReqFields>0)
{KlarnaPayment}
#ENDIF #IF(#BillingCountryType==1) #ELSE #IF(#RequiredGender==1) #ENDIF #IF(#RequiredBirthdate==1) #ENDIF #ENDIF #IF(#BillingCountryType==2) #ENDIF #IF(#RequiredPhone==1) #ELSE #ENDIF #IF(#DEFINED(#Kl_IsFromGermany)) #ELSIF(#DEFINED(#Kl_IsFromNetherlands)) #ENDIF #IF(#RequiredAddress==1) #ELSE #ENDIF
{SSN} {MandatoryStar} #IF(#BillingAddress.Country.Code2 EQ "NO") {Example}: 25077090022 #ELSIF(#BillingAddress.Country.Code2 EQ "SE" OR #BillingAddress.Country.Code2 EQ "DK" ) {Example}: 700725-0199 #ELSIF(#BillingAddress.Country.Code2 EQ "FI") {Example}: 311280-999J #ELSE {Format}: yyyymmdd #ENDIF
{Gender} {MandatoryStar} {Male} {Female}
#SPACE[0]{Birthday} {MandatoryStar} {Example}: 31071970
{Salary} {MandatoryStar}
{Phone} {MandatoryStar}
{Street} {MandatoryStar}
#IF(#ReqFields>0)

{MandatoryFields}

#ENDIF

#ENDWITH_ERROR