Provide payment related permissions. The permissions are:
* `REFUND_PAYMENTS` can refund payments
* `CAPTURE_PAYMENTS` can capture payments
* `VOID_PAYMENTS` can void payments
@inheritdoc
@return array
509483
public function providePermissions()
    {
        return array(
            'REFUND_PAYMENTS' => array(
                'name' => _t('SilverStripe\Omnipay\Model\Payment.PERMISSION_REFUND_PAYMENTS', 'Refund payments'),
                'help' => _t(
                    'SilverStripe\Omnipay\Model\Payment.PERMISSION_REFUND_PAYMENTS_HELP',
                    'Allow refunding of captured payments'
                ),
                'category' => _t('SilverStripe\Omnipay\Model\Payment.PAYMENT_PERMISSIONS', 'Payment actions'),
                'sort' => 200
            ),
            'CAPTURE_PAYMENTS' => array(
                'name' => _t('SilverStripe\Omnipay\Model\Payment.PERMISSION_CAPTURE_PAYMENTS', 'Capture payments'),
                'help' => _t(
                    'SilverStripe\Omnipay\Model\Payment.PERMISSION_CAPTURE_PAYMENTS_HELP',
                    'Allow capturing of authorized payments'
                ),
                'category' => _t('SilverStripe\Omnipay\Model\Payment.PAYMENT_PERMISSIONS', 'Payment actions'),
                'sort' => 200
            ),
            'VOID_PAYMENTS' => array(
                'name' => _t('SilverStripe\Omnipay\Model\Payment.PERMISSION_VOID_PAYMENTS', 'Void payments'),
                'help' => _t(
                    'SilverStripe\Omnipay\Model\Payment.PERMISSION_VOID_PAYMENTS_HELP',
                    'Allow voiding of authorized payments'
                ),
                'category' => _t('SilverStripe\Omnipay\Model\Payment.PAYMENT_PERMISSIONS', 'Payment actions'),
                'sort' => 200
            )
        );
    }
1112377
protected function getAllPermissions() {
    $permissions = array();
    foreach (module_invoke_all('permission') as $name => $permission) {
      $permissions[$name] = $permission['title'];
    }
    return $permissions;
  }
427493
protected function getPaymentTransactionStructure()
    {
        return [
            'amount'              => $this->transformAmount($this->amount, $this->currency),
            'currency'            => $this->currency,
            'customer_account_id' => $this->customer_account_id,
            'return_url'          => $this->return_url,
            'customer_email'      => $this->customer_email,
            'customer_phone'      => $this->customer_phone,
            'billing_address'     => $this->getBillingAddressParamsStructure(),
            'shipping_address'    => $this->getShippingAddressParamsStructure()
        ];
    }
719389
protected function getPaymentTransactionStructure()
    {
        return [
            'return_success_url'  => $this->return_success_url,
            'return_failure_url'  => $this->return_failure_url,
            'amount'              => $this->transformAmount($this->amount, $this->currency),
            'currency'            => $this->currency,
            'is_payout'           => var_export($this->is_payout, true),
            'customer_account_id' => $this->customer_account_id,
            'customer_email'      => $this->customer_email,
            'customer_phone'      => $this->customer_phone,
            'billing_address'     => $this->getBillingAddressParamsStructure(),
            'shipping_address'    => $this->getShippingAddressParamsStructure()
        ];
    }
284306
public function getPermissionOptions()
    {
        // Get all the grouped elements
        $elements = app('decoy.elements')
            ->localize(Decoy::locale())
            ->hydrate(true)
            ->asModels()
            ->sortBy('page_label')
            ->groupBy('page_label');

        // Map to the expected permisions forat
        $out = [];
        foreach ($elements as $page_label => $fields) {
            $out[Str::slug($page_label)] = [$page_label, $fields[0]->page_help];
        }

        return $out;
    }
940256
private function getAllowedPermissions($permissions)
    {
        $allowedPermissions = [];
        foreach ($permissions as $permission => $allowed) {
            if ($allowed) {
                $allowedPermissions[] = $permission;
            }
        }

        return $allowedPermissions;
    }
542304
public function getPermissions()
    {
        // user permissions overridden from role.
        $permissions = \Cache::remember(
            'acl.getPermissionsById_'.$this->id,
            config('acl.cacheMinutes'),
            function () {
                return $this->getPermissionsInherited();
            }
        );

        // permissions based on role.
        // more permissive permission wins
        // if user has multiple roles we keep
        // true values.
        foreach ($this->roles as $role) {
            foreach ($role->getPermissions() as $slug => $array) {
                if ( array_key_exists($slug, $permissions) ) {
                    foreach ($array as $clearance => $value) {
                        if( !array_key_exists( $clearance, $permissions[$slug] ) ) {
                            ! $value ?: $permissions[$slug][$clearance] = true;
                        }
                    }
                } else {
                    $permissions = array_merge($permissions, [$slug => $array]);
                }
            }
        }

        return $permissions;
    }
1085564
public function permissions()
    {
        $groupIds = [Group::GUEST_ID];

        // If a user's account hasn't been activated, they are essentially no
        // more than a guest. If they are activated, we can give them the
        // standard 'member' group, as well as any other groups they've been
        // assigned to.
        if ($this->is_email_confirmed) {
            $groupIds = array_merge($groupIds, [Group::MEMBER_ID], $this->groups->pluck('id')->all());
        }

        event(new PrepareUserGroups($this, $groupIds));

        return Permission::whereIn('group_id', $groupIds);
    }
774364
public function getAllRDFaPayments()
    {
        $aRDFaPayments = [];
        $aAssignedRDFaPayments = $this->getAssignedRDFaPayments();
        foreach ($this->_aRDFaPayments as $sName => $iType) {
            $oPayment = new stdClass();
            $oPayment->name = $sName;
            $oPayment->type = $iType;
            $oPayment->checked = in_array($sName, $aAssignedRDFaPayments);
            $aRDFaPayments[] = $oPayment;
        }

        return $aRDFaPayments;
    }
1091855
protected function getPartiallyRefundedOrders()
    {
        $pagseguroOrdersIdArray = array();

        $connection = $this->getConnection();
        $select = $connection->select()
            ->from( ['ps' => $this->getPrefixTableName('pagseguro_orders')], ['order_id'] )
            ->where('ps.partially_refunded = ?', '1');

        if ($this->_scopeConfig->getValue('payment/pagseguro/environment')) {
            $select = $select->where('ps.environment = ?', $this->_scopeConfig->getValue('payment/pagseguro/environment'));
        }

        $connection->prepare($select);

        foreach ($connection->fetchAll($select) as $value) {
            $pagseguroOrdersIdArray[] = $value['order_id'];
        }

        return $pagseguroOrdersIdArray;
    }
61613
public function getAllPermissionsForRole($role)
    {
        /** @var EloquentRole $role */
        $role = $this->getRole($role);

        if ( ! $role) {
            return [];
        }

        $permissions = array_keys(array_filter($role->getPermissions()));
        sort($permissions);

        return $permissions;
    }
441342
public function getData()
    {
        $this->validate('transactionReference', 'MD', 'PaRes');

        return [
            'opcode'     => 3,
            'payment_id' => $this->getTransactionReference(),
            'PaRes'      => $this->getPaRes(),
            'MD'         => $this->getMD(),
            'token'      => $this->getRequestToken(),
        ];
    }
982136
public function retrieveAllPaymentmethods()
    {
        if (isset($this->_paymentMethodsArray))
            return $this;

        $obj = new stdClass();
        // Must be in specific order for checksum ---------
        $obj->MerchantID = $this->_merchantID;
        $obj->SecretCode = $this->_secretCode;
        $obj->Timestamp = $this->getTimeStamp();
        // ------------------------------------------------
        $obj->Checksum = $this->generateChecksum($obj);
        $obj->SecretCode = null;

        $this->_paymentMethods = $this->client->GetMyPaymentMethods(array('request' => $obj));

        if (isset($this->_paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod)) {
            $this->_paymentMethodsArray = $this->clean($this->_paymentMethods);
        }

        return $this;
    }
637155
protected function getPaymentTransactionStructure()
    {
        return [
            'usage'                  => $this->usage,
            'remote_ip'              => $this->remote_ip,
            'return_success_url'     => $this->return_success_url,
            'return_failure_url'     => $this->return_failure_url,
            'amount'                 => $this->transformAmount($this->amount, $this->currency),
            'currency'               => $this->currency,
            'customer_email'         => $this->customer_email,
            'crypto_address'         => $this->crypto_address,
            'crypto_wallet_provider' => $this->crypto_wallet_provider,
            'billing_address'        => $this->getBillingAddressParamsStructure(),
            'shipping_address'       => $this->getShippingAddressParamsStructure()
        ];
    }
948352
public function listPermissions()
    {
        if ($this->permissionCache !== false) {
            return $this->permissionCache;
        }

        /*
         * Load module items
         */
        foreach ($this->callbacks as $callback) {
            $callback($this);
        }

        /*
         * Load plugin items
         */
        $plugins = PluginManager::instance()->getPlugins();

        foreach ($plugins as $id => $plugin) {
            $items = $plugin->registerPermissions();
            if (!is_array($items)) {
                continue;
            }

            $this->registerPermissions($id, $items);
        }

        /*
         * Sort permission items
         */
        usort($this->permissions, function ($a, $b) {
            if ($a->order == $b->order) {
                return 0;
            }

            return $a->order > $b->order ? 1 : -1;
        });

        return $this->permissionCache = $this->permissions;
    }
1029821
protected function getPaymentTransactionStructure()
    {
        return [
            'usage'            => $this->usage,
            'remote_ip'        => $this->remote_ip,
            'return_url'       => $this->return_url,
            'amount'           => $this->transformAmount($this->amount, $this->currency),
            'currency'         => $this->currency,
            'customer_email'   => $this->customer_email,
            'billing_address'  => $this->getBillingAddressParamsStructure(),
            'shipping_address' => $this->getShippingAddressParamsStructure()
        ];
    }
537813
function lockPermissions(string $reason = '') {
        if(!$this->parent) {
            throw new \BadMethodCallException('This channel does not have a parent');
        }
        
        $overwrites = \array_values($this->parent->permissionOverwrites->map(function ($overwrite) {
            return array(
                'id' => $overwrite->id,
                'type' => $overwrite->type,
                'allow' => $overwrite->allow->bitfield,
                'deny' => $overwrite->deny->bitfield
            );
        })->all());
        
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($overwrites, $reason) {
            $promises = array();
            
            $overwritesID = \array_column($overwrites, 'id');
            foreach($this->permissionOverwrites as $perm) {
                if(!\in_array($perm->id, $overwritesID)) {
                    $promises[] = $perm->delete($reason);
                }
            }
            
            foreach($overwrites as $overwrite) {
                $promises[] = $this->client->apimanager()->endpoints->channel->editChannelPermissions($this->id, $overwrite['id'], $overwrite, $reason);
            }
            
            \React\Promise\all($promises)->done(function () use ($resolve) {
                $resolve($this);
            }, $reject);
        }));
    }