fix(ack-pay): bind payment receipt issuer to receiptService - #194
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. WalkthroughChangesPayment receipt issuer binding
Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to The PR tightens payment receipt validation by requiring DID-based issuers to match the selected payment option and rejecting unknown options; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The implementation satisfies issue ✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes #192
receiptServicewhenreceiptServiceis a DID.paymentOptionIddoes not exist in the verified payment request.Root Cause
verifyPaymentReceiptverified the receipt issuer againsttrustedReceiptIssuersand verified the embeddedpaymentRequestToken, but it did not compare the selected payment option'sreceiptServiceDID with the verified receipt issuer.What Changed
verifiedReceipt.credentialSubject.paymentOptionId.InvalidCredentialSubjectErrorwhen the payment option is missing.UntrustedIssuerErrorwhen the selected payment optionreceiptServiceis a DID and does not matchverifiedReceipt.issuer.id.Tests
How to Test
Checklist
Risk & Impact
Low-to-medium. The change only tightens verification: receipts whose
paymentOptionIdis missing or whose issuer doesn't match a DID-typedreceiptServiceare now rejected. Payment options with a URL-typedreceiptService, or a matching DID issuer, are unaffected — existing valid verification flows continue to pass.Type: 🐛 Bug fix / 🔒 Security fix
Fixes: #192
Summary by CodeRabbit