Skip to content

fix(receipt): preserve success extra metadata#10

Open
EfeDurmaz16 wants to merge 1 commit into
stripe:mainfrom
EfeDurmaz16:fix/receipt-success-extra
Open

fix(receipt): preserve success extra metadata#10
EfeDurmaz16 wants to merge 1 commit into
stripe:mainfrom
EfeDurmaz16:fix/receipt-success-extra

Conversation

@EfeDurmaz16
Copy link
Copy Markdown

Summary

  • add an extra: keyword to Mpp::Receipt.success
  • pass the extra receipt metadata through to the underlying Receipt
  • update the Sorbet shim and add a regression test

Why

Mpp::Receipt already models extra, and receipt parsing/formatting preserves it in the Payment-Receipt header. The Receipt.success convenience constructor dropped that metadata, which made it harder for successful payment receipts to carry trace IDs or other opaque settlement evidence without manually constructing the receipt.

Verification

  • mise exec ruby@3.4 -- ruby -Ilib -Itest test/mpp/test_parsing.rb -n test_receipt_success_factory_preserves_extra passed after the fix
  • mise exec ruby@3.4 -- bundle exec ruby -Itest test/mpp/test_parsing.rb -n test_receipt_success_factory_preserves_extra
  • mise exec ruby@3.4 -- bundle exec ruby -Itest test/mpp/test_parsing.rb
  • mise exec ruby@3.4 -- bundle exec rake test
  • mise exec ruby@3.4 -- bundle exec standardrb
  • mise exec ruby@3.4 -- bundle exec srb tc

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.

1 participant