Skip to content

fix(mpp): require receipt method and timestamp - #107

Open
cryptoryda wants to merge 1 commit into
tempoxyz:mainfrom
cryptoryda:fix/require-receipt-core-fields
Open

fix(mpp): require receipt method and timestamp#107
cryptoryda wants to merge 1 commit into
tempoxyz:mainfrom
cryptoryda:fix/require-receipt-core-fields

Conversation

@cryptoryda

Copy link
Copy Markdown
Contributor

Require method and timestamp in Payment receipts

Summary

Reject Payment-Receipt headers that omit the required method or timestamp fields.

Previously, ParsePaymentReceipt accepted these malformed receipts and returned an empty method or a zero-value time.Time. This makes receipt validation stricter and prevents incomplete receipts from being treated as valid.

Changes

  • Require a non-empty timestamp before parsing it.
  • Require a non-empty method before validating its syntax.
  • Preserve the existing timestamp-format and method-name validation.
  • Add regression coverage for missing and empty values for both fields.

Testing

  • go test ./pkg/mpp
  • go vet ./...
  • go test -race -count=1 ./...

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