Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 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
     *
10
     * @see http://en.wikipedia.org/wiki/International_Bank_Account_Number
11
     *
12
     * @param string $prefix      for generating bank account number of a specific bank
13
     * @param string $countryCode ISO 3166-1 alpha-2 country code
14
     * @param int    $length      total length without country code and 2 check digits
15
     *
16
     * @return string
17
     */
18
    public static function bankAccountNumber($prefix = '', $countryCode = 'BG', $length = null)
19
    {
20
        return static::iban($countryCode, $prefix, $length);
21
    }
22
 
23
    /**
24
     * Value Added Tax (VAT)
25
     *
26
     * @example 'BG1234567890', ('spaced') 'BG 1234567890'
27
     *
28
     * @see http://ec.europa.eu/taxation_customs/vies/faq.html?locale=en#item_11
29
     * @see http://en.wikipedia.org/wiki/VAT_identification_number
30
     *
31
     * @param bool $spacedNationalPrefix
32
     *
33
     * @return string VAT Number
34
     */
35
    public static function vat($spacedNationalPrefix = true)
36
    {
37
        $prefix = $spacedNationalPrefix ? 'BG ' : 'BG';
38
 
39
        return sprintf(
40
            '%s%d%d',
41
            $prefix,
42
            self::randomNumber(5, true), // workaround for mt_getrandmax() limitation
43
            self::randomNumber(self::randomElement([4, 5]), true),
44
        );
45
    }
46
}