Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/storage/PhortunePaymentMethod.php
<?php | <?php | ||||
/** | /** | ||||
* A payment method is a credit card; it is associated with an account and | * A payment method is a credit card; it is associated with an account and | ||||
* charges can be made against it. | * charges can be made against it. | ||||
*/ | */ | ||||
final class PhortunePaymentMethod | final class PhortunePaymentMethod | ||||
extends PhortuneDAO | extends PhortuneDAO | ||||
implements | implements | ||||
PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
PhabricatorExtendedPolicyInterface, | PhabricatorExtendedPolicyInterface, | ||||
PhabricatorPolicyCodexInterface { | PhabricatorPolicyCodexInterface, | ||||
PhabricatorApplicationTransactionInterface { | |||||
const STATUS_ACTIVE = 'payment:active'; | const STATUS_ACTIVE = 'payment:active'; | ||||
const STATUS_DISABLED = 'payment:disabled'; | const STATUS_DISABLED = 'payment:disabled'; | ||||
protected $name = ''; | protected $name = ''; | ||||
protected $status; | protected $status; | ||||
protected $accountPHID; | protected $accountPHID; | ||||
protected $authorPHID; | protected $authorPHID; | ||||
▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | public function getDisplayExpires() { | ||||
$year = substr($year, -2); | $year = substr($year, -2); | ||||
return $month.'/'.$year; | return $month.'/'.$year; | ||||
} | } | ||||
public function isActive() { | public function isActive() { | ||||
return ($this->getStatus() === self::STATUS_ACTIVE); | return ($this->getStatus() === self::STATUS_ACTIVE); | ||||
} | } | ||||
public function getURI() { | |||||
return urisprintf( | |||||
'/phortune/account/%d/methods/%d/', | |||||
$this->getAccount()->getID(), | |||||
$this->getID()); | |||||
} | |||||
public function getObjectName() { | |||||
return pht('Payment Method %d', $this->getID()); | |||||
} | |||||
/* -( PhabricatorApplicationTransactionInterface )------------------------- */ | |||||
public function getApplicationTransactionEditor() { | |||||
return new PhortunePaymentMethodEditor(); | |||||
} | |||||
public function getApplicationTransactionTemplate() { | |||||
return new PhortunePaymentMethodTransaction(); | |||||
} | |||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
public function getCapabilities() { | public function getCapabilities() { | ||||
return array( | return array( | ||||
PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
PhabricatorPolicyCapability::CAN_EDIT, | PhabricatorPolicyCapability::CAN_EDIT, | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |