[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/phortune/cart/ -> PhortuneCartImplementation.php (source)

   1  <?php
   2  
   3  abstract class PhortuneCartImplementation {
   4  
   5    /**
   6     * Load implementations for a given set of carts.
   7     *
   8     * Note that this method should return a map using the original keys to
   9     * identify which implementation corresponds to which cart.
  10     */
  11    abstract public function loadImplementationsForCarts(
  12      PhabricatorUser $viewer,
  13      array $carts);
  14  
  15    abstract public function getName(PhortuneCart $cart);
  16    abstract public function getCancelURI(PhortuneCart $cart);
  17    abstract public function getDoneURI(PhortuneCart $cart);
  18  
  19    public function getDoneActionName(PhortuneCart $cart) {
  20      return pht('Return to Application');
  21    }
  22  
  23    public function assertCanCancelOrder(PhortuneCart $cart) {
  24      switch ($cart->getStatus()) {
  25        case PhortuneCart::STATUS_PURCHASED:
  26          throw new Exception(
  27            pht(
  28              'This order can not be cancelled because it has already been '.
  29              'completed.'));
  30          break;
  31      }
  32    }
  33  
  34    public function assertCanRefundOrder(PhortuneCart $cart) {
  35      return;
  36    }
  37  
  38    abstract public function willCreateCart(
  39      PhabricatorUser $viewer,
  40      PhortuneCart $cart);
  41  
  42  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1