Skip to content

Log refund gateway responses on payments#6452

Closed
BeastNectus wants to merge 1 commit into
solidusio:mainfrom
BeastNectus:fix-refund-payment-log-entry
Closed

Log refund gateway responses on payments#6452
BeastNectus wants to merge 1 commit into
solidusio:mainfrom
BeastNectus:fix-refund-payment-log-entry

Conversation

@BeastNectus
Copy link
Copy Markdown
Contributor

Summary

  • record successful refund gateway responses on the original payment instead of the refund record
  • wrap the refund transaction id update and log entry creation in one database transaction
  • update the refund spec to assert the payment receives the refund log entry

Closes #4866

Notes

The admin payment page renders @payment.log_entries, so storing the refund response on refund.log_entries meant the gateway response was persisted but not visible from the payment admin view.

Testing

  • ruby --disable=gems -c core/app/models/spree/refund.rb
  • ruby --disable=gems -c core/spec/models/spree/refund_spec.rb
  • git diff --check

I attempted bundle exec rspec core/spec/models/spree/refund_spec.rb, but this Windows environment blocked Ruby's native cgi/escape.so via Application Control policy before the spec suite could boot.

@BeastNectus BeastNectus requested a review from a team as a code owner April 24, 2026 12:06
@github-actions github-actions Bot added the changelog:solidus_core Changes to the solidus_core gem label Apr 24, 2026
@BeastNectus
Copy link
Copy Markdown
Contributor Author

Closing this because #6448 was already open for the same issue before this PR. I'll avoid duplicating the existing review thread.

@BeastNectus
Copy link
Copy Markdown
Contributor Author

Reopening because this PR is part of an external take-home assignment submission. I understand there is another open PR for similar work.

@BeastNectus BeastNectus reopened this Apr 24, 2026
@jarednorman
Copy link
Copy Markdown
Member

The transaction approach here doesn't make any sense to me. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_core Changes to the solidus_core gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Payment log entries are not being saved for refunds

2 participants