SilverStripe\Omnipay\Service\CaptureService::initiate
Capture a previously authorized payment
If the transaction-reference of the payment to capture is known, pass it via $data as `transactionReference` parameter. Otherwise the service will try to look up the reference from previous payment messages. If there's no transaction-reference to be found, this method will raise an exception. You can issue partial captures (if the gateway supports it) by passing an `amount` parameter in the $data array. The amount can also exceed the authorized amount, if the configuration allows it (`max_capture` setting). An amount that exceeds the authorized amount will always be considered as a full capture! If the amount given is not a number, or if it exceeds the total possible capture amount, an exception will be raised.
Signature
public function initiate([array
$data = ] )
Parameters
$data
— array- payment data
Returns
- void
- the service response
Errors/Exceptions
-
MissingParameterException
- if no transaction reference can be found from messages or parameters
-
InvalidParameterException
- if the amount parameter was invalid
-
InvalidStateException
- when the payment is in a state that prevents running `complete`
-
InvalidConfigurationException
- when there's a misconfiguration in the module itself