Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / phortune / cart / PhortuneCartImplementation.php
blob1dbc200806a600087f30f632e6341e929b62b3d0
1 <?php
3 abstract class PhortuneCartImplementation extends Phobject {
5 /**
6 * Load implementations for a given set of carts.
8 * Note that this method should return a map using the original keys to
9 * identify which implementation corresponds to which cart.
11 abstract public function loadImplementationsForCarts(
12 PhabricatorUser $viewer,
13 array $carts);
15 abstract public function getName(PhortuneCart $cart);
16 abstract public function getCancelURI(PhortuneCart $cart);
17 abstract public function getDoneURI(PhortuneCart $cart);
19 public function getDescription(PhortuneCart $cart) {
20 return null;
23 public function getDoneActionName(PhortuneCart $cart) {
24 return pht('Return to Application');
27 public function assertCanCancelOrder(PhortuneCart $cart) {
28 switch ($cart->getStatus()) {
29 case PhortuneCart::STATUS_PURCHASED:
30 throw new Exception(
31 pht(
32 'This order can not be cancelled because it has already been '.
33 'completed.'));
34 break;
38 public function assertCanRefundOrder(PhortuneCart $cart) {
39 return;
42 abstract public function willCreateCart(
43 PhabricatorUser $viewer,
44 PhortuneCart $cart);