The following statements need to be evaluated if their content is not nil and submitted. The receiving end does not accept nil values.
:customer => {
if [email protected]? :first_name => @transaction.nome,
if [email protected]_name.nil? :last_name => @transaction.last_name,
if [email protected]_id.nil? :country_name => @transaction.nation.name
},
Without the condition a simple statement :first_name => @transaction.nome, is properly evaluated and the syntax with brackets and commas is proper. However, the introduction of the condition creates blanks in cases of nil values and generates a syntax error unexpected '}'.
How can this be overcome?