Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • VivaPayments
      • Message
  • PHP

Classes

  • AbstractGateway
  • CreditCard
  • Currency
  • GatewayFactory
  • Helper
  • Issuer
  • Item
  • ItemBag
  • PaymentMethod

Interfaces

  • GatewayInterface
  • ItemInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class Helper

Helper class

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

Namespace: Omnipay\Common
Located at Common/Helper.php
Methods summary
public static string
# camelCase( string $str )

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

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

Parameters

$str
The input string

Returns

string
camelCased output string
protected static string
# convertToLowercase( string $str )

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

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

Parameters

$str
The input string

Returns

string
The output string
public static boolean
# validateLuhn( string $number )

Validate a card number according to the Luhn algorithm.

Validate a card number according to the Luhn algorithm.

Parameters

$number
The card number to validate

Returns

boolean
True if the supplied card number is valid
public static
# initialize( mixed $target, array $parameters )

Initialize an object with a given array of parameters

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

$target
The object to set parameters on
$parameters
An array of parameters to set
public static
# getGatewayShortName( $className )

Resolve a gateway class to a short name.

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.

public static string
# getGatewayClassName( string $shortName )

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

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

$shortName
The short gateway name

Returns

string
The fully namespaced gateway class name
public static float
# toFloat( $value )

Convert an amount into a float. The float datatype can then be converted into the string format that the remote gateway requies.

Convert an amount into a float. The float datatype can then be converted into the string format that the remote gateway requies.

Returns

float
The amount converted to a float.

Throws

InvalidArgumentException
on a validation failure.

Var

string|int|float $value The value to convert.
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen