@@ -14,18 +14,22 @@ class ShoppingCartController
1414 private const IN_NEXUS_DECLARATION_INDEX = 0 ;
1515
1616 // .RU / .xn--p1ai field indices
17- private const RU_CONTACT_TYPE_INDEX = 8 ; // Contact Type (display only)
18- private const RU_REGISTRANT_RESIDENCY_INDEX = 9 ; // Registrant Residency (display only)
19- private const RU_MOBILE_PHONE_COUNTRY_CODE_INDEX = 10 ; // all
20- private const RU_MOBILE_PHONE_NUMBER_INDEX = 11 ; // all
21- private const RU_POSTAL_ADDRESS_CITY_INDEX = 12 ; // all
22- private const RU_FIRST_NAME_CYRILLIC_INDEX = 18 ; // individual + ru
23- private const RU_LAST_NAME_CYRILLIC_INDEX = 20 ; // individual + ru
24- private const RU_COMPANY_NAME_CYRILLIC_INDEX = 32 ; // company + ru
25- private const RU_COMPANY_NAME_LATIN_INDEX = 33 ; // company
26- private const RU_LEGAL_ADDRESS_COUNTRY_CODE_INDEX = 34 ; // company
27- private const RU_LEGAL_ADDRESS_POSTAL_CODE_INDEX = 35 ; // company
28- private const RU_LEGAL_ADDRESS_CITY_INDEX = 36 ; // company
17+ private const RU_CONTACT_TYPE_INDEX = 8 ; // Contact Type (display only)
18+ private const RU_REGISTRANT_RESIDENCY_INDEX = 9 ; // Registrant Residency (display only)
19+ private const RU_MOBILE_PHONE_COUNTRY_CODE_INDEX = 10 ; // Mobile Phone CC all
20+ private const RU_MOBILE_PHONE_NUMBER_INDEX = 11 ; // Mobile Phone Number all
21+ private const RU_POSTAL_ADDRESS_CITY_INDEX = 12 ; // Postal Address City all
22+ private const RU_PASSPORT_SERIES_INDEX = 24 ; // Passport Series individual
23+ private const RU_PASSPORT_NUMBER_INDEX = 25 ; // Passport Number individual
24+ private const RU_PASSPORT_ISSUER_INDEX = 26 ; // Passport Issuer individual
25+ private const RU_PASSPORT_ISSUE_DATE_INDEX = 27 ; // Passport Issue Date individual
26+ private const RU_BIRTH_DATE_INDEX = 30 ; // Birth Date individual
27+ private const RU_COMPANY_NAME_CYRILLIC_INDEX = 32 ; // Company Name Cyrillic company + ru
28+ private const RU_COMPANY_NAME_LATIN_INDEX = 33 ; // Company Name Latin company
29+ private const RU_LEGAL_ADDRESS_COUNTRY_CODE_INDEX = 34 ; // Legal Address CC company
30+ private const RU_LEGAL_ADDRESS_POSTAL_CODE_INDEX = 35 ; // Legal Address PostCode company
31+ private const RU_LEGAL_ADDRESS_CITY_INDEX = 36 ; // Legal Address City company
32+ private const RU_TAX_PAYER_NUMBER_COMPANY_INDEX = 42 ; // Tax Payer Number INN company
2933
3034 private static array $ itFieldsMap = [
3135 7 => 'companyRegistrationNumber ' ,
@@ -263,10 +267,10 @@ private function validateRuContactTypeAtCheckout(array $vars): ?array
263267 $ contactType = $ effectiveContactType ;
264268 }
265269
266- // Validate shared mandatory fields ( all contact types, all residencies)
270+ // [10–12] Starred fields: all contact types, all residencies
267271 $ mobileCountryCode = trim ((string ) ($ fields [self ::RU_MOBILE_PHONE_COUNTRY_CODE_INDEX ] ?? '' ));
268- $ mobilePhoneNumber = trim ((string ) ($ fields [self ::RU_MOBILE_PHONE_NUMBER_INDEX ] ?? '' ));
269- $ postalCity = trim ((string ) ($ fields [self ::RU_POSTAL_ADDRESS_CITY_INDEX ] ?? '' ));
272+ $ mobilePhoneNumber = trim ((string ) ($ fields [self ::RU_MOBILE_PHONE_NUMBER_INDEX ] ?? '' ));
273+ $ postalCity = trim ((string ) ($ fields [self ::RU_POSTAL_ADDRESS_CITY_INDEX ] ?? '' ));
270274
271275 if ($ mobileCountryCode === '' || $ mobilePhoneNumber === '' || $ postalCity === '' ) {
272276 $ cartUrl = rtrim (Setting::getValue ('SystemURL ' ), '/ ' ) . '/cart.php?a=confdomains ' ;
@@ -276,36 +280,48 @@ private function validateRuContactTypeAtCheckout(array $vars): ?array
276280 ];
277281 }
278282
279- // Individual + Russian resident: First and Last Name in Cyrillic are required
280- if ($ contactType === 'individual ' && $ residency === 'ru ' ) {
281- $ firstNameCyrillic = trim ((string ) ($ fields [self ::RU_FIRST_NAME_CYRILLIC_INDEX ] ?? '' ));
282- $ lastNameCyrillic = trim ((string ) ($ fields [self ::RU_LAST_NAME_CYRILLIC_INDEX ] ?? '' ));
283-
284- if ($ firstNameCyrillic === '' || $ lastNameCyrillic === '' ) {
283+ // [24–28, 30] Starred fields: individual contacts (any residency)
284+ if ($ contactType === 'individual ' ) {
285+ $ passportSeries = trim ((string ) ($ fields [self ::RU_PASSPORT_SERIES_INDEX ] ?? '' ));
286+ $ passportNumber = trim ((string ) ($ fields [self ::RU_PASSPORT_NUMBER_INDEX ] ?? '' ));
287+ $ passportIssuer = trim ((string ) ($ fields [self ::RU_PASSPORT_ISSUER_INDEX ] ?? '' ));
288+ $ passportIssueDate = trim ((string ) ($ fields [self ::RU_PASSPORT_ISSUE_DATE_INDEX ] ?? '' ));
289+ $ birthDate = trim ((string ) ($ fields [self ::RU_BIRTH_DATE_INDEX ] ?? '' ));
290+
291+ if (
292+ $ passportSeries === '' || $ passportNumber === '' || $ passportIssuer === ''
293+ || $ passportIssueDate === '' || $ birthDate === ''
294+ ) {
285295 $ cartUrl = rtrim (Setting::getValue ('SystemURL ' ), '/ ' ) . '/cart.php?a=confdomains ' ;
286296 return [
287- 'error ' => 'To register ' . $ domainName . ' as a Russian resident individual, First Name and Last Name in Cyrillic are required. '
297+ 'error ' => 'To register ' . $ domainName . ' as an Individual, Passport Series, Passport Number, Passport Issuer, '
298+ . 'Passport Issue Date, and Birth Date are required. '
288299 . 'Please <a href=" ' . $ cartUrl . '">go back to the domain configuration step</a> and fill in the required fields. ' ,
289300 ];
290301 }
291302 }
292303
293- // Company contacts: Latin name and legal address are required (all residencies )
304+ // [33–36, 42] Starred fields: company contacts (any residency )
294305 if ($ contactType === 'company ' ) {
295306 $ companyNameLatin = trim ((string ) ($ fields [self ::RU_COMPANY_NAME_LATIN_INDEX ] ?? '' ));
296307 $ legalCountryCode = trim ((string ) ($ fields [self ::RU_LEGAL_ADDRESS_COUNTRY_CODE_INDEX ] ?? '' ));
297308 $ legalPostalCode = trim ((string ) ($ fields [self ::RU_LEGAL_ADDRESS_POSTAL_CODE_INDEX ] ?? '' ));
298309 $ legalCity = trim ((string ) ($ fields [self ::RU_LEGAL_ADDRESS_CITY_INDEX ] ?? '' ));
310+ $ taxPayerNumber = trim ((string ) ($ fields [self ::RU_TAX_PAYER_NUMBER_COMPANY_INDEX ] ?? '' ));
299311
300- if ($ companyNameLatin === '' || $ legalCountryCode === '' || $ legalPostalCode === '' || $ legalCity === '' ) {
312+ if (
313+ $ companyNameLatin === '' || $ legalCountryCode === '' || $ legalPostalCode === ''
314+ || $ legalCity === '' || $ taxPayerNumber === ''
315+ ) {
301316 $ cartUrl = rtrim (Setting::getValue ('SystemURL ' ), '/ ' ) . '/cart.php?a=confdomains ' ;
302317 return [
303- 'error ' => 'To register ' . $ domainName . ' as a Company, Company Name (Latin), Legal Address Country Code, Postal Code, and City are required. '
318+ 'error ' => 'To register ' . $ domainName . ' as a Company, Company Name (Latin), Legal Address Country Code, '
319+ . 'Postal Code, City, and Tax Payer Number (INN) are required. '
304320 . 'Please <a href=" ' . $ cartUrl . '">go back to the domain configuration step</a> and complete the required Company fields. ' ,
305321 ];
306322 }
307323
308- // Company + Russian resident: Company Name in Cyrillic is additionally required
324+ // [32] Company Name in Cyrillic additionally required for Russian residents
309325 if ($ residency === 'ru ' ) {
310326 $ companyNameCyrillic = trim ((string ) ($ fields [self ::RU_COMPANY_NAME_CYRILLIC_INDEX ] ?? '' ));
311327
0 commit comments