def create_customer(payment_method, customer)
      unless get_valid?
        return make_response_with_exception(Exceptions::APIKeyInvalidException.new('API key, password or Rapid endpoint missing or invalid'), CreateCustomerResponse)
      end
      begin
        case payment_method
        when Enums::PaymentMethod::DIRECT
          url = @web_url + Constants::DIRECT_PAYMENT_METHOD_NAME + Constants::JSON_SUFFIX

          request = Message::CustomerProcess::CustDirectPaymentMsgProcess.create_request(customer)
          response = Message::CustomerProcess::CustDirectPaymentMsgProcess.send_request(url, @api_key, @password, @version, request)
          Message::CustomerProcess::CustDirectPaymentMsgProcess.make_result(response)
        when Enums::PaymentMethod::RESPONSIVE_SHARED
          url = @web_url + Constants::RESPONSIVE_SHARED_METHOD_NAME + Constants::JSON_SUFFIX

          request = Message::CustomerProcess::CustResponsiveSharedMsgProcess.create_request(customer)
          response = Message::CustomerProcess::CustResponsiveSharedMsgProcess.send_request(url, @api_key, @password, @version, request)
          Message::CustomerProcess::CustResponsiveSharedMsgProcess.make_result(response)
        when Enums::PaymentMethod::TRANSPARENT_REDIRECT
          url = @web_url + Constants::TRANSPARENT_REDIRECT_METHOD_NAME + Constants::JSON_SUFFIX

          request = Message::CustomerProcess::CustTransparentRedirectMsgProcess.create_request(customer)
          response = Message::CustomerProcess::CustTransparentRedirectMsgProcess.send_request(url, @api_key, @password, @version, request)
          Message::CustomerProcess::CustTransparentRedirectMsgProcess.make_result(response)
        else
          make_response_with_exception(Exceptions::ParameterInvalidException.new('Unsupported payment type'), CreateCustomerResponse)
        end
      rescue => e
        @logger.error(e.to_s) if @logger
        make_response_with_exception(e, CreateCustomerResponse)
      end
    end
def create_customer(payment_method, customer)
      unless get_valid?
        return make_response_with_exception(Exceptions::APIKeyInvalidException.new('API key, password or Rapid endpoint missing or invalid'), CreateCustomerResponse)
      end
      begin
        case payment_method
        when Enums::PaymentMethod::DIRECT
          url = @web_url + Constants::DIRECT_PAYMENT_METHOD_NAME + Constants::JSON_SUFFIX

          request = Message::CustomerProcess::CustDirectPaymentMsgProcess.create_request(customer)
          response = Message::CustomerProcess::CustDirectPaymentMsgProcess.send_request(url, @api_key, @password, @version, request)
          Message::CustomerProcess::CustDirectPaymentMsgProcess.make_result(response)
        when Enums::PaymentMethod::RESPONSIVE_SHARED
          url = @web_url + Constants::RESPONSIVE_SHARED_METHOD_NAME + Constants::JSON_SUFFIX

          request = Message::CustomerProcess::CustResponsiveSharedMsgProcess.create_request(customer)
          response = Message::CustomerProcess::CustResponsiveSharedMsgProcess.send_request(url, @api_key, @password, @version, request)
          Message::CustomerProcess::CustResponsiveSharedMsgProcess.make_result(response)
        when Enums::PaymentMethod::TRANSPARENT_REDIRECT
          url = @web_url + Constants::TRANSPARENT_REDIRECT_METHOD_NAME + Constants::JSON_SUFFIX

          request = Message::CustomerProcess::CustTransparentRedirectMsgProcess.create_request(customer)
          response = Message::CustomerProcess::CustTransparentRedirectMsgProcess.send_request(url, @api_key, @password, @version, request)
          Message::CustomerProcess::CustTransparentRedirectMsgProcess.make_result(response)
        else
          make_response_with_exception(Exceptions::ParameterInvalidException.new('Unsupported payment type'), CreateCustomerResponse)
        end
      rescue => e
        @logger.error(e.to_s) if @logger
        make_response_with_exception(e, CreateCustomerResponse)
      end
    end
Creates a token customer to store card details in the secure eWAY Vault
 for charging later

 @param [Enums::PaymentMethod] payment_method Describes where the card details will be coming from for this transaction (Direct, Responsive Shared, Transparent Redirect etc).
 @param [Models::Customer] customer The customer's details
 @return [CreateCustomerResponse]