3 final class PhortuneCartTransaction
4 extends PhabricatorApplicationTransaction
{
6 const TYPE_CREATED
= 'cart:created';
7 const TYPE_HOLD
= 'cart:hold';
8 const TYPE_REVIEW
= 'cart:review';
9 const TYPE_CANCEL
= 'cart:cancel';
10 const TYPE_REFUND
= 'cart:refund';
11 const TYPE_PURCHASED
= 'cart:purchased';
12 const TYPE_INVOICED
= 'cart:invoiced';
14 public function getApplicationName() {
18 public function getApplicationTransactionType() {
19 return PhortuneCartPHIDType
::TYPECONST
;
22 public function shouldHideForMail(array $xactions) {
23 switch ($this->getTransactionType()) {
24 case self
::TYPE_CREATED
:
28 return parent
::shouldHideForMail($xactions);
31 public function getTitle() {
32 $old = $this->getOldValue();
33 $new = $this->getNewValue();
35 switch ($this->getTransactionType()) {
36 case self
::TYPE_CREATED
:
37 return pht('This order was created.');
39 return pht('This order was put on hold until payment clears.');
40 case self
::TYPE_REVIEW
:
42 'This order was flagged for manual processing by the merchant.');
43 case self
::TYPE_CANCEL
:
44 return pht('This order was cancelled.');
45 case self
::TYPE_REFUND
:
46 return pht('This order was refunded.');
47 case self
::TYPE_PURCHASED
:
48 return pht('Payment for this order was completed.');
49 case self
::TYPE_INVOICED
:
50 return pht('This order was invoiced.');
53 return parent
::getTitle();
56 public function getTitleForMail() {
57 switch ($this->getTransactionType()) {
58 case self
::TYPE_INVOICED
:
59 return pht('You have a new invoice due.');
62 return parent
::getTitleForMail();
65 public function getActionName() {
66 switch ($this->getTransactionType()) {
67 case self
::TYPE_CREATED
:
68 return pht('Created');
71 case self
::TYPE_REVIEW
:
73 case self
::TYPE_CANCEL
:
74 return pht('Cancelled');
75 case self
::TYPE_REFUND
:
76 return pht('Refunded');
77 case self
::TYPE_PURCHASED
:
78 return pht('Complete');
79 case self
::TYPE_INVOICED
:
80 return pht('New Invoice');
83 return parent
::getActionName();