To unify all payment gateway driver communication, an
Aero\Payment\Responses\PaymentResponse class is used. This common class must be returned from the
Setting the payment view
PaymentResponse can define a view to output. To do so, pass the view to the
setView method. If no view is set, a JSON response will be returned.
Passing data to the payment view
If there is data to be passed to the view or JSON response, the
setData method should be used.
Marking as successful
To indicate that the action carried out in the method was successful, then the response should be flagged as successful calling the
setSuccessful method on the
Adding error messages
If an error occurred during the action, these messages can be passed to the
PaymentResponse using the
Redirecting the user
If further action is required where the user needs to be redirected to a different URL (to complete 3D-secure on the card issuers website for example), a redirect can be set using the