Exemplo n.º 1
0
    updateEvent(event) {
        
        let deferred = Q.defer();

        let eventId = event._id;
        delete event._id; 
        
        console.log("payout info", event.payout);
        if (event.payout) {
            if (!IBAN.isValid(event.payout.iban) && event.payout.iban !== "IBAN123") {
                deferred.reject(new Errors.UnprocessableEntity(null, { message: "invalid_iban" }));
                return deferred.promise;
            }
        }

        Event.update({ _id: eventId }, event, (err, numAffected) => {
            
            if (!err && numAffected === 0) {
                err = new Errors.NotFound(null, { message: "event_not_found" }); 
            }

            if (err) { return deferred.reject(err); }
            
            deferred.resolve(event);

        });

        return deferred.promise;
    
    }
Exemplo n.º 2
0
 isValidIban = function(value) {
   var iban;
   if (!(attrs.required || value)) {
     return true;
   }
   iban = parseIban(value);
   return IBAN.isValid(iban);
 };
Exemplo n.º 3
0
SoloValidator.prototype.validate_RCV_ACCOUNT = function(){
    var value = (this.fields[this.keyPrefix + "RCV_ACCOUNT"] || "").toString();

    if(value && !IBAN.isValid(value)){
        this.warnings.push({
            field: this.keyPrefix + "RCV_ACCOUNT",
            value: value,
            warning: util.format("Saaja konto number %s (\"%s\") ei vasta IBAN formaadile", "RCV_ACCOUNT", value)
        });
    }

    return true;
};
Exemplo n.º 4
0
 $scope.sallittuIban = function (tilinumero) {
   return IBAN.isValid(tilinumero);
 };