Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect Tpay payment channel constraints when displaying available payment methods #226

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

coldic3
Copy link
Member

@coldic3 coldic3 commented Dec 11, 2024

No description provided.

Comment on lines +42 to +44
$validTpayChannelList = $this->orderAwareValidTpayChannelListProvider->provide($order);

return isset($validTpayChannelList[$tpayChannelId]);
Copy link
Member

Choose a reason for hiding this comment

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

would be better to pass expected tpayChannelId to the function itself, so we won't always iterate over all channels and perhaps we can optimise it event further then

Suggested change
$validTpayChannelList = $this->orderAwareValidTpayChannelListProvider->provide($order);
return isset($validTpayChannelList[$tpayChannelId]);
return $this->orderAwareValidTpayChannelListProvider->provide($order, $tpayChannelId);

but naming of class and function would need to be adjusted as well

Copy link
Member Author

Choose a reason for hiding this comment

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

This OrderAwareValidTpayChannelListProvider is also used in BankListContextProvider so I cannot simply change it. However, we can extract the logic of constraint checking from OrderAwareValidTpayChannelListProvider to the separate service and then use it here.

@lchrusciel lchrusciel merged commit 88c81b8 into main Dec 11, 2024
4 checks passed
@lchrusciel lchrusciel deleted the feature/respect-constraints-in-tpay-channel-list branch December 11, 2024 11:59
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.

DX-770 Respect Tpay payment channel constraints when displaying available payment methods
2 participants