Class AbstractRequest
Abstract Request
This abstract class implements RequestInterface and defines a basic set of functions that all Omnipay Requests are intended to include.
Requests of this class are usually created using the createRequest function of the gateway and then actioned using methods within this class or a class that extends this class.
Example -- creating a request:
class MyRequest extends \Omnipay\Common\Message\AbstractRequest {}; class MyGateway extends \Omnipay\Common\AbstractGateway { function myRequest($parameters) { $this->createRequest('MyRequest', $parameters); } } // Create the gateway object $gw = Omnipay::create('MyGateway'); // Create the request object $myRequest = $gw->myRequest($someParameters);
Example -- validating and sending a request:
try { $myRequest->validate(); $myResponse = $myRequest->send(); } catch (InvalidRequestException $e) { print "Something went wrong: " . $e->getMessage() . "\n"; } // now do something with the $myResponse object, test for success, etc.
- Omnipay\Common\Message\AbstractRequest implements Omnipay\Common\Message\RequestInterface
Direct known subclasses
Omnipay\Dummy\Message\AuthorizeRequest, Omnipay\VivaPayments\Message\AbstractRestRequestIndirect known subclasses
Omnipay\VivaPayments\Message\FetchTransactionsRequest, Omnipay\VivaPayments\Message\NativeAuthorizeRequest, Omnipay\VivaPayments\Message\NativePurchaseRequest, Omnipay\VivaPayments\Message\RedirectAuthorizeRequest, Omnipay\VivaPayments\Message\RedirectPurchaseRequest, Omnipay\VivaPayments\Message\RefundRequest
Abstract
Namespace: Omnipay\Common\Message
See:
See:
Located at Common/Message/AbstractRequest.php
Namespace: Omnipay\Common\Message
See:
Omnipay\Common\Message\RequestInterface
See:
Omnipay\Common\Message\AbstractResponse
Located at Common/Message/AbstractRequest.php
sendData()
|
getData()
|
protected
Symfony\Component\HttpFoundation\ParameterBag
|
$parameters
The request parameters |
|
protected
|
$httpClient
The request client. |
|
protected
Symfony\Component\HttpFoundation\Request
|
$httpRequest
The HTTP request object. |
|
protected
|
$response
An associated ResponseInterface. |
|
protected
boolean
|
$zeroAmountAllowed
|
#
true
|
protected
boolean
|
$negativeAmountAllowed
|
#
false
|