SilverStripe\Omnipay\Extensions\SagePayExtension
Sagepay has some very indiviual needs so to help we have created this extension that you can use as a beginning to try and help your SagePay transaction to go through. Add it to your YML file e.g.
SilverStripe\Omnipay\Service\PaymentService:
extensions:
- SagePayExtension
The extension adds following:
- A Description into the initial request (reequired by SagePay)
- The proper transactionReference which is recieved back from SagePay
- A response to the notification (See use_async_notification)
Synopsis
class SagePayExtension
extends Extension
{
- // methods
- public void onBeforePurchase()
- public void onBeforeAuthorize()
- public void updateServiceResponse()
- public void onBeforeCompletePurchase()
- public void onBeforeCompleteAuthorize()
- private void addTransactionReference()
- private void addDescription()
- private void respondToNotification()
Hierarchy
Extends
- SilverStripe\Core\Extension
Methods
private
- addDescription() — Description for SagePay must be < 100 characters
- addTransactionReference() — Grabs the transactionReference from the previous received message and adds it to the gateway data, so that it can be sent back to SagePay as clarification
- respondToNotification() — Used to respond to the SagePay notification