Address.php
5 years ago
Company.php
5 years ago
Internet.php
5 years ago
Payment.php
5 years ago
Person.php
5 years ago
PhoneNumber.php
5 years ago
Text.php
5 years ago
Payment.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\fr_FR; |
| 4 | |
| 5 | class Payment extends \Faker\Provider\Payment |
| 6 | { |
| 7 | /** |
| 8 | * Value Added Tax (VAT) |
| 9 | * |
| 10 | * @example 'FR12123456789', ('spaced') 'FR 12 123 456 789' |
| 11 | * |
| 12 | * @see http://ec.europa.eu/taxation_customs/vies/faq.html?locale=en#item_11 |
| 13 | * @see http://www.iecomputersystems.com/ordering/eu_vat_numbers.htm |
| 14 | * @see http://en.wikipedia.org/wiki/VAT_identification_number |
| 15 | * |
| 16 | * @param bool $spacedNationalPrefix |
| 17 | * |
| 18 | * @return string VAT Number |
| 19 | */ |
| 20 | public function vat($spacedNationalPrefix = true) |
| 21 | { |
| 22 | $siren = Company::siren(false); |
| 23 | $key = (12 + 3 * ($siren % 97)) % 97; |
| 24 | $pattern = "%s%'.02d%s"; |
| 25 | if ($spacedNationalPrefix) { |
| 26 | $siren = trim(chunk_split($siren, 3, ' ')); |
| 27 | $pattern = "%s %'.02d %s"; |
| 28 | } |
| 29 | return sprintf($pattern, 'FR', $key, $siren); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * International Bank Account Number (IBAN) |
| 34 | * @link http://en.wikipedia.org/wiki/International_Bank_Account_Number |
| 35 | * @param string $prefix for generating bank account number of a specific bank |
| 36 | * @param string $countryCode ISO 3166-1 alpha-2 country code |
| 37 | * @param integer $length total length without country code and 2 check digits |
| 38 | * @return string |
| 39 | */ |
| 40 | public static function bankAccountNumber($prefix = '', $countryCode = 'FR', $length = null) |
| 41 | { |
| 42 | return static::iban($countryCode, $prefix, $length); |
| 43 | } |
| 44 | } |
| 45 |