Skip to content

Conversation

@ernestwisniewski
Copy link
Contributor

This PR fixes #311

Copy link
Member

@jakubtobiasz jakubtobiasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I'm reading this PR, maybe we just don't need this retry payment action. Try to leave only the redirection, if it works, then it means we don't need to do anything else, and this code became obsolete in the meantime (I guess Sylius 2.x introduced changed behavior)

Comment on lines 53 to 60
if (null !== $order->getLastPayment(PaymentInterface::STATE_NEW)) {
$this->addFlashMessage(self::INFO_FLASH_TYPE, 'commerce_weavers_sylius_tpay.shop.retry_payment.ready_to_retry');

return new RedirectResponse(
$this->router->generate('sylius_shop_order_show', ['tokenValue' => $orderToken]),
);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd go with PaymentCancellationRequirementCheckerInterface and based on that we should redirect to the show page with or without dispatching the cancellation command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retry failed payment creates not needed canceled payment entry for the order

3 participants