Source of file TestNotifyResponseExtension.php
Size: 0,860 Bytes - Last Modified: 2021-12-24T06:34:53+00:00
/var/www/docs.ssmods.com/process/src/tests/Extensions/TestNotifyResponseExtension.php
123456789101112131415161718192021222324252627 | <?php namespace SilverStripe\Omnipay\Tests\Extensions; use SilverStripe\Core\Extension; use SilverStripe\Dev\TestOnly; use SilverStripe\Omnipay\Model\Payment; use SilverStripe\Omnipay\Service\ServiceResponse; use SilverStripe\Control\HTTPResponse; class TestNotifyResponseExtension extends Extension implements TestOnly { public function updateServiceResponse(ServiceResponse $serviceResponse) { if ($serviceResponse->isNotification()) { if ($serviceResponse->getPayment()->Gateway == 'FantasyGateway') { $httpResponse = new HTTPResponse('OK', 200); $httpResponse->addHeader('X-FantasyGateway-Api', 'apikey12345'); } else { $httpResponse = new HTTPResponse('SUCCESS', 200); } $serviceResponse->setHttpResponse($httpResponse); } } } |