mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
add data providers for privinces and installment
This commit is contained in:
parent
2a3fb70fd2
commit
e62045e8d4
55
app/DataProviders/CAProvinces.php
Normal file
55
app/DataProviders/CAProvinces.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\DataProviders;
|
||||||
|
|
||||||
|
final class CAProvinces {
|
||||||
|
/**
|
||||||
|
* The provinces and territories of Canada
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected static $provinces = [
|
||||||
|
'AB' => 'Alberta',
|
||||||
|
'BC' => 'British Columbia',
|
||||||
|
'MB' => 'Manitoba',
|
||||||
|
'NB' => 'New Brunswick',
|
||||||
|
'NL' => 'Newfoundland And Labrador',
|
||||||
|
'NS' => 'Nova Scotia',
|
||||||
|
'ON' => 'Ontario',
|
||||||
|
'PE' => 'Prince Edward Island',
|
||||||
|
'QC' => 'Quebec',
|
||||||
|
'SK' => 'Saskatchewan',
|
||||||
|
'NT' => 'Northwest Territories',
|
||||||
|
'NU' => 'Nunavut',
|
||||||
|
'YT' => 'Yukon'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of the province or territory for a given abbreviation.
|
||||||
|
*
|
||||||
|
* @param string $abbreviation
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getName($abbreviation) {
|
||||||
|
return self::$provinces[$abbreviation];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all provinces and territories.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function get() {
|
||||||
|
return self::$provinces;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the abbreviation for a given province or territory name.
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getAbbreviation($name) {
|
||||||
|
return array_search(ucwords($name), self::$provinces);
|
||||||
|
}
|
||||||
|
}
|
19
app/DataProviders/Frequencies.php
Normal file
19
app/DataProviders/Frequencies.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\DataProviders;
|
||||||
|
|
||||||
|
use Omnipay\Rotessa\Object\Frequency;
|
||||||
|
|
||||||
|
final class Frequencies
|
||||||
|
{
|
||||||
|
public static function get() : array {
|
||||||
|
return Frequency::getTypes();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getFromType() {
|
||||||
|
|
||||||
|
}
|
||||||
|
public static function getOnePayment() {
|
||||||
|
return Frequency::ONCE;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user