Blesta Source Documentation

ClientAccounts extends ClientController

Client portal accounts controller

Table of Contents

Methods

add() Create a new payment account
creditHandling() Manage credit handling settings
deleteAch() Delete an ACH payment account
deleteCc() Delete a credit card payment account
editAch() Add an ACH payment account
editCc() Edit a credit card payment account
index() List all client accounts, allow client to set primary account
preAction() Main pre-action
verifyAch() Verifies an ACH payment account
authorized() Verifies that the currently logged in user is authorized for the given Controller and Action (or current Controller/Action if none given).
hasPermission() Verifies if the current user has permission to the given area
isStaffAsClient() Checks whether the current user is a staff user and whether the user is currently logged into the client portal.
requireLogin() {@inheritdoc}
requirePermission() Verifies permissions for the given generic $area
setNav() Sets the primary and secondary navigation links. Performs authorization checks on each navigational element.
getAccounts() Retrieves a list of all client payment accounts
getAchView() Retrieves the ACH partial view
getCcView() Retrieves the CC partial view
getDebitAccount() Retrieves the active debit account selected for this client
setContactView() Sets the contact partial view
Methods

creditHandling()

Manage credit handling settings

public creditHandling() : mixed

deleteAch()

Delete an ACH payment account

public deleteAch() : mixed

deleteCc()

Delete a credit card payment account

public deleteCc() : mixed

editCc()

Edit a credit card payment account

public editCc() : mixed

index()

List all client accounts, allow client to set primary account

public index() : mixed

verifyAch()

Verifies an ACH payment account

public verifyAch() : mixed

authorized()

Verifies that the currently logged in user is authorized for the given Controller and Action (or current Controller/Action if none given).

protected authorized([string $controller = null ][, string $action = null ][, stdClass $group = null ]) : bool

Will first check whether the Controller and Action is a permission value, and if so, checks to ensure the staff or client group user is authorized to access that resource

Parameters
$controller : string = null

The controller to check authorization on, null will default to the current controller

$action : string = null

The action to check authorization on, null will default to the current action

$group : stdClass = null

The staff or client group to check authorization on, null will fetch the group of the current user

Return values
bool

Returns true if the user is authorized for that resource, false otherwise

hasPermission()

Verifies if the current user has permission to the given area

protected hasPermission(string $area) : bool
Parameters
$area : string

The generic area

Return values
bool

True if user has permission, false otherwise

isStaffAsClient()

Checks whether the current user is a staff user and whether the user is currently logged into the client portal.

protected isStaffAsClient() : bool
Return values
bool

True if the user is a staff user logged in as a client, false otherwise

requireLogin()

{@inheritdoc}

protected requireLogin([mixed $redirect_to = null ]) : mixed
Parameters
$redirect_to : mixed = null

requirePermission()

Verifies permissions for the given generic $area

protected requirePermission(string $area) : mixed
Parameters
$area : string

The generic area

setNav()

Sets the primary and secondary navigation links. Performs authorization checks on each navigational element.

protected setNav() : mixed

May cache nav results if possible for better performance.

getAccounts()

Retrieves a list of all client payment accounts

private getAccounts() : array<string|int, mixed>
Return values
array<string|int, mixed>

A list of CC and ACH payment accounts belonging to this client

getAchView()

Retrieves the ACH partial view

private getAchView(stdClass $vars[, bool $edit = false ][, bool $save_account = false ]) : string
Parameters
$vars : stdClass

The input vars object for use in the view

$edit : bool = false

True if this is an edit, false otherwise

$save_account : bool = false

True to offer an option to save these payment details, false otherwise

Tags
see

ClientAccounts::addAch(), ClientAccounts::editAch()

Return values
string

The ACH account info partial

getCcView()

Retrieves the CC partial view

private getCcView(stdClass $vars[, bool $edit = false ][, bool $save_account = false ]) : string
Parameters
$vars : stdClass

The input vars object for use in the view

$edit : bool = false

True if this is an edit, false otherwise

$save_account : bool = false

True to offer an option to save these payment details, false otherwise

Tags
see

ClientAccounts::addCc(), ClientAccounts::editCc()

Return values
string

The CC account info partial

getDebitAccount()

Retrieves the active debit account selected for this client

private getDebitAccount(mixed $payment_accounts[, stdClass $client_account = false ]) : mixed
Parameters
$payment_accounts : mixed
$client_account : stdClass = false

An stdClass object representing the current active debit account (optional, default false)

Tags
see
ClientAccounts::index()
Return values
mixed

False if no debit account is set, otherwise an array of debit account settings including:

  • account_id The account ID
  • type The account type

setContactView()

Sets the contact partial view

private setContactView(stdClass $vars[, bool $edit = false ]) : mixed
Parameters
$vars : stdClass

The input vars object for use in the view

$edit : bool = false

True if this is an edit, false otherwise

Tags
see

ClientAccounts::addCc(), ClientAccounts::addAch(), ClientAccounts::editCc(), ClientAccounts::editAch()

Tags
subpackage

app.controllers

copyright

Copyright (c) 2010, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta


        
On this page

Search results