PHP Класс Omnipay\Common\Message\AbstractRequest

Наследование: implements Omnipay\Common\Message\RequestInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
getParameter ( string $key ) : mixed Get a single parameter.
setParameter ( string $key, mixed $value ) : AbstractRequest Set a single parameter

Приватные методы

Метод Описание
getCurrencyDecimalFactor ( )

Описание методов

__construct() публичный Метод

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() публичный Метод

Format an amount for the payment currency.
public formatCurrency ( $amount ) : string
Результат string

getAmount() публичный Метод

Validates and returns the formated amount.
public getAmount ( ) : string
Результат string The amount formatted to the correct number of decimal places for the selected currency.

getAmountInteger() публичный Метод

Get the payment amount as an integer.
public getAmountInteger ( ) : integer
Результат integer

getCancelUrl() публичный Метод

Get the request cancel URL.
public getCancelUrl ( ) : string
Результат string

getCard() публичный Метод

Get the card.
public getCard ( ) : CreditCard
Результат Omnipay\Common\CreditCard

getCardReference() публичный Метод

Get the card reference.
public getCardReference ( ) : string
Результат string

getClientIp() публичный Метод

Get the client IP address.
public getClientIp ( ) : string
Результат string

getCurrency() публичный Метод

Get the payment currency code.
public getCurrency ( ) : string
Результат string

getCurrencyDecimalPlaces() публичный Метод

Get the number of decimal places in the payment currency.
public getCurrencyDecimalPlaces ( ) : integer
Результат integer

getCurrencyNumeric() публичный Метод

Get the payment currency number.
public getCurrencyNumeric ( ) : integer
Результат integer

getDescription() публичный Метод

Get the request description.
public getDescription ( ) : string
Результат string

getIssuer() публичный Метод

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
Результат string

getItems() публичный Метод

A list of items in this order
public getItems ( ) : Omnipay\Common\ItemBag | null
Результат Omnipay\Common\ItemBag | null A bag containing items in this order

getNotifyUrl() публичный Метод

Get the request notify URL.
public getNotifyUrl ( ) : string
Результат string

getParameter() защищенный Метод

Get a single parameter.
protected getParameter ( string $key ) : mixed
$key string The parameter key
Результат mixed

getParameters() публичный Метод

Get all parameters as an associative array.
public getParameters ( ) : array
Результат array

getPaymentMethod() публичный Метод

This field is used by some European gateways, which support multiple payment providers with a single API.
public getPaymentMethod ( ) : string
Результат string

getResponse() публичный Метод

Get the associated Response.
public getResponse ( ) : Omnipay\Common\Message\ResponseInterface
Результат Omnipay\Common\Message\ResponseInterface

getReturnUrl() публичный Метод

Get the request return URL.
public getReturnUrl ( ) : string
Результат string

getTestMode() публичный Метод

Gets the test mode of the request from the gateway.
public getTestMode ( ) : boolean
Результат boolean

getToken() публичный Метод

Get the card token.
public getToken ( ) : string
Результат string

getTransactionId() публичный Метод

The transaction ID is the identifier generated by the merchant website.
public getTransactionId ( ) : string
Результат string

getTransactionReference() публичный Метод

The transaction reference is the identifier generated by the remote payment gateway.
public getTransactionReference ( ) : string
Результат string

initialize() публичный Метод

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

send() публичный Метод

Send the request
public send ( ) : Omnipay\Common\Message\ResponseInterface
Результат Omnipay\Common\Message\ResponseInterface

setAmount() публичный Метод

Sets the payment amount.
public setAmount ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setCancelUrl() публичный Метод

Sets the request cancel URL.
public setCancelUrl ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setCard() публичный Метод

Sets the card.
public setCard ( CreditCard $value ) : AbstractRequest
$value Omnipay\Common\CreditCard
Результат AbstractRequest Provides a fluent interface

setCardReference() публичный Метод

Sets the card reference.
public setCardReference ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setClientIp() публичный Метод

Sets the client IP address.
public setClientIp ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setCurrency() публичный Метод

Sets the payment currency code.
public setCurrency ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setDescription() публичный Метод

Sets the request description.
public setDescription ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setIssuer() публичный Метод

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
Результат AbstractRequest Provides a fluent interface

setItems() публичный Метод

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
Результат AbstractRequest

setNotifyUrl() публичный Метод

Sets the request notify URL.
public setNotifyUrl ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setParameter() защищенный Метод

Set a single parameter
protected setParameter ( string $key, mixed $value ) : AbstractRequest
$key string The parameter key
$value mixed The value to set
Результат AbstractRequest Provides a fluent interface

setPaymentMethod() публичный Метод

This field is used by some European gateways, which support multiple payment providers with a single API.
public setPaymentMethod ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setReturnUrl() публичный Метод

Sets the request return URL.
public setReturnUrl ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setTestMode() публичный Метод

Sets the test mode of the request.
public setTestMode ( boolean $value ) : AbstractRequest
$value boolean True for test mode on.
Результат AbstractRequest

setToken() публичный Метод

Sets the card token.
public setToken ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setTransactionId() публичный Метод

Sets the transaction ID.
public setTransactionId ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

setTransactionReference() публичный Метод

Sets the transaction reference.
public setTransactionReference ( string $value ) : AbstractRequest
$value string
Результат AbstractRequest Provides a fluent interface

toFloat() публичный Метод

Convert an amount into a float.
public toFloat ( $value ) : float
Результат float The amount converted to a float.

validate() публичный Метод

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

Описание свойств

$httpClient защищенное свойство

The request client.
protected ClientInterface,Guzzle\Http $httpClient
Результат Guzzle\Http\ClientInterface

$httpRequest защищенное свойство

The HTTP request object.
protected Request,Symfony\Component\HttpFoundation $httpRequest
Результат Symfony\Component\HttpFoundation\Request

$negativeAmountAllowed защищенное свойство

protected bool $negativeAmountAllowed
Результат boolean

$parameters защищенное свойство

The request parameters
protected ParameterBag,Symfony\Component\HttpFoundation $parameters
Результат Symfony\Component\HttpFoundation\ParameterBag

$response защищенное свойство

An associated ResponseInterface.
protected ResponseInterface,Omnipay\Common\Message $response
Результат Omnipay\Common\Message\ResponseInterface

$zeroAmountAllowed защищенное свойство

protected bool $zeroAmountAllowed
Результат boolean