function processForm(req, paymentForm, viewFormData) {
  const isCreditCard = req.form.brandCode === 'scheme';
  const creditCardErrors = getCreditCardErrors(req, isCreditCard, paymentForm);

  if (Object.keys(creditCardErrors).length) {
    return {
      fieldErrors: creditCardErrors,
      error: true,
    };
  }

  setSessionPrivacy(paymentForm);
  const { adyenPaymentMethod = null, adyenIssuerName = null } = req.form;
  const storedPaymentUUID = getStoredPaymentUUID(paymentForm);

  const viewData = getViewData(
    viewFormData,
    paymentForm,
    isCreditCard,
    adyenPaymentMethod,
    adyenIssuerName,
    storedPaymentUUID,
  );

  return getProcessFormResult(storedPaymentUUID, req, viewData);
}
/**
 * Verifies the required information for billing form is provided.
 * @param {Object} req - The request object
 * @param {Object} paymentForm - the payment form
 * @param {Object} viewFormData - object contains billing form data
 * @returns {Object} an object that has error information or payment information
 */
Verifies the required information for billing form is provided.
@param {Object} req - The request object
@param {Object} paymentForm - the payment form
@param {Object} viewFormData - object contains billing form data
@returns {Object} an object that has error information or payment information
Verifies the required information for billing form is provided . @param { Object } req - The request object @param { Object } paymentForm - the payment form @param { Object } viewFormData - object contains billing form data @returns { Object } an object that has error information or payment information
function processForm(req, paymentForm, viewFormData) {
  const isCreditCard = req.form.brandCode === 'scheme';
  const creditCardErrors = getCreditCardErrors(req, isCreditCard, paymentForm);
  if (Object.keys(creditCardErrors).length) {
    return {
      fieldErrors: creditCardErrors,
      error: true,
    };
  }
  setSessionPrivacy(paymentForm);
  const { adyenPaymentMethod = null, adyenIssuerName = null } = req.form;
  const storedPaymentUUID = getStoredPaymentUUID(paymentForm);
  const viewData = getViewData(
    viewFormData,
    paymentForm,
    isCreditCard,
    adyenPaymentMethod,
    adyenIssuerName,
    storedPaymentUUID,
  );
  return getProcessFormResult(storedPaymentUUID, req, viewData);
}
function processForm ( req , paymentForm , viewFormData ) { const isCreditCard = req . form . brandCode === 'scheme' ; const creditCardErrors = getCreditCardErrors ( req , isCreditCard , paymentForm ) ; if ( Object . keys ( creditCardErrors ) . length ) { return { fieldErrors : creditCardErrors , error : true , } ; } setSessionPrivacy ( paymentForm ) ; const { adyenPaymentMethod = null , adyenIssuerName = null } = req . form ; const storedPaymentUUID = getStoredPaymentUUID ( paymentForm ) ; const viewData = getViewData ( viewFormData , paymentForm , isCreditCard , adyenPaymentMethod , adyenIssuerName , storedPaymentUUID , ) ; return getProcessFormResult ( storedPaymentUUID , req , viewData ) ; }
Verifies the required information for billing form is provided.
Verifies the required information for billing form is provided .