abstract public
string
|
#
getName( )
Returns the name of this gateway
Returns the name of this gateway
Returns
string The common name of this gateway
|
abstract public
string
|
#
getVersion( )
Returns the version of this gateway
Returns the version of this gateway
Returns
string The current version of this gateway
|
abstract 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
|
abstract 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
string $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
array $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
array $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
array $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
string $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
integer $gateway_id The ID of the gateway being uninstalled
- $last_instance
boolean $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
integer $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
integer $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
string $url The URL contacted for this request
- $data
string $data A string of gateway data sent along with the request (optional)
- $direction
string $direction The direction of the log entry (input or output, default input)
- $success
boolean $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
array $data An array of key/value pairs
- $mask_fields
array $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
string $mask_char The character to use as the mask character if not specificed in
$mask_fields array
- $unmask_length
integer $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
array $data An array of key/value pairs
- $mask_fields
array $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
string $mask_char The character to use as the mask character if not specificed in
$mask_fields array
- $unmask_length
integer $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
|
private
|
#
maskValue( string $value, mixed $rule, string $mask_char, integer $unmask_length )
Masks the given value using a set of rules, defaulting to a set of mask rules
if no specific rule given
Masks the given value using a set of rules, defaulting to a set of mask rules
if no specific rule given
Parameters
- $value
string $value The value to mask
- $rule
mixed $rule An array of rule setting, or a string to use $mask_char and $unmask_length
default values instead. Values include: - 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
string $mask_char The character to use as the mask character if not specificed by $rule
- $unmask_length
integer $unmask_length The length and direction of characters to remain unmasked if not
specified by $rule
|
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
mixed $value The value to return if $value isset
- $alt
mixed $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
string $file The view file to load
- $view
string $view The view directory name to find the view file
- $view_path
string $view_path The path to the $view relative to the root web directory
Returns
View
An instance of the View object
|