-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Invalidate existing non store credit payments during checkout #2075
Invalidate existing non store credit payments during checkout #2075
Conversation
source: payment_source, | ||
order: order, | ||
amount: 5 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing method call brace must be on the same line as the last argument when opening brace is on the same line as the first argument.
source: existing_payment_source, | ||
order: order, | ||
amount: 5 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing method call brace must be on the same line as the last argument when opening brace is on the same line as the first argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
8e11b15
to
438c997
Compare
438c997
to
6c88998
Compare
Waits for #2076 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still seems not quite right to me to special-case store credits like this. It feels like there must be a better way of accomplishing what's needed here.
But in any case this does feel like a step forward.
6c88998
to
f46a1ca
Compare
f46a1ca
to
149cd5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 just needs a Changelog conflict resolution!
The spec setup for the order payment spec creates multiple payments that all have a different payment method ids because the factory creates a new payment method object for each payment. By using the same payment method for all payments we test what actually happens during checkout.
In order to refactor the Payment#invalidate_old_payments method we need more test coverage.
Existing payments other then store credit ones should be invalidated when creating new payments.
When creating a new payment for an order having existing payments we want all previous payments in checkout state to be invalidated; except if they are store credit payments. Former implementation only invalidated payments with same payment method. That led to multiple valid payments per order for stores having more then one payment method available for customers to choose from.
149cd5d
to
b15ab06
Compare
When creating a new payment for an order having existing payments
we want all previous payments in checkout state to be invalidated; except
if they are store credit payments.
Former implementation only invalidated payments with same payment method.
That led to multiple valid payments per order for stores having more then
one payment method available for customers to choose from.