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

#SET("ReqFields", 0) #IF(#BillingCountryType==1 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") #IF(#Name EQ "Kl_HouseNo" OR #Name EQ "Kl_Street") {PleaseCorrectAddress} {ToAddressStep}
#ELSE {PleaseCorrectErrors}
#ENDIF #ELSE {Error}: #Message
#ENDIF #ENDLOOP

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

#ENDWITH_ERROR