Payment.php
44 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\bg_BG; |
| 4 | |
| 5 | class Payment extends \Faker\Provider\Payment |
| 6 | { |
| 7 | /** |
| 8 | * International Bank Account Number (IBAN) |
| 9 | * @link http://en.wikipedia.org/wiki/International_Bank_Account_Number |
| 10 | * @param string $prefix for generating bank account number of a specific bank |
| 11 | * @param string $countryCode ISO 3166-1 alpha-2 country code |
| 12 | * @param integer $length total length without country code and 2 check digits |
| 13 | * @return string |
| 14 | */ |
| 15 | public static function bankAccountNumber($prefix = '', $countryCode = 'BG', $length = null) |
| 16 | { |
| 17 | return static::iban($countryCode, $prefix, $length); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Value Added Tax (VAT) |
| 22 | * |
| 23 | * @example 'BG1234567890', ('spaced') 'BG 1234567890' |
| 24 | * |
| 25 | * @see http://ec.europa.eu/taxation_customs/vies/faq.html?locale=en#item_11 |
| 26 | * @see http://en.wikipedia.org/wiki/VAT_identification_number |
| 27 | * |
| 28 | * @param bool $spacedNationalPrefix |
| 29 | * |
| 30 | * @return string VAT Number |
| 31 | */ |
| 32 | public static function vat($spacedNationalPrefix = true) |
| 33 | { |
| 34 | $prefix = $spacedNationalPrefix ? "BG " : "BG"; |
| 35 | |
| 36 | return sprintf( |
| 37 | "%s%d%d", |
| 38 | $prefix, |
| 39 | self::randomNumber(5, true), // workaround for mt_getrandmax() limitation |
| 40 | self::randomNumber(self::randomElement(array(4, 5)), true) |
| 41 | ); |
| 42 | } |
| 43 | } |
| 44 |