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\Fatzebra\Message\AbstractRestRequestIndirect known subclasses
Omnipay\Fatzebra\Message\CreateCardRequest, Omnipay\Fatzebra\Message\CreateCustomerRequest, Omnipay\Fatzebra\Message\PurchaseRequest, Omnipay\Fatzebra\Message\RefundRequest, Omnipay\Fatzebra\Message\CreatePlanRequest, Omnipay\Fatzebra\Message\CreateSubscriptionRequest, Omnipay\Fatzebra\Message\DeleteCustomerRequest, Omnipay\Fatzebra\Message\FetchAllPlansRequest, Omnipay\Fatzebra\Message\FetchCustomerRequest, Omnipay\Fatzebra\Message\FetchPlanRequest, Omnipay\Fatzebra\Message\FetchSubscriptionRequest, Omnipay\Fatzebra\Message\FetchTransactionRequest
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
|