Conversation
🦋 Changeset detectedLatest commit: cdd6a70 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis pull request adds support for forwarding exchange rates to webhooks. It extends the webhook payload schema to include an optional Changes
Sequence Diagram(s)sequenceDiagram
participant TxnEvent as Transaction Event
participant ServerLogic as Server Logic
participant WebhookBuilder as Webhook Payload Builder
participant WebhookTarget as External Webhook
TxnEvent->>ServerLogic: Transaction created/completed<br/>(currency, localCurrency)
activate ServerLogic
alt currency ≠ localCurrency
ServerLogic->>WebhookBuilder: Include exchangeRate
else currency = localCurrency
ServerLogic->>WebhookBuilder: Omit exchangeRate
end
deactivate ServerLogic
WebhookBuilder->>WebhookBuilder: Construct payload with<br/>conditional exchangeRate
WebhookBuilder->>WebhookTarget: POST webhook payload
activate WebhookTarget
WebhookTarget->>WebhookTarget: Verify signature<br/>& process payload
deactivate WebhookTarget
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces the inclusion of exchange rates in webhook payloads when the transaction currency differs from the local currency. The implementation involves updating the transaction and webhook schemas, modifying the publishing logic to conditionally attach the exchange rate, and updating the documentation. Comprehensive tests have been added and updated to verify the new behavior. I have no feedback to provide.
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Prevent Tests Dashboard |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 84402000-271a-4d76-8f8b-bd546d875628
📒 Files selected for processing (4)
.changeset/shy-foxes-trade.mddocs/src/content/docs/webhooks.mdserver/hooks/panda.tsserver/test/hooks/panda.test.ts
Summary by CodeRabbit
Release Notes
New Features
Documentation