Check the payment for required fields and validity.
        @param payment: The payment dict
        @return: True if valid, error string if invalid paramaters where
        encountered.
972641
def check_payment(self, payment):
        
        validation = ""
        required = ["name", "IBAN", "BIC", "amount", "description"]

        for config_item in required:
            if config_item not in payment:
                validation += config_item.upper() + "_MISSING "

        if not isinstance(payment['amount'], int):
            validation += "AMOUNT_NOT_INTEGER "

        if 'execution_date' in payment:
            if not isinstance(payment['execution_date'], datetime.date):
                validation += "EXECUTION_DATE_INVALID_OR_NOT_DATETIME_INSTANCE"
            payment['execution_date'] = payment['execution_date'].isoformat()

        if validation == "":
            return True
        else:
            raise Exception('Payment did not validate: ' + validation)
1199278
def valid_sender?(ip)
      return true if OffsitePayments.mode == :test || production_ips.blank?
      production_ips.include?(ip)
    end
894723
def valid?(params, bool_response = true)
      requires params
      res = DataSift.request(:POST, 'push/validate', @config, params)
      bool_response ? res[:http][:status] == 200 : res
    end
832594
def valid?
      return false if @id.nil?
      return false if @date_first.nil?
      return false if @date_next.nil?
      return false if @frequency.nil?
      frequency_validator = EnumAttributeValidator.new('String', ['never', 'daily', 'weekly', 'everyOtherWeek', 'twiceAMonth', 'every4Weeks', 'monthly', 'everyOtherMonth', 'every3Months', 'every4Months', 'twiceAYear', 'yearly', 'everyOtherYear'])
      return false unless frequency_validator.valid?(@frequency)
      return false if @amount.nil?
      return false if @memo.nil?
      return false if @flag_color.nil?
      flag_color_validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
      return false unless flag_color_validator.valid?(@flag_color)
      return false if @account_id.nil?
      return false if @payee_id.nil?
      return false if @category_id.nil?
      return false if @transfer_account_id.nil?
      return false if @deleted.nil?
      return false if @account_name.nil?
      return false if @payee_name.nil?
      return false if @category_name.nil?
      return false if @subtransactions.nil?
      true
    end
1252972
def is_valid(self, context):
        
        if self.requires:
            for r in self.requires:
                if not r in context.executed_actions:
                    raise RequirementMissingError("Action '%s' requires '%s'" % (self.name, r))
        return True
1058333
def valid?
      field_validator = EnumAttributeValidator.new('String', ["DEFAULT", "CREATED_AT"])
      return false unless field_validator.valid?(@field)
      order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
      return false unless order_validator.valid?(@order)
      return true
    end
200601
def validate(self):
        
        required_fields = list(filter(lambda x: self._fields[x], self._fields.keys()))
        for field in (self._top_fields + required_fields):
            if not hasattr(self, field) or hasattr(self, field) and getattr(self, field) == None:
                raise MissingFieldError(field)
1127968
def valid?
      return false if @category.nil?
      category_validator = EnumAttributeValidator.new('String', ["API_ERROR", "AUTHENTICATION_ERROR", "INVALID_REQUEST_ERROR", "RATE_LIMIT_ERROR", "PAYMENT_METHOD_ERROR", "REFUND_ERROR"])
      return false unless category_validator.valid?(@category)
      return false if @code.nil?
      code_validator = EnumAttributeValidator.new('String', ["INTERNAL_SERVER_ERROR", "UNAUTHORIZED", "ACCESS_TOKEN_EXPIRED", "ACCESS_TOKEN_REVOKED", "FORBIDDEN", "INSUFFICIENT_SCOPES", "APPLICATION_DISABLED", "V1_APPLICATION", "V1_ACCESS_TOKEN", "CARD_PROCESSING_NOT_ENABLED", "BAD_REQUEST", "MISSING_REQUIRED_PARAMETER", "INCORRECT_TYPE", "INVALID_TIME", "INVALID_TIME_RANGE", "INVALID_VALUE", "INVALID_CURSOR", "UNKNOWN_QUERY_PARAMETER", "CONFLICTING_PARAMETERS", "EXPECTED_JSON_BODY", "INVALID_SORT_ORDER", "VALUE_REGEX_MISMATCH", "VALUE_TOO_SHORT", "VALUE_TOO_LONG", "VALUE_TOO_LOW", "VALUE_TOO_HIGH", "VALUE_EMPTY", "ARRAY_LENGTH_TOO_LONG", "ARRAY_LENGTH_TOO_SHORT", "ARRAY_EMPTY", "EXPECTED_BOOLEAN", "EXPECTED_INTEGER", "EXPECTED_FLOAT", "EXPECTED_STRING", "EXPECTED_OBJECT", "EXPECTED_ARRAY", "EXPECTED_MAP", "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", "INVALID_ARRAY_VALUE", "INVALID_ENUM_VALUE", "INVALID_CONTENT_TYPE", "INVALID_FORM_VALUE", "ONE_INSTRUMENT_EXPECTED", "NO_FIELDS_SET", "DEPRECATED_FIELD_SET", "CARD_EXPIRED", "INVALID_EXPIRATION", "INVALID_EXPIRATION_YEAR", "INVALID_EXPIRATION_DATE", "UNSUPPORTED_CARD_BRAND", "UNSUPPORTED_ENTRY_METHOD", "INVALID_ENCRYPTED_CARD", "INVALID_CARD", "DELAYED_TRANSACTION_EXPIRED", "DELAYED_TRANSACTION_CANCELED", "DELAYED_TRANSACTION_CAPTURED", "DELAYED_TRANSACTION_FAILED", "CARD_TOKEN_EXPIRED", "CARD_TOKEN_USED", "AMOUNT_TOO_HIGH", "UNSUPPORTED_INSTRUMENT_TYPE", "REFUND_AMOUNT_INVALID", "REFUND_ALREADY_PENDING", "PAYMENT_NOT_REFUNDABLE", "INVALID_CARD_DATA", "LOCATION_MISMATCH", "IDEMPOTENCY_KEY_REUSED", "UNEXPECTED_VALUE", "SANDBOX_NOT_SUPPORTED", "INVALID_EMAIL_ADDRESS", "INVALID_PHONE_NUMBER", "CHECKOUT_EXPIRED", "BAD_CERTIFICATE", "CARD_DECLINED", "VERIFY_CVV_FAILURE", "VERIFY_AVS_FAILURE", "CARD_DECLINED_CALL_ISSUER", "NOT_FOUND", "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "REQUEST_ENTITY_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "RATE_LIMITED", "NOT_IMPLEMENTED", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT"])
      return false unless code_validator.valid?(@code)
      return true
    end
793784
def is_valid(self):
        
        self.errors = []

        for field in self.get_all_field_names_declared_by_user():
            getattr(type(self), field).is_valid(self, type(self), field)
            field_errors = getattr(type(self), field).errors(self)
            self.errors.extend(field_errors)

        return len(self.errors) == 0
531684
def refundable?(options = {})
      @logger.debug("[refundable?] options=#{options.inspect}")

      validate_required_params!(options, :transaction_id)

      response = execute_request(:refund_info, options)
      response.refundable?
    end
799689
def is_valid(self):
        
        self._errors = []
        for field in self.fields:
            try:
                field.validate(self)
            except FieldValidationError, e:
                self._errors.extend(e.errors)
        self.validate()
        return not bool(self._errors)
376344
def verify_config(verbose=True):
    
    ok = True
    config = get_config()
    if not config.ready:
        config.load()
    # Check base_payment is correct
    try:
        base_pay = config.get("base_payment")
    except KeyError:
        log("✗ No value for base_pay.", delay=0, chevrons=False, verbose=verbose)
    else:
        dollarFormat = "{:.2f}".format(base_pay)

        if base_pay <= 0:
            log(
                "✗ base_payment must be positive value in config.txt.",
                delay=0,
                chevrons=False,
                verbose=verbose,
            )
            ok = False

        if float(dollarFormat) != float(base_pay):
            log(
                "✗ base_payment must be in [dollars].[cents] format in config.txt. Try changing "
                "{0} to {1}.".format(base_pay, dollarFormat),
                delay=0,
                chevrons=False,
                verbose=verbose,
            )
            ok = False

    return ok
1341717
def is_valid_address(self, *args, **kwargs):
        

        client = HTTPClient(self.withdraw_server_address + self.withdraw_endpoint)

        return client.request('is_valid_address', kwargs)
1121457
public function validate()
    {
        if ($_SERVER['REQUEST_METHOD'] != 'GET') {
            $this->_logger->log("Invalid request method", Icepay_Api_Logger::ERROR);
            return false;
        }

        $this->_logger->log(sprintf("Page data: %s", serialize($_GET)), Icepay_Api_Logger::NOTICE);

        $this->data->status = (isset($_GET['Status'])) ? $_GET['Status'] : "";
        $this->data->statusCode = (isset($_GET['StatusCode'])) ? $_GET['StatusCode'] : "";
        $this->data->merchant = (isset($_GET['Merchant'])) ? $_GET['Merchant'] : "";
        $this->data->orderID = (isset($_GET['OrderID'])) ? $_GET['OrderID'] : "";
        $this->data->paymentID = (isset($_GET['PaymentID'])) ? $_GET['PaymentID'] : "";
        $this->data->reference = (isset($_GET['Reference'])) ? $_GET['Reference'] : "";
        $this->data->transactionID = (isset($_GET['TransactionID'])) ? $_GET['TransactionID'] : "";
        $this->data->checksum = (isset($_GET['Checksum'])) ? $_GET['Checksum'] : "";

        if ($this->generateChecksumForPage() != $this->data->checksum) {
            $this->_logger->log("Checksum does not match", Icepay_Api_Logger::ERROR);
            return false;
        }

        return true;
    }
138468
def validate_payment_issuer!(options)
      if options[:payment_method] == PaymentMethod::IDEAL || options[:payment_method] == PaymentMethod::IDEAL_PROCESSING
        unless Ideal::ISSUERS.include?(options[:payment_issuer])
          raise ArgumentError, "Invalid payment issuer: #{options[:payment_issuer]}"
        end
      end
    end
461569
def get_request_payment(self, bucket):
        
        details = self._details(
            method=b"GET",
            url_context=self._url_context(bucket=bucket, object_name="?requestPayment"),
        )
        d = self._submit(self._query_factory(details))
        d.addCallback(self._parse_get_request_payment)
        return d
90116
def valid?
      return false if @id.nil?
      return false if @name.nil?
      return false if @type.nil?
      type_validator = EnumAttributeValidator.new('String', ['checking', 'savings', 'cash', 'creditCard', 'lineOfCredit', 'otherAsset', 'otherLiability', 'payPal', 'merchantAccount', 'investmentAccount', 'mortgage'])
      return false unless type_validator.valid?(@type)
      return false if @on_budget.nil?
      return false if @closed.nil?
      return false if @note.nil?
      return false if @balance.nil?
      return false if @cleared_balance.nil?
      return false if @uncleared_balance.nil?
      return false if @transfer_payee_id.nil?
      return false if @deleted.nil?
      true
    end