Allow capturing or voiding payments only with positive amount#3761
Merged
kennyadsl merged 2 commits intoSep 18, 2020
Merged
Conversation
3aa00c7 to
9a165de
Compare
aldesantis
approved these changes
Sep 15, 2020
There's no point in capturing or voiding a payment with zero amount. When capturing zero amount, ActiveMerchant will respond with the error `This value must be greater than or equal to 1.`, while if payment amount is zero, the error from ActiveMerchant responds with the error `Amount must be at least $0.50 usd`.
The paramenter `amount` is renamed to avoid shadowing the method with the same name in `Spree::Payment`, which includes this module.
9a165de to
9a58a45
Compare
spaghetticode
added a commit
to spaghetticode/solidus_stripe
that referenced
this pull request
Oct 2, 2020
In Solidus we changed the way we void payments. When the payment has zero amount we don't try to void anymore.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
There's no point in capturing or voiding a payment with zero amount. When capturing zero amount, ActiveMerchant will respond with the error
This value must be greater than or equal to 1., while if payment amount is zero, the error from ActiveMerchant responds with the errorAmount must be at least $0.50 usd.Checklist: