PHP Class Omnipay\Common\Message\AbstractRequest

Inheritance: implements Omnipay\Common\Message\RequestInterface
Afficher le fichier Open project: omnipay/common Class Usage Examples

Protected Properties

Свойство Type Description
$httpClient Guzzle\Http\ClientInterface The request client.
$httpRequest Symfony\Component\HttpFoundation\Request The HTTP request object.
$negativeAmountAllowed boolean
$parameters Symfony\Component\HttpFoundation\ParameterBag The request parameters
$response Omnipay\Common\Message\ResponseInterface An associated ResponseInterface.
$zeroAmountAllowed boolean

Méthodes publiques

Méthode Description
__construct ( Guzzle\Http\ClientInterface $httpClient, Request $httpRequest ) Create a new Request
formatCurrency ( $amount ) : string Format an amount for the payment currency.
getAmount ( ) : string Validates and returns the formated amount.
getAmountInteger ( ) : integer Get the payment amount as an integer.
getCancelUrl ( ) : string Get the request cancel URL.
getCard ( ) : CreditCard Get the card.
getCardReference ( ) : string Get the card reference.
getClientIp ( ) : string Get the client IP address.
getCurrency ( ) : string Get the payment currency code.
getCurrencyDecimalPlaces ( ) : integer Get the number of decimal places in the payment currency.
getCurrencyNumeric ( ) : integer Get the payment currency number.
getDescription ( ) : string Get the request description.
getIssuer ( ) : string Get the payment issuer.
getItems ( ) : Omnipay\Common\ItemBag | null A list of items in this order
getNotifyUrl ( ) : string Get the request notify URL.
getParameters ( ) : array Get all parameters as an associative array.
getPaymentMethod ( ) : string Get the payment issuer.
getResponse ( ) : Omnipay\Common\Message\ResponseInterface Get the associated Response.
getReturnUrl ( ) : string Get the request return URL.
getTestMode ( ) : boolean Gets the test mode of the request from the gateway.
getToken ( ) : string Get the card token.
getTransactionId ( ) : string Get the transaction ID.
getTransactionReference ( ) : string Get the transaction reference.
initialize ( array $parameters = [] ) Initialize the object with parameters.
send ( ) : Omnipay\Common\Message\ResponseInterface Send the request
setAmount ( string $value ) : AbstractRequest Sets the payment amount.
setCancelUrl ( string $value ) : AbstractRequest Sets the request cancel URL.
setCard ( CreditCard $value ) : AbstractRequest Sets the card.
setCardReference ( string $value ) : AbstractRequest Sets the card reference.
setClientIp ( string $value ) : AbstractRequest Sets the client IP address.
setCurrency ( string $value ) : AbstractRequest Sets the payment currency code.
setDescription ( string $value ) : AbstractRequest Sets the request description.
setIssuer ( string $value ) : AbstractRequest Set the payment issuer.
setItems ( Omnipay\Common\ItemBag | array $items ) : AbstractRequest Set the items in this order
setNotifyUrl ( string $value ) : AbstractRequest Sets the request notify URL.
setPaymentMethod ( string $value ) : AbstractRequest Set the payment method.
setReturnUrl ( string $value ) : AbstractRequest Sets the request return URL.
setTestMode ( boolean $value ) : AbstractRequest Sets the test mode of the request.
setToken ( string $value ) : AbstractRequest Sets the card token.
setTransactionId ( string $value ) : AbstractRequest Sets the transaction ID.
setTransactionReference ( string $value ) : AbstractRequest Sets the transaction reference.
toFloat ( $value ) : float Convert an amount into a float.
validate ( ) Validate the request.

Méthodes protégées

Méthode Description
getParameter ( string $key ) : mixed Get a single parameter.
setParameter ( string $key, mixed $value ) : AbstractRequest Set a single parameter

Private Methods

Méthode Description
getCurrencyDecimalFactor ( )

Method Details

__construct() public méthode

Create a new Request
public __construct ( Guzzle\Http\ClientInterface $httpClient, Request $httpRequest )
$httpClient Guzzle\Http\ClientInterface A Guzzle client to make API calls with
$httpRequest Symfony\Component\HttpFoundation\Request A Symfony HTTP request object

formatCurrency() public méthode

Format an amount for the payment currency.
public formatCurrency ( $amount ) : string
Résultat string

getAmount() public méthode

Validates and returns the formated amount.
public getAmount ( ) : string
Résultat string The amount formatted to the correct number of decimal places for the selected currency.

getAmountInteger() public méthode

Get the payment amount as an integer.
public getAmountInteger ( ) : integer
Résultat integer

getCancelUrl() public méthode

Get the request cancel URL.
public getCancelUrl ( ) : string
Résultat string

getCard() public méthode

Get the card.
public getCard ( ) : CreditCard
Résultat Omnipay\Common\CreditCard

getCardReference() public méthode

Get the card reference.
public getCardReference ( ) : string
Résultat string

getClientIp() public méthode

Get the client IP address.
public getClientIp ( ) : string
Résultat string

getCurrency() public méthode

Get the payment currency code.
public getCurrency ( ) : string
Résultat string

getCurrencyDecimalPlaces() public méthode

Get the number of decimal places in the payment currency.
public getCurrencyDecimalPlaces ( ) : integer
Résultat integer

getCurrencyNumeric() public méthode

Get the payment currency number.
public getCurrencyNumeric ( ) : integer
Résultat integer

getDescription() public méthode

Get the request description.
public getDescription ( ) : string
Résultat string

getIssuer() public méthode

This field is used by some European gateways, and normally represents the bank where an account is held (separate from the card brand).
public getIssuer ( ) : string
Résultat string

getItems() public méthode

A list of items in this order
public getItems ( ) : Omnipay\Common\ItemBag | null
Résultat Omnipay\Common\ItemBag | null A bag containing items in this order

getNotifyUrl() public méthode

Get the request notify URL.
public getNotifyUrl ( ) : string
Résultat string

getParameter() protected méthode

Get a single parameter.
protected getParameter ( string $key ) : mixed
$key string The parameter key
Résultat mixed

getParameters() public méthode

Get all parameters as an associative array.
public getParameters ( ) : array
Résultat array

getPaymentMethod() public méthode

This field is used by some European gateways, which support multiple payment providers with a single API.
public getPaymentMethod ( ) : string
Résultat string

getResponse() public méthode

Get the associated Response.
public getResponse ( ) : Omnipay\Common\Message\ResponseInterface
Résultat Omnipay\Common\Message\ResponseInterface

getReturnUrl() public méthode

Get the request return URL.
public getReturnUrl ( ) : string
Résultat string

getTestMode() public méthode

Gets the test mode of the request from the gateway.
public getTestMode ( ) : boolean
Résultat boolean

getToken() public méthode

Get the card token.
public getToken ( ) : string
Résultat string

getTransactionId() public méthode

The transaction ID is the identifier generated by the merchant website.
public getTransactionId ( ) : string
Résultat string

getTransactionReference() public méthode

The transaction reference is the identifier generated by the remote payment gateway.
public getTransactionReference ( ) : string
Résultat string

initialize() public méthode

If any unknown parameters passed, they will be ignored.
public initialize ( array $parameters = [] )
$parameters array An associative array of parameters

send() public méthode

Send the request
public send ( ) : Omnipay\Common\Message\ResponseInterface
Résultat Omnipay\Common\Message\ResponseInterface

setAmount() public méthode

Sets the payment amount.
public setAmount ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setCancelUrl() public méthode

Sets the request cancel URL.
public setCancelUrl ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setCard() public méthode

Sets the card.
public setCard ( CreditCard $value ) : AbstractRequest
$value Omnipay\Common\CreditCard
Résultat AbstractRequest Provides a fluent interface

setCardReference() public méthode

Sets the card reference.
public setCardReference ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setClientIp() public méthode

Sets the client IP address.
public setClientIp ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setCurrency() public méthode

Sets the payment currency code.
public setCurrency ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setDescription() public méthode

Sets the request description.
public setDescription ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setIssuer() public méthode

This field is used by some European gateways, and normally represents the bank where an account is held (separate from the card brand).
public setIssuer ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setItems() public méthode

Set the items in this order
public setItems ( Omnipay\Common\ItemBag | array $items ) : AbstractRequest
$items Omnipay\Common\ItemBag | array An array of items in this order
Résultat AbstractRequest

setNotifyUrl() public méthode

Sets the request notify URL.
public setNotifyUrl ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setParameter() protected méthode

Set a single parameter
protected setParameter ( string $key, mixed $value ) : AbstractRequest
$key string The parameter key
$value mixed The value to set
Résultat AbstractRequest Provides a fluent interface

setPaymentMethod() public méthode

This field is used by some European gateways, which support multiple payment providers with a single API.
public setPaymentMethod ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setReturnUrl() public méthode

Sets the request return URL.
public setReturnUrl ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setTestMode() public méthode

Sets the test mode of the request.
public setTestMode ( boolean $value ) : AbstractRequest
$value boolean True for test mode on.
Résultat AbstractRequest

setToken() public méthode

Sets the card token.
public setToken ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setTransactionId() public méthode

Sets the transaction ID.
public setTransactionId ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

setTransactionReference() public méthode

Sets the transaction reference.
public setTransactionReference ( string $value ) : AbstractRequest
$value string
Résultat AbstractRequest Provides a fluent interface

toFloat() public méthode

Convert an amount into a float.
public toFloat ( $value ) : float
Résultat float The amount converted to a float.

validate() public méthode

This method is called internally by gateways to avoid wasting time with an API call when the request is clearly invalid.
public validate ( )

Property Details

$httpClient protected_oe property

The request client.
protected ClientInterface,Guzzle\Http $httpClient
Résultat Guzzle\Http\ClientInterface

$httpRequest protected_oe property

The HTTP request object.
protected Request,Symfony\Component\HttpFoundation $httpRequest
Résultat Symfony\Component\HttpFoundation\Request

$negativeAmountAllowed protected_oe property

protected bool $negativeAmountAllowed
Résultat boolean

$parameters protected_oe property

The request parameters
protected ParameterBag,Symfony\Component\HttpFoundation $parameters
Résultat Symfony\Component\HttpFoundation\ParameterBag

$response protected_oe property

An associated ResponseInterface.
protected ResponseInterface,Omnipay\Common\Message $response
Résultat Omnipay\Common\Message\ResponseInterface

$zeroAmountAllowed protected_oe property

protected bool $zeroAmountAllowed
Résultat boolean