I am a great fan of expl3 and its property 'variable' feature, i.e. a key - based storage of data. As long as the amount of keys is not too large prop lists are very convenient.
A key might be FirstName or Zip.
The macro \StoreInvoiceData stores the keys given as FirstName=foo, IBAN=US345342342 etc into the relevant key slot of the property list, named \g_sam_invoice_prop here. The key-value-interface of the macro must not be confused with the keys of the property list, although the storage mechanism in the background is identical. The key= name is the same as the property key name, this is not mandatory but convenient in order to remember the names.
The order of specification does not matter at all.
Use \GetInvoiceData{foo} for example in order to extract the value of the foo key.
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\prop_new:N \g_sam_invoice_prop
\cs_new:Nn \sam_store_property:nn {
\prop_gput:Nnn \g_sam_invoice_prop {#1} {#2}
}
%Defining key-value interface
\keys_define:nn {saminvoice} {
Street .code:n = {\sam_store_property:nn {Street}{#1} },
Number .code:n = {\sam_store_property:nn {Number}{#1} },
Zip .code:n = {\sam_store_property:nn {Zip}{#1} },
Country .code:n = {\sam_store_property:nn {Country}{#1} },
FirstName .code:n = {\sam_store_property:nn {FirstName}{#1} },
SecondName .code:n = {\sam_store_property:nn {SecondName}{#1} },
IBAN .code:n = {\sam_store_property:nn {IBAN}{#1} },
BIC .code:n = {\sam_store_property:nn {BIC}{#1} },
}
\NewDocumentCommand{\StoreInvoiceData}{+m}{
\prop_gclear:N \g_sam_invoice_prop% Clearing the property list
% Set the keys
\keys_set:nn {saminvoice}{#1}
}
\NewDocumentCommand{\GetInvoiceData}{m}{
\prop_if_in:NnTF \g_sam_invoice_prop {#1}
{% True
\prop_item:Nn \g_sam_invoice_prop {#1}% Extract the key #1 from the property list
}{% False
Unknown
}
}
\ExplSyntaxOff
\begin{document}
\StoreInvoiceData{FirstName=Gandalf,SecondName={The Grey},Zip={The Nine},Country={Middle Earth}, IBAN={MORDOR6.60-34}}
This is an invoice for \GetInvoiceData{FirstName}\ \GetInvoiceData{SecondName} about the manufacturing and delivery of 100 Mage staffs. Please pay to \GetInvoiceData{IBAN}
\end{document}

Version for checking whether a key is given
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\prop_new:N \g_sam_invoice_prop
\cs_new:Nn \sam_store_property:nn {
\prop_gput:Nnn \g_sam_invoice_prop {#1} {#2}
}
%Defining key-value interface
\keys_define:nn {saminvoice} {
Street .code:n = {\sam_store_property:nn {Street}{#1} },
Number .code:n = {\sam_store_property:nn {Number}{#1} },
Zip .code:n = {\sam_store_property:nn {Zip}{#1} },
Country .code:n = {\sam_store_property:nn {Country}{#1} },
FirstName .code:n = {\sam_store_property:nn {FirstName}{#1} },
SecondName .code:n = {\sam_store_property:nn {SecondName}{#1} },
IBAN .code:n = {\sam_store_property:nn {IBAN}{#1} },
BIC .code:n = {\sam_store_property:nn {BIC}{#1} },
CompanyName .code:n= {\sam_store_property:nn {CompanyName}{#1} },
ClientName .code:n= {\sam_store_property:nn {ClientName}{#1} }
}
\NewDocumentCommand{\StoreInvoiceData}{+m}{
\prop_gclear:N \g_sam_invoice_prop% Clearing the property list
% Set the keys
\keys_set:nn {saminvoice}{#1}
}
\NewDocumentCommand{\GetInvoiceData}{m}{
\prop_if_in:NnTF \g_sam_invoice_prop {#1}
{% True
\prop_item:Nn \g_sam_invoice_prop {#1}% Extract the key #1 from the property list
}{% False
Unknown
}
}
% Normally better with a \prg_new_condiditional:, but for simplicity
% Check if the field is given and execute #2 for true case, otherwise #3
\NewDocumentCommand{\IfInvoiceFieldGivenTF}{m+m+m}{%
\prop_if_in:NnTF \g_sam_invoice_prop {
#1% Check to check
}{% True #2
#2
}{% False
#3
}
}% End of \IfInVoiceFieldGivenT
% Do something only if #1 is given
\NewDocumentCommand{\IfInvoiceFieldGivenT}{m+m}{%
\prop_if_in:NnT \g_sam_invoice_prop {
#1% Check to check
}{% True #2
#2
}%
}% End of \IfInVoiceFieldGivenT
\ExplSyntaxOff
\begin{document}
\StoreInvoiceData{FirstName=Gandalf,SecondName={The Grey},Zip={The Nine},Country={Middle Earth}, IBAN={MORDOR6.60-34},CompanyName={LembasBread Ltd.}, ClientName={Elrond}}
This is an invoice for \GetInvoiceData{FirstName}\ \GetInvoiceData{SecondName} about the manufacturing and delivery of 100 Mage staffs. Please pay to \GetInvoiceData{IBAN}
\textbf{Long version:}
\IfInvoiceFieldGivenTF{CompanyName}{%
\GetInvoiceData{CompanyName} c/o \GetInvoiceData{ClientName}
}{%
\GetInvoiceData{ClientName}%
}%
\textbf{Short version:}
\IfInvoiceFieldGivenT{CompanyName}{%
\GetInvoiceData{CompanyName} c/o{}% Extra space on purpose here
}
\GetInvoiceData{ClientName}
Clearing Data
\StoreInvoiceData{FirstName=Gandalf,SecondName={The Grey},Zip={The Nine},Country={Middle Earth}, IBAN={MORDOR6.60-34},ClientName={Elrond}}
\textbf{Long version:}
\IfInvoiceFieldGivenTF{CompanyName}{%
\GetInvoiceData{CompanyName} c/o \GetInvoiceData{ClientName}
}{%
\GetInvoiceData{ClientName}%
}%
\textbf{Short version:}
\IfInvoiceFieldGivenT{CompanyName}{%
\GetInvoiceData{CompanyName} c/o{}% Extra space on purpose here
}
\GetInvoiceData{ClientName}
\end{document}

\newcommand\name[1]{\def\@name{#1}}? Then you can use\@nameto refer to the author's name from within the class file. – Ian Thompson Aug 02 '17 at 13:48