Skip to content

Commit a4dd4ec

Browse files
committed
docs: update upgrade notes for RequestConfiguration replacement in payment processing
1 parent a9d8f04 commit a4dd4ec

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

UPGRADE-2.3.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,72 @@
7171
> and their default parameters include Payment Request-specific values (e.g. `hash: paymentRequest.getHash()`).
7272
> Do not use them to configure the Payum after-pay redirect.
7373

74+
4. The `RequestConfiguration` type has been replaced by `Request` in all payment processing interfaces and their implementations.
75+
76+
If you implemented or decorated any of the following interfaces, update your method signatures accordingly:
77+
78+
- `Sylius\Bundle\CoreBundle\OrderPay\Provider\PayResponseProviderInterface`:
79+
```diff
80+
-public function getResponse(RequestConfiguration $requestConfiguration, OrderInterface $order): Response;
81+
-public function supports(RequestConfiguration $requestConfiguration, OrderInterface $order): bool;
82+
+public function getResponse(Request $request, OrderInterface $order): Response;
83+
+public function supports(Request $request, OrderInterface $order): bool;
84+
```
85+
86+
- `Sylius\Bundle\CoreBundle\OrderPay\Provider\AfterPayResponseProviderInterface`:
87+
```diff
88+
-public function getResponse(RequestConfiguration $requestConfiguration): Response;
89+
-public function supports(RequestConfiguration $requestConfiguration): bool;
90+
+public function getResponse(Request $request): Response;
91+
+public function supports(Request $request): bool;
92+
```
93+
94+
- `Sylius\Bundle\PaymentBundle\Provider\HttpResponseProviderInterface`:
95+
```diff
96+
-public function supports(RequestConfiguration $requestConfiguration, PaymentRequestInterface $paymentRequest): bool;
97+
-public function getResponse(RequestConfiguration $requestConfiguration, PaymentRequestInterface $paymentRequest): Response;
98+
+public function supports(Request $request, PaymentRequestInterface $paymentRequest): bool;
99+
+public function getResponse(Request $request, PaymentRequestInterface $paymentRequest): Response;
100+
```
101+
102+
- `Sylius\Bundle\PaymentBundle\Processor\HttpResponseProcessorInterface`:
103+
```diff
104+
-public function process(RequestConfiguration $requestConfiguration, PaymentRequestInterface $paymentRequest): ?Response;
105+
+public function process(Request $request, PaymentRequestInterface $paymentRequest): ?Response;
106+
```
107+
108+
- `Sylius\Bundle\CoreBundle\OrderPay\Handler\PaymentStateFlashHandlerInterface`:
109+
```diff
110+
-public function handle(RequestConfiguration $requestConfiguration, string $state): void;
111+
+public function handle(Request $request, string $state): void;
112+
```
113+
114+
5. `MetadataInterface` and `RequestConfigurationFactoryInterface` have been removed from the constructors of `OrderPayController` and `PaymentRequestPayAction`.
115+
116+
If you extended or decorated either of these classes, update their constructors:
117+
118+
- `Sylius\Bundle\CoreBundle\OrderPay\Controller\OrderPayController`:
119+
```diff
120+
public function __construct(
121+
private OrderRepositoryInterface $orderRepository,
122+
- private MetadataInterface $orderMetadata,
123+
- private RequestConfigurationFactoryInterface $requestConfigurationFactory,
124+
private iterable $payResponseProviders,
125+
private iterable $afterPayResponseProviders,
126+
) {}
127+
```
128+
129+
- `Sylius\Bundle\CoreBundle\OrderPay\Action\PaymentRequestPayAction`:
130+
```diff
131+
public function __construct(
132+
- private MetadataInterface $paymentRequestMetadata,
133+
- private RequestConfigurationFactoryInterface $requestConfigurationFactory,
134+
private PaymentRequestRepositoryInterface $paymentRequestRepository,
135+
private HttpResponseProcessorInterface $httpResponseProcessor,
136+
private UrlProviderInterface $afterPayUrlProvider,
137+
) {}
138+
```
139+
74140
## Dependencies
75141

76142
1. The `behat/transliterator` package has been **deprecated** and will be removed in Sylius 3.0.

0 commit comments

Comments
 (0)