SilverStripe\Omnipay\Service\RefundService::initiate
Return money to the previously charged credit card.
If the transaction-reference of the payment to refund is known, pass it via $data as `transactionReference` parameter. Otherwise the service will look up the previous reference from the payment itself. If there's no transaction-reference to be found, this method will raise an exception. You can issue partial refunds (if the gateway supports it) by passing an `amount` parameter in the $data array. If the amount given is not a number, or if it exceeds the total amount of the payment, 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