PPSYL-138 - Use Payment request flow for payplug#169
Conversation
Only for redirect, add CapturePaymentRequest, StatusPaymentRequest
… that could redirect to payplug
…Request that could redirect to payplug
601bca8 to
df00d8d
Compare
| ); | ||
| } | ||
|
|
||
| private function updatePaymentState(PaymentInterface $payment): void |
There was a problem hiding this comment.
Duplicate of NotifyPaymentRequestHandler::updatePaymentState, should we refactor it?
There was a problem hiding this comment.
Let's keep like that for now. We may have to come back on these developments. On a next iteration, we could add a new service to apply state machine change
| 'cancel_url' => $returnUrl . '?&' . http_build_query(['status' => PayPlugApiClientInterface::STATUS_CANCELED]), | ||
| ]; | ||
|
|
||
| $notificationUrl = $this->urlGenerator->generate('sylius_payment_method_notify', ['code' => $payment->getMethod()?->getCode()], UrlGeneratorInterface::ABSOLUTE_URL); |
There was a problem hiding this comment.
I can see why a specific service to create this url can be required...
| $notificationUrl = $this->urlGenerator->generate('sylius_payment_method_notify', ['code' => $payment->getMethod()?->getCode()], UrlGeneratorInterface::ABSOLUTE_URL); | ||
| $details['notification_url'] = $notificationUrl; | ||
|
|
||
| $paymentRequest->setPayload($data); |
There was a problem hiding this comment.
I understand why you set this here, but the purpose of the payload is to serve as the input of the PaymentRequest, meaning a payload can be already set by an API call for example.
Then you can avoid setting this here but instead keep it inside the responseData or the Payment->setDetails().
No description provided.