diff --git a/README.md b/README.md index 3cd64c4..a801457 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ nutshell, it wraps the PHP Omnipay payments library and provides some additional omnipay, see: https://github.com/thephpleague/omnipay ## Requirements - * PHP 8.1+ - * [silverstripe framework](https://github.com/silverstripe/silverstripe-framework) v5 + + * PHP 8.3+ + * [silverstripe framework](https://github.com/silverstripe/silverstripe-framework) v6 + * [omnipay](https://github.com/omnipay/common) 3 & its dependencies - which include guzzle and some symphony libraries. ## Features diff --git a/composer.json b/composer.json index 355f249..4b484f8 100644 --- a/composer.json +++ b/composer.json @@ -5,14 +5,14 @@ "license": "BSD-3-Clause", "keywords": ["silverstripe","payment","omnipay"], "require": { - "php": "^8.1", - "silverstripe/framework": "^5", + "php": "^8.3|^8.4", + "silverstripe/framework": "^6", "omnipay/common": "^3" }, "require-dev": { "guzzlehttp/psr7": "^2.5", "silverstripe/versioned" : "*", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^11", "php-http/guzzle7-adapter": "^1", "omnipay/paypal": "^3", "omnipay/dummy": "^3", @@ -28,7 +28,7 @@ }, "extra" : { "branch-alias": { - "dev-main": "4.x-dev" + "dev-main": "5.x-dev" } }, "scripts": { diff --git a/docs/en/GettingStarted.md b/docs/en/GettingStarted.md index d464be9..7530e80 100644 --- a/docs/en/GettingStarted.md +++ b/docs/en/GettingStarted.md @@ -187,7 +187,7 @@ To do this, you'll need to introduce an extension that utilises the relevent ext For example: ```php -class ShopPayment extends DataExtension { +class ShopPayment extends Extension { private static $has_one = array( 'Order' => 'Order' @@ -212,7 +212,7 @@ This will add a has_many `Payment` relationship to your model, and provide some For example, the following extension will be applied to `Payment`: ```php -class ShopPayment extends DataExtension { +class ShopPayment extends Extension { private static $has_one = array( 'Order' => 'Order' ); diff --git a/src/Extensions/Payable.php b/src/Extensions/Payable.php index 4f3c6f5..ebae3d4 100644 --- a/src/Extensions/Payable.php +++ b/src/Extensions/Payable.php @@ -2,9 +2,9 @@ namespace SilverStripe\Omnipay\Extensions; +use SilverStripe\Core\Extension; use SilverStripe\Omnipay\GatewayInfo; use SilverStripe\Omnipay\Model\Payment; -use SilverStripe\ORM\DataExtension; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\HasManyList; @@ -14,7 +14,7 @@ * @property DataObject|Payable $owner * @method Payment[]|HasManyList Payments() */ -class Payable extends DataExtension +class Payable extends Extension { private static $has_many = [ 'Payments' => Payment::class diff --git a/src/Extensions/WorldPayResponseExtension.php b/src/Extensions/WorldPayResponseExtension.php index 692f23e..0cb4a40 100644 --- a/src/Extensions/WorldPayResponseExtension.php +++ b/src/Extensions/WorldPayResponseExtension.php @@ -5,7 +5,7 @@ use SilverStripe\Core\Extension; use SilverStripe\Control\Director; use SilverStripe\Omnipay\Service\ServiceResponse; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\ArrayData; use SilverStripe\View\SSViewer; use SilverStripe\Control\HTTPResponse; diff --git a/src/Service/PaymentService.php b/src/Service/PaymentService.php index 7bd6dcb..9264f83 100644 --- a/src/Service/PaymentService.php +++ b/src/Service/PaymentService.php @@ -107,7 +107,7 @@ abstract public function complete($data = [], $isNotification = false); * Cancel a payment * * @throws \Exception - * @throws \SilverStripe\ORM\ValidationException + * @throws \SilverStripe\Core\Validation\ValidationException * @throws \SilverStripe\Omnipay\Exception\ServiceException * @return ServiceResponse */ @@ -316,7 +316,7 @@ protected function wrapOmnipayResponse(ResponseInterface $omnipayResponse, $isNo * @param string $endStatus the end state to set on the payment * @param ServiceResponse $serviceResponse the service response * @param mixed $gatewayMessage the message from Omnipay - * @throws \SilverStripe\ORM\ValidationException + * @throws \SilverStripe\Core\Validation\ValidationException */ protected function markCompleted($endStatus, ServiceResponse $serviceResponse, $gatewayMessage) { diff --git a/tests/Extensions/PaymentTestPaymentExtensionHooks.php b/tests/Extensions/PaymentTestPaymentExtensionHooks.php index 302829d..a110b51 100644 --- a/tests/Extensions/PaymentTestPaymentExtensionHooks.php +++ b/tests/Extensions/PaymentTestPaymentExtensionHooks.php @@ -2,14 +2,14 @@ namespace SilverStripe\Omnipay\Tests\Extensions; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; use SilverStripe\Dev\TestOnly; /** * Extension that can be used to test payment hooks * @codeCoverageIgnore */ -class PaymentTestPaymentExtensionHooks extends DataExtension implements TestOnly +class PaymentTestPaymentExtensionHooks extends Extension implements TestOnly { protected static $instances = []; diff --git a/tests/Extensions/TestPaymentExtension.php b/tests/Extensions/TestPaymentExtension.php index fe12fe9..8548b5a 100644 --- a/tests/Extensions/TestPaymentExtension.php +++ b/tests/Extensions/TestPaymentExtension.php @@ -2,11 +2,11 @@ namespace SilverStripe\Omnipay\Tests\Extensions; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; use SilverStripe\Dev\TestOnly; use SilverStripe\Omnipay\Tests\Model\TestOrder; -class TestPaymentExtension extends DataExtension implements TestOnly +class TestPaymentExtension extends Extension implements TestOnly { private static $has_one = [ 'Test_Order' => TestOrder::class diff --git a/tests/i18nTest/_fakewebroot/i18nothermodule/code/i18nTestModuleDecorator.php b/tests/i18nTest/_fakewebroot/i18nothermodule/code/i18nTestModuleDecorator.php index d04ab88..9ac3a6f 100644 --- a/tests/i18nTest/_fakewebroot/i18nothermodule/code/i18nTestModuleDecorator.php +++ b/tests/i18nTest/_fakewebroot/i18nothermodule/code/i18nTestModuleDecorator.php @@ -1,8 +1,8 @@