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

Store credit cancel #6

Merged
merged 4 commits into from
Nov 24, 2016
Merged

Store credit cancel #6

merged 4 commits into from
Nov 24, 2016

Conversation

gmacdougall
Copy link

Improve store credit cancellation

This brings in two PR's from Solidus which improve the flow of cancelling orders with store credit payments:

solidusio#1292
solidusio#1603

@bbuchalter
Copy link

When I cancel an order with captured store payments, I see my store credit payment is voided, but when I view the ledger history, I see no originator for the reversing entry.
screen shot 2016-11-22 at 8 43 46 pm

Sinetheta and others added 3 commits November 23, 2016 08:26
This is a payment method, if it returns a boolean then
spree/payment/processing.rb will blow up. We are seeing this happen when
captured store credits are refunded and the handle_void_response method
tries to check the response.success?

Although I have not added a test for the last code path, I think we can
refactor it away when we're done with our changes.
This will not attempt to credit store credit for zero dollar amount,
which will trigger errors.
Previously there was some unsafe math where numbers were multiplied and
divided by 100 in the store credit section. This is a step towards
getting rid of that.
@gmacdougall
Copy link
Author

I added the originator in to that such that it gets sent in to the ledger.

@bbuchalter
Copy link

When I complete an order using only store credit, refund the full amount of the store credit and then cancel the order I get this error: https://app.bugsnag.com/tommy-john-inc/tommyjohn-dot-com/errors/5835a32107b7add195afef27?filters%5Bevent.since%5D%5B%5D=30d&filters%5Berror.status%5D%5B%5D=open

When a payment is cancelled, previously it would attempt to return the
whole amount to the store credit even if it had been entirely or
partially refunded.

Conflicts:
	core/app/models/spree/payment_method/store_credit.rb
	core/spec/models/spree/payment_method/store_credit_spec.rb
@gmacdougall
Copy link
Author

I have updated this to correctly work when the full amount is already refunded.

@stewart stewart merged commit 4aa3763 into v1.2.2 Nov 24, 2016
@stewart stewart deleted the store-credit-cancel branch November 24, 2016 20:22
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.

4 participants