Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Gateway
  • Gateways
  • MerchantGateway
  • NonmerchantGateway

Interfaces

  • MerchantAch
  • MerchantAchOffsite
  • MerchantCc
  • MerchantCcForm
  • MerchantCcOffsite
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Gateway

Abstract class that all Gateways extend through MerchantGateway or NonmerchantGateway

Defines all methods gateways must inherit and provides all methods common between all gateways

Gateway uses Blesta\Core\Util\Common\Traits\Container

Direct known subclasses

MerchantGateway, NonmerchantGateway
Abstract
Package: blesta\components\gateways
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/gateways/lib/gateway.php
Methods summary
public string
# getName( )

Returns the name of this gateway

Returns the name of this gateway

Returns

string
The common name of this gateway
public string
# getDescription( )

Returns the description of this gateway

Returns the description of this gateway

Returns

string
The description of this gateway
public string
# getVersion( )

Returns the version of this gateway

Returns the version of this gateway

Returns

string
The current version of this gateway
public array
# getAuthors( )

Returns the name and URL for the authors of this gateway

Returns the name and URL for the authors of this gateway

Returns

array
The name and URL of the authors of this gateway
public array
# getCurrencies( )

Return all currencies supported by this gateway

Return all currencies supported by this gateway

Returns

array
A numerically indexed array containing all currency codes (ISO 4217 format) this gateway supports
abstract public
# setCurrency( string $currency )

Sets the currency code to be used for all subsequent payments

Sets the currency code to be used for all subsequent payments

Parameters

$currency
The ISO 4217 currency code to be used for subsequent payments
abstract public string
# getSettings( array $meta = null )

Create and return the view content required to modify the settings of this gateway

Create and return the view content required to modify the settings of this gateway

Parameters

$meta
An array of meta (settings) data belonging to this gateway

Returns

string
HTML content containing the fields to update the meta data for this gateway
abstract public array
# editSettings( array $meta )

Validates the given meta (settings) data to be updated for this gateway

Validates the given meta (settings) data to be updated for this gateway

Parameters

$meta
An array of meta (settings) data to be updated for this gateway

Returns

array
The meta data to be updated in the database for this gateway, or reset into the form on failure
abstract public array
# encryptableFields( )

Returns an array of all fields to encrypt when storing in the database

Returns an array of all fields to encrypt when storing in the database

Returns

array
An array of the field names to encrypt when storing in the database
abstract public
# setMeta( array $meta = null )

Sets the meta data for this particular gateway

Sets the meta data for this particular gateway

Parameters

$meta
An array of meta data to set for this gateway
public
# install( )

Performs any necessary bootstraping actions

Performs any necessary bootstraping actions

public
# upgrade( string $current_version )

Performs migration of data from $current_version (the current installed version) to the given file set version

Performs migration of data from $current_version (the current installed version) to the given file set version

Parameters

$current_version
The current installed version of this gateway
public
# uninstall( integer $gateway_id, boolean $last_instance )

Performs any necessary cleanup actions

Performs any necessary cleanup actions

Parameters

$gateway_id
The ID of the gateway being uninstalled
$last_instance

True if $gateway_id is the last instance across all companies for this gateway, false otherwise

public string
# getLogo( )

Returns the relative path from this gateway's directory to the logo for this module. Defaults to views/default/images/logo.png

Returns the relative path from this gateway's directory to the logo for this module. Defaults to views/default/images/logo.png

Returns

string
The relative path to the gateway's logo
public string
# getSignupUrl( )

Returns the URL to the signup page for this gateway.

Returns the URL to the signup page for this gateway.

Returns

string
The URL to the signup page if one exists, null otherwise
public mixed
# errors( )

Return all validation errors encountered

Return all validation errors encountered

Returns

mixed
Boolean false if no errors encountered, an array of errors otherwise
public
# setGatewayId( integer $id )

Sets the ID of the gateway for a particular transaction

Sets the ID of the gateway for a particular transaction

Parameters

$id
The gateway ID
public
# setStaffId( integer $id )

Sets the ID of the staff member on a particular transaction

Sets the ID of the staff member on a particular transaction

Parameters

$id
The staff ID
protected string
# log( string $url, string $data = null, string $direction = 'input', boolean $success = false )

Attempts to log the given info to the gateway log.

Attempts to log the given info to the gateway log.

Parameters

$url
The URL contacted for this request
$data
A string of gateway data sent along with the request (optional)
$direction
The direction of the log entry (input or output, default input)
$success
True if the request was successful, false otherwise

Returns

string
Returns the 8-character group identifier, used to link log entries together

Throws

Exception
Thrown if $data was invalid and could not be added to the log
protected array
# maskData( array $data, array $mask_fields, string $mask_char = 'x', integer $unmask_length = 0 )

Masks each field listed in $mask_fields that also appears in $data, such that sensitive information is redacted.

Masks each field listed in $mask_fields that also appears in $data, such that sensitive information is redacted.

Parameters

$data
An array of key/value pairs
$mask_fields

An array of key/value pairs where each key identifies a key in $data and whose value is an array containing:

  • char The character to use as the mask
  • length The length of the original data to remain unmasked. A negative number will leave that many characters unmasked from the end of the string, while a positive number will leave that many characters unmasked from the beginning of the string, 0 will mask all characters
$mask_char
The character to use as the mask character if not specificed in $mask_fields array
$unmask_length

The length and direction of characters to remain unmasked if not specified in $mask_fields array

Returns

array
The $data array with fields masked as necessary
protected array
# maskDataRecursive( array $data, array $mask_fields, string $mask_char = 'x', integer $unmask_length = 0 )

Masks each field listed in $mask_fields that also appears in $data, such that sensitive information is redacted. Will recursively traverse $data looking for keys that match those in $mask_fields.

Masks each field listed in $mask_fields that also appears in $data, such that sensitive information is redacted. Will recursively traverse $data looking for keys that match those in $mask_fields.

Parameters

$data
An array of key/value pairs
$mask_fields

An array of key/value pairs where each key identifies a key in $data and whose value is an array containing:

  • char The character to use as the mask
  • length The length of the original data to remain unmasked. A negative number will leave that many characters unmasked from the end of the string, while a positive number will leave that many characters unmasked from the beginning of the string, 0 will mask all characters
$mask_char
The character to use as the mask character if not specificed in $mask_fields array
$unmask_length

The length and direction of characters to remain unmasked if not specified in $mask_fields array

Returns

array
The $data array with fields masked as necessary
protected mixed
# ifSet( mixed & $value, mixed $alt = null )

Returns $value if $value isset, otherwise returns $alt

Returns $value if $value isset, otherwise returns $alt

Parameters

$value
The value to return if $value isset
$alt
The value to return if $value is not set

Returns

mixed
Either $value or $alt
protected View
# makeView( string $file, string $view = 'default', string $view_path = null )

Initializes a View object and returns it

Initializes a View object and returns it

Parameters

$file
The view file to load
$view
The view directory name to find the view file
$view_path
The path to the $view relative to the root web directory

Returns

View
An instance of the View object
protected
# loadConfig( string $file )

Loads a given config file

Loads a given config file

Parameters

$file
The full path to the config file to load
protected mixed
# clientIdFromEmail( string $email )

Fetch a client ID from the given email address

Fetch a client ID from the given email address

Parameters

$email
The email address for the client

Returns

mixed
The client ID if found, null otherwise
Methods used from Blesta\Core\Util\Common\Traits\Container
getFromContainer()
Properties summary
protected stdClass $config

A stdClass object representing the configuration for this gateway

A stdClass object representing the configuration for this gateway

#
Blesta API documentation generated by ApiGen