| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Faker\Provider\es_ES;
|
|
|
4 |
|
|
|
5 |
class Payment extends \Faker\Provider\Payment
|
|
|
6 |
{
|
|
|
7 |
private static $vatMap = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'N', 'P', 'Q', 'R', 'S', 'U', 'V', 'W'];
|
|
|
8 |
|
|
|
9 |
/**
|
|
|
10 |
* International Bank Account Number (IBAN)
|
|
|
11 |
*
|
|
|
12 |
* @see http://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
|
13 |
*
|
|
|
14 |
* @param string $prefix for generating bank account number of a specific bank
|
|
|
15 |
* @param string $countryCode ISO 3166-1 alpha-2 country code
|
|
|
16 |
* @param int $length total length without country code and 2 check digits
|
|
|
17 |
*
|
|
|
18 |
* @return string
|
|
|
19 |
*/
|
|
|
20 |
public static function bankAccountNumber($prefix = '', $countryCode = 'ES', $length = null)
|
|
|
21 |
{
|
|
|
22 |
return static::iban($countryCode, $prefix, $length);
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
/**
|
|
|
26 |
* Value Added Tax (VAT)
|
|
|
27 |
*
|
|
|
28 |
* @example 'B93694545'
|
|
|
29 |
*
|
|
|
30 |
* @see https://en.wikipedia.org/wiki/VAT_identification_number
|
|
|
31 |
* @see https://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
|
|
|
32 |
*
|
|
|
33 |
* @return string VAT Number
|
|
|
34 |
*/
|
|
|
35 |
public static function vat()
|
|
|
36 |
{
|
|
|
37 |
$letter = static::randomElement(self::$vatMap);
|
|
|
38 |
$number = static::numerify('########');
|
|
|
39 |
|
|
|
40 |
return $letter . $number;
|
|
|
41 |
}
|
|
|
42 |
}
|