Sylvain Fabre

The International Bank Account Number (IBAN) is an internationally agreed
system of identifying bank accounts across national borders. The Bank Identifier
Code (BIC) is a unique identification code for both and non-
institutions defined in the ISO 9362 standard.

Although both codes are independent, they can be checked in combination to
validate that both belong at least to the same country. In 4.3 we
the Bic constraint to allow validating BIC and IBAN codes together.

First, you can pass the IBAN code using the new iban option:

use SymfonyComponentValidatorConstraints as Assert;
// ...

public static function loadValidatorMetadata(ClassMetadata $metadata)
{
    $metadata->addPropertyConstraint('businessIdentifierCode', new AssertBic([
        'iban' => 'FR14200410050500013M02606',
    )]);
}

You can also use the new ibanPropertyPath option to define the object
property that stores the IBAN code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
use SymfonyComponentValidatorConstraints as Assert;
// ...

class Transaction
{
    /**
     * @AssertBic(ibanPropertyPath = "accountNumber")
     */
    protected $businessIdentifierCode;

    /**
     * @AssertIban
     */
    protected $accountNumber;

    // ...
}

Raúl Fraile

Universal Air Travel Plan (UATP) is the airline owned payment network
accepted by thousands of merchants for air, rail, hotel and travel agency
payments. In Symfony 4.3 we improved the CardScheme constraint to add
support for a new UATP scheme:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// ...

class Transaction
{
    /**
     * @AssertCardScheme(
     *     schemes={"AMEX", "MASTERCARD", "UATP", "VISA"},
     *     message="Your credit card number is invalid."
     * )
     */
    protected $cardNumber;
}



Source link
thanks you RSS link
( http://feedproxy.google.com/~r/symfony//~3/YRHm05YGBk4/new-in-symfony-4-3-improved-financial-constraints)

LEAVE A REPLY

Please enter your comment!
Please enter your name here