Open Journal Systems  3.3.0
Omnipay\Common\Helper Class Reference

Static Public Member Functions

static camelCase ($str)
 
static camelCase ($str)
 
static getGatewayClassName ($shortName)
 
static getGatewayClassName ($shortName)
 
static getGatewayShortName ($className)
 
static getGatewayShortName ($className)
 
static initialize ($target, $parameters)
 
static initialize ($target, array $parameters=null)
 
static toFloat ($value)
 
static validateLuhn ($number)
 
static validateLuhn ($number)
 

Static Protected Member Functions

static convertToLowercase ($str)
 
static convertToLowercase ($str)
 

Detailed Description

Helper class

This class defines various static utility functions that are in use throughout the Omnipay system.

Definition at line 16 of file lib/vendor/omnipay/common/src/Omnipay/Common/Helper.php.

Member Function Documentation

◆ camelCase() [1/2]

static Omnipay\Common\Helper::camelCase (   $str)
static

Convert a string to camelCase. Strings already in camelCase will not be harmed.

Parameters
string$strThe input string
Returns
string camelCased output string

Definition at line 24 of file lib/vendor/omnipay/common/src/Omnipay/Common/Helper.php.

References Omnipay\Common\Helper\convertToLowercase().

Referenced by Omnipay\Common\HelperTest\testCamelCase(), Omnipay\Common\HelperTest\testCamelCaseAlreadyCorrect(), and Omnipay\Common\HelperTest\testCamelCaseWithUppercaseValue().

◆ camelCase() [2/2]

static Omnipay\Common\Helper::camelCase (   $str)
static

Convert a string to camelCase. Strings already in camelCase will not be harmed.

Parameters
string$strThe input string
Returns
string camelCased output string

Definition at line 24 of file vendor/omnipay/common/src/Common/Helper.php.

References Omnipay\Common\Helper\convertToLowercase().

◆ convertToLowercase() [1/2]

static Omnipay\Common\Helper::convertToLowercase (   $str)
staticprotected

Convert strings with underscores to be all lowercase before camelCase is preformed.

Parameters
string$strThe input string
Returns
string The output string

Definition at line 42 of file lib/vendor/omnipay/common/src/Omnipay/Common/Helper.php.

Referenced by Omnipay\Common\Helper\camelCase().

◆ convertToLowercase() [2/2]

static Omnipay\Common\Helper::convertToLowercase (   $str)
staticprotected

Convert strings with underscores to be all lowercase before camelCase is preformed.

Parameters
string$strThe input string
Returns
string The output string

Definition at line 42 of file vendor/omnipay/common/src/Common/Helper.php.

◆ getGatewayClassName() [1/2]

static Omnipay\Common\Helper::getGatewayClassName (   $shortName)
static

Resolve a short gateway name to a full namespaced gateway class.

Class names beginning with a namespace marker () are left intact. Non-namespaced classes are expected to be in the \Omnipay namespace, e.g.:

 \Custom\Gateway     => \Custom\Gateway
 \Custom_Gateway     => \Custom_Gateway
 Stripe              => \Omnipay\Stripe\Gateway
 PayPal\Express      => \Omnipay\PayPal\ExpressGateway
 PayPal_Express      => \Omnipay\PayPal\ExpressGateway
Parameters
string$shortNameThe short gateway name
Returns
string The fully namespaced gateway class name

Definition at line 127 of file lib/vendor/omnipay/common/src/Omnipay/Common/Helper.php.

Referenced by Omnipay\Common\GatewayFactory\create(), Omnipay\Common\GatewayFactory\find(), Omnipay\Common\HelperTest\testGetGatewayClassNameExistingNamespace(), Omnipay\Common\HelperTest\testGetGatewayClassNameExistingNamespaceUnderscore(), Omnipay\Common\HelperTest\testGetGatewayClassNamePartialNamespace(), Omnipay\Common\HelperTest\testGetGatewayClassNameSimple(), and Omnipay\Common\HelperTest\testGetGatewayClassNameUnderscoreNamespace().

◆ getGatewayClassName() [2/2]

static Omnipay\Common\Helper::getGatewayClassName (   $shortName)
static

Resolve a short gateway name to a full namespaced gateway class.

Class names beginning with a namespace marker () are left intact. Non-namespaced classes are expected to be in the \Omnipay namespace, e.g.:

 \Custom\Gateway     => \Custom\Gateway
 \Custom_Gateway     => \Custom_Gateway
 Stripe              => \Omnipay\Stripe\Gateway
 PayPal\Express      => \Omnipay\PayPal\ExpressGateway
 PayPal_Express      => \Omnipay\PayPal\ExpressGateway
Parameters
string$shortNameThe short gateway name
Returns
string The fully namespaced gateway class name

Definition at line 128 of file vendor/omnipay/common/src/Common/Helper.php.

◆ getGatewayShortName() [1/2]

◆ getGatewayShortName() [2/2]

static Omnipay\Common\Helper::getGatewayShortName (   $className)
static

Resolve a gateway class to a short name.

The short name can be used with GatewayFactory as an alias of the gateway class, to create new instances of a gateway.

Definition at line 100 of file vendor/omnipay/common/src/Common/Helper.php.

◆ initialize() [1/2]

static Omnipay\Common\Helper::initialize (   $target,
  $parameters 
)
static

Initialize an object with a given array of parameters

Parameters are automatically converted to camelCase. Any parameters which do not match a setter on the target object are ignored.

Parameters
mixed$targetThe object to set parameters on
array$parametersAn array of parameters to set

Definition at line 81 of file lib/vendor/omnipay/common/src/Omnipay/Common/Helper.php.

Referenced by Omnipay\Common\Item\initialize(), Omnipay\Common\initialize(), Omnipay\Common\AbstractGateway\initialize(), Omnipay\Common\Message\AbstractRequest\initialize(), Omnipay\Common\CreditCard\initialize(), Omnipay\Common\HelperTest\testInitializeCallsSetters(), Omnipay\Common\HelperTest\testInitializeIgnoresInvalidParameters(), Omnipay\Common\HelperTest\testInitializeIgnoresNull(), and Omnipay\Common\HelperTest\testInitializeIgnoresString().

◆ initialize() [2/2]

static Omnipay\Common\Helper::initialize (   $target,
array  $parameters = null 
)
static

Initialize an object with a given array of parameters

Parameters are automatically converted to camelCase. Any parameters which do not match a setter on the target object are ignored.

Parameters
mixed$targetThe object to set parameters on
array$parametersAn array of parameters to set

Definition at line 82 of file vendor/omnipay/common/src/Common/Helper.php.

◆ toFloat()

◆ validateLuhn() [1/2]

static Omnipay\Common\Helper::validateLuhn (   $number)
static

Validate a card number according to the Luhn algorithm.

Parameters
string$numberThe card number to validate
Returns
boolean True if the supplied card number is valid

Definition at line 62 of file lib/vendor/omnipay/common/src/Omnipay/Common/Helper.php.

Referenced by Omnipay\Common\HelperTest\testValidateLuhnInvalid(), Omnipay\Common\HelperTest\testValidateLuhnNull(), Omnipay\Common\HelperTest\testValidateLuhnValid(), and Omnipay\Common\CreditCard\validate().

◆ validateLuhn() [2/2]

static Omnipay\Common\Helper::validateLuhn (   $number)
static

Validate a card number according to the Luhn algorithm.

Parameters
string$numberThe card number to validate
Returns
boolean True if the supplied card number is valid

Definition at line 63 of file vendor/omnipay/common/src/Common/Helper.php.


The documentation for this class was generated from the following file: