-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
beb3b0d
to
3de4145
Compare
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.
3de4145
to
fc86cfa
Compare
I added the originator in to that such that it gets sent in to the ledger. |
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
fc86cfa
to
af21dd1
Compare
I have updated this to correctly work when the full amount is already refunded. |
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