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

Fixed and deprecated payment.isRefundable #403

Merged
merged 3 commits into from
Jan 27, 2025
Merged

Conversation

janpaepke
Copy link
Collaborator

The isRefundable helper on a payment actually never returned false, because the strict null comparison is incorrect.
If amountRemaining is not provided (as it is for non-refundable payments), it is undefined rather than null.

This is also reflected in canBeRefunded, which is correct and should be used instead.
To not make this a breaking change, I fixed the behaviour and deprecated the method.

supersedes #385

@janpaepke janpaepke requested a review from edorivai January 27, 2025 10:56
@janpaepke janpaepke added the bug Unexpected behaviour. label Jan 27, 2025
Copy link
Collaborator

@edorivai edorivai left a comment

Choose a reason for hiding this comment

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

LGTM

@janpaepke janpaepke merged commit 57d84be into master Jan 27, 2025
5 checks passed
@janpaepke janpaepke deleted the fix/isRefundable branch January 27, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behaviour.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants