3 abstract class PhortuneController
extends PhabricatorController
{
5 private function loadEnabledProvidersForMerchant(PhortuneMerchant
$merchant) {
6 $viewer = $this->getRequest()->getUser();
8 $provider_configs = id(new PhortunePaymentProviderConfigQuery())
10 ->withMerchantPHIDs(array($merchant->getPHID()))
12 $providers = mpull($provider_configs, 'buildProvider', 'getID');
14 foreach ($providers as $key => $provider) {
15 if (!$provider->isEnabled()) {
16 unset($providers[$key]);
23 protected function loadCreatePaymentMethodProvidersForMerchant(
24 PhortuneMerchant
$merchant) {
26 $providers = $this->loadEnabledProvidersForMerchant($merchant);
27 foreach ($providers as $key => $provider) {
28 if (!$provider->canCreatePaymentMethods()) {
29 unset($providers[$key]);
37 protected function loadOneTimePaymentProvidersForMerchant(
38 PhortuneMerchant
$merchant) {
40 $providers = $this->loadEnabledProvidersForMerchant($merchant);
41 foreach ($providers as $key => $provider) {
42 if (!$provider->canProcessOneTimePayments()) {
43 unset($providers[$key]);