Methods summary
public
|
#
__construct( array $parameters = null )
Create a new CreditCard object using the specified parameters
Create a new CreditCard object using the specified parameters
Parameters
- $parameters
- An array of parameters to set on the new object
|
public
array
|
#
getSupportedBrands( )
All known/supported card brands, and a regular expression to match them.
All known/supported card brands, and a regular expression to match them.
Note: The fact that this class knows about a particular card brand does not imply
that your gateway supports it.
Returns
array
See
self::$supported_cards
|
public
boolean
|
#
addSupportedBrand( string $name, string $expression )
Set a custom supported card brand with a regular expression to match it.
Set a custom supported card brand with a regular expression to match it.
Note: The fact that a particular card is known does not imply that your
gateway supports it.
Set $add_to_front to true if the key should be added to the front of the array
Parameters
- $name
- The name of the new supported brand.
- $expression
- The regular expression to check if a card is supported.
Returns
boolean success
|
public
Omnipay\Common\CreditCard
|
#
initialize( array $parameters = null )
Initialize the object with parameters.
Initialize the object with parameters.
If any unknown parameters passed, they will be ignored.
Parameters
- $parameters
- An associative array of parameters
Returns
|
public
array
|
#
getParameters( )
Get all parameters.
Returns
array An associative array of parameters.
|
protected
mixed
|
#
getParameter( $key )
Get one parameter.
Returns
mixed A single parameter value.
|
protected
Omnipay\Common\CreditCard
|
#
setParameter( string $key, mixed $value )
Set one parameter.
Parameters
- $key
- Parameter key
- $value
- Parameter value
Returns
|
protected
Omnipay\Common\CreditCard
|
#
setYearParameter( string $key, mixed $value )
Set the credit card year.
Set the credit card year.
The input value is normalised to a 4 digit number.
Parameters
- $key
- Parameter key, e.g. 'expiryYear'
- $value
- Parameter value
Returns
|
public
|
#
validate( )
Validate this credit card. If the card is invalid, InvalidCreditCardException is thrown.
Validate this credit card. If the card is invalid, InvalidCreditCardException is thrown.
This method is called internally by gateways to avoid wasting time with an API call
when the credit card is clearly invalid.
Generally if you want to validate the credit card yourself with custom error
messages, you should use your framework's validation library, not this method.
Throws
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
#
setTitle( string $value )
Set Card Title.
Parameters
Returns
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
#
setFirstName( string $value )
Set Card First Name (Billing and Shipping).
Set Card First Name (Billing and Shipping).
Parameters
Returns
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
#
setLastName( string $value )
Set Card Last Name (Billing and Shipping).
Set Card Last Name (Billing and Shipping).
Parameters
Returns
|
public
string
|
#
getName( )
Get Card Name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setName( string $value )
Set Card Name (Billing and Shipping).
Set Card Name (Billing and Shipping).
Parameters
Returns
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
#
setNumber( string $value )
Set Card Number
Non-numeric characters are stripped out of the card number, so
it's safe to pass in strings such as "4444-3333 2222 1111" etc.
Parameters
Returns
|
public
string
|
#
getNumberLastFour( )
Get the last 4 digits of the card number.
Get the last 4 digits of the card number.
Returns
string
|
public
string
|
#
getNumberMasked( string $mask = 'X' )
Returns a masked credit card number with only the last 4 chars visible
Returns a masked credit card number with only the last 4 chars visible
Parameters
- $mask
- Character to use in place of numbers
Returns
string
|
public
string
|
#
getBrand( )
Credit Card Brand
Iterates through known/supported card brands to determine the brand of this card
Returns
string
|
public
integer
|
#
getExpiryMonth( )
Get the card expiry month.
Get the card expiry month.
Returns
integer
|
public
Omnipay\Common\CreditCard
|
#
setExpiryMonth( string $value )
Sets the card expiry month.
Sets the card expiry month.
Parameters
Returns
|
public
integer
|
#
getExpiryYear( )
Get the card expiry year.
Get the card expiry year.
Returns
integer
|
public
Omnipay\Common\CreditCard
|
#
setExpiryYear( string $value )
Sets the card expiry year.
Sets the card expiry year.
Parameters
Returns
|
public
string
|
#
getExpiryDate( string $format )
Get the card expiry date, using the specified date format string.
Get the card expiry date, using the specified date format string.
Parameters
Returns
string
|
public
string
|
#
getStartMonth( )
Get the card start month.
Get the card start month.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setStartMonth( string $value )
Sets the card start month.
Sets the card start month.
Parameters
Returns
|
public
integer
|
|
public
Omnipay\Common\CreditCard
|
#
setStartYear( string $value )
Sets the card start year.
Sets the card start year.
Parameters
Returns
|
public
string
|
#
getStartDate( string $format )
Get the card start date, using the specified date format string
Get the card start date, using the specified date format string
Parameters
Returns
string
|
public
string
|
#
getCvv( )
Get the card CVV.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setCvv( string $value )
Sets the card CVV.
Parameters
Returns
|
public
string
|
#
getTracks( )
Get raw data for all tracks on the credit card magnetic strip.
Get raw data for all tracks on the credit card magnetic strip.
Returns
string
|
public
string
|
#
getTrack1( )
Get raw data for track 1 on the credit card magnetic strip.
Get raw data for track 1 on the credit card magnetic strip.
Returns
string
|
public
string
|
#
getTrack2( )
Get raw data for track 2 on the credit card magnetic strip.
Get raw data for track 2 on the credit card magnetic strip.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setTracks( $value )
Sets raw data from all tracks on the credit card magnetic strip. Used by gateways that support card-present
transactions.
Sets raw data from all tracks on the credit card magnetic strip. Used by gateways that support card-present
transactions.
Parameters
Returns
|
public
string
|
#
getIssueNumber( )
Get the card issue number.
Get the card issue number.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setIssueNumber( string $value )
Sets the card issue number.
Sets the card issue number.
Parameters
Returns
|
public
string
|
#
getBillingTitle( )
Get the card billing title.
Get the card billing title.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingTitle( string $value )
Sets the card billing title.
Sets the card billing title.
Parameters
Returns
|
public
string
|
#
getBillingName( )
Get the card billing name.
Get the card billing name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingName( string $value )
Sets the card billing name.
Sets the card billing name.
Parameters
Returns
|
public
string
|
#
getBillingFirstName( )
Get the first part of the card billing name.
Get the first part of the card billing name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingFirstName( string $value )
Sets the first part of the card billing name.
Sets the first part of the card billing name.
Parameters
Returns
|
public
string
|
#
getBillingLastName( )
Get the last part of the card billing name.
Get the last part of the card billing name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingLastName( string $value )
Sets the last part of the card billing name.
Sets the last part of the card billing name.
Parameters
Returns
|
public
string
|
#
getBillingCompany( )
Get the billing company name.
Get the billing company name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingCompany( string $value )
Sets the billing company name.
Sets the billing company name.
Parameters
Returns
|
public
string
|
#
getBillingAddress1( )
Get the billing address, line 1.
Get the billing address, line 1.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingAddress1( string $value )
Sets the billing address, line 1.
Sets the billing address, line 1.
Parameters
Returns
|
public
string
|
#
getBillingAddress2( )
Get the billing address, line 2.
Get the billing address, line 2.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingAddress2( string $value )
Sets the billing address, line 2.
Sets the billing address, line 2.
Parameters
Returns
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
#
setBillingPostcode( string $value )
Sets the billing postcode.
Sets the billing postcode.
Parameters
Returns
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
|
public
string
|
#
getBillingCountry( )
Get the billing country name.
Get the billing country name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingCountry( string $value )
Sets the billing country name.
Sets the billing country name.
Parameters
Returns
|
public
string
|
#
getBillingPhone( )
Get the billing phone number.
Get the billing phone number.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingPhone( string $value )
Sets the billing phone number.
Sets the billing phone number.
Parameters
Returns
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
#
setBillingPhoneExtension( string $value )
Sets the billing phone number extension.
Sets the billing phone number extension.
Parameters
Returns
|
public
string
|
#
getBillingFax( )
Get the billing fax number.
Get the billing fax number.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBillingFax( string $value )
Sets the billing fax number.
Sets the billing fax number.
Parameters
Returns
|
public
string
|
#
getShippingTitle( )
Get the title of the card shipping name.
Get the title of the card shipping name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setShippingTitle( string $value )
Sets the title of the card shipping name.
Sets the title of the card shipping name.
Parameters
Returns
|
public
string
|
#
getShippingName( )
Get the card shipping name.
Get the card shipping name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setShippingName( string $value )
Sets the card shipping name.
Sets the card shipping name.
Parameters
Returns
|
public
string
|
#
getShippingFirstName( )
Get the first part of the card shipping name.
Get the first part of the card shipping name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setShippingFirstName( string $value )
Sets the first part of the card shipping name.
Sets the first part of the card shipping name.
Parameters
Returns
|
public
string
|
#
getShippingLastName( )
Get the last part of the card shipping name.
Get the last part of the card shipping name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setShippingLastName( string $value )
Sets the last part of the card shipping name.
Sets the last part of the card shipping name.
Parameters
Returns
|
public
string
|
#
getShippingCompany( )
Get the shipping company name.
Get the shipping company name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setShippingCompany( string $value )
Sets the shipping company name.
Sets the shipping company name.
Parameters
Returns
|
public
string
|
#
getShippingAddress1( )
Get the shipping address, line 1.
Get the shipping address, line 1.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setShippingAddress1( string $value )
Sets the shipping address, line 1.
Sets the shipping address, line 1.
Parameters
Returns
|
public
string
|
#
getShippingAddress2( )
Get the shipping address, line 2.
Get the shipping address, line 2.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setShippingAddress2( string $value )
Sets the shipping address, line 2.
Sets the shipping address, line 2.
Parameters
Returns
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
#
setShippingPostcode( string $value )
Sets the shipping postcode.
Sets the shipping postcode.
Parameters
Returns
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
#
setShippingCountry( string $value )
Sets the shipping country.
Sets the shipping country.
Parameters
Returns
|
public
string
|
#
getShippingPhone( )
Get the shipping phone number.
Get the shipping phone number.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setShippingPhone( string $value )
Sets the shipping phone number.
Sets the shipping phone number.
Parameters
Returns
|
public
string
|
|
public
Omnipay\Common\CreditCard
|
#
setShippingPhoneExtension( string $value )
Sets the shipping phone number extension.
Sets the shipping phone number extension.
Parameters
Returns
|
public
string
|
#
getShippingFax( )
Get the shipping fax number.
Get the shipping fax number.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setShippingFax( string $value )
Sets the shipping fax number.
Sets the shipping fax number.
Parameters
Returns
|
public
string
|
#
getAddress1( )
Get the billing address, line 1.
Get the billing address, line 1.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setAddress1( string $value )
Sets the billing and shipping address, line 1.
Sets the billing and shipping address, line 1.
Parameters
Returns
|
public
string
|
#
getAddress2( )
Get the billing address, line 2.
Get the billing address, line 2.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setAddress2( string $value )
Sets the billing and shipping address, line 2.
Sets the billing and shipping address, line 2.
Parameters
Returns
|
public
string
|
#
getCity( )
Get the billing city.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setCity( string $value )
Sets the billing and shipping city.
Sets the billing and shipping city.
Parameters
Returns
|
public
string
|
#
getPostcode( )
Get the billing postcode.
Get the billing postcode.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setPostcode( string $value )
Sets the billing and shipping postcode.
Sets the billing and shipping postcode.
Parameters
Returns
|
public
string
|
#
getState( )
Get the billing state.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setState( string $value )
Sets the billing and shipping state.
Sets the billing and shipping state.
Parameters
Returns
|
public
string
|
#
getCountry( )
Get the billing country.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setCountry( string $value )
Sets the billing and shipping country.
Sets the billing and shipping country.
Parameters
Returns
|
public
string
|
#
getPhone( )
Get the billing phone number.
Get the billing phone number.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setPhone( string $value )
Sets the billing and shipping phone number.
Sets the billing and shipping phone number.
Parameters
Returns
|
public
string
|
#
getPhoneExtension( )
Get the billing phone number extension.
Get the billing phone number extension.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setPhoneExtension( string $value )
Sets the billing and shipping phone number extension.
Sets the billing and shipping phone number extension.
Parameters
Returns
|
public
string
|
#
getFax( )
Get the billing fax number..
Get the billing fax number..
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setFax( string $value )
Sets the billing and shipping fax number.
Sets the billing and shipping fax number.
Parameters
Returns
|
public
string
|
#
getCompany( )
Get the card billing company name.
Get the card billing company name.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setCompany( string $value )
Sets the billing and shipping company name.
Sets the billing and shipping company name.
Parameters
Returns
|
public
string
|
#
getEmail( )
Get the cardholder's email address.
Get the cardholder's email address.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setEmail( string $value )
Sets the cardholder's email address.
Sets the cardholder's email address.
Parameters
Returns
|
public
string
|
#
getBirthday( $format = 'Y-m-d' )
Get the cardholder's birthday.
Get the cardholder's birthday.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setBirthday( string $value )
Sets the cardholder's birthday.
Sets the cardholder's birthday.
Parameters
Returns
|
public
string
|
#
getGender( )
Get the cardholder's gender.
Get the cardholder's gender.
Returns
string
|
public
Omnipay\Common\CreditCard
|
#
setGender( string $value )
Sets the cardholder's gender.
Sets the cardholder's gender.
Parameters
Returns
|