mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-26 20:22:23 +00:00
55 lines
1.1 KiB
PHP
55 lines
1.1 KiB
PHP
<?php
|
|
|
|
class PaymentMethod
|
|
{
|
|
const CREDIT_CARD = 0;
|
|
const BANK_CHECK = 1;
|
|
const BANK_TRANSFER = 2;
|
|
const CASH = 3;
|
|
const SCHOLARSHIP = 4;
|
|
|
|
public static function getTranslatedName($status) {
|
|
switch ($status) {
|
|
case self::BANK_CHECK:
|
|
return "Chèque";
|
|
case self::BANK_TRANSFER:
|
|
return "Virement";
|
|
case self::CASH:
|
|
return "Espèce";
|
|
case self::SCHOLARSHIP:
|
|
return "Je suis boursier";
|
|
default:
|
|
return "Carte bancaire";
|
|
}
|
|
}
|
|
|
|
public static function getName($status) {
|
|
switch ($status) {
|
|
case self::BANK_CHECK:
|
|
return "BANK_CHECK";
|
|
case self::BANK_TRANSFER:
|
|
return "BANK_TRANSFER";
|
|
case self::CASH:
|
|
return "CASH";
|
|
case self::SCHOLARSHIP:
|
|
return "SCHOLARSHIP";
|
|
default:
|
|
return "CREDIT_CARD";
|
|
}
|
|
}
|
|
|
|
public static function fromName($name) {
|
|
switch ($name) {
|
|
case "BANK_CHECK":
|
|
return self::BANK_CHECK;
|
|
case "BANK_TRANSFER":
|
|
return self::BANK_TRANSFER;
|
|
case "CASH":
|
|
return self::CASH;
|
|
case "SCHOLARSHIP":
|
|
return self::SCHOLARSHIP;
|
|
default:
|
|
return self::CREDIT_CARD;
|
|
}
|
|
}
|
|
} |