feat(webhooks): add payment methods related flows to analytics event tracking and IncomingWebhookReceive flow to refunds analytics filter #10549
+32
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This PR enhances audit trail visibility by adding new API flow types in payment audit trail and improves webhook traceability by including refund identifiers in webhook event tracking. It also strengthens type safety across refund-related flows.
Key Changes
Added new API flow tracking in analytics/audit trail:
PaymentMethodsListCustomerPaymentMethodsListPaymentsSessionTokenIncomingWebhookReceiveAdded refund_id support in webhook audit events:
StringGlobalRefundIdWebhook handlers (v1 & v2) enriched to include refund_id
Ensures refund webhook events can be linked to specific refund transactions.
Improved type safety:
WebhookResponseTracker::Refundin v2 to useGlobalRefundIdMotivation and Context
Several API flows were previously missing in the audit trail, making debugging and monitoring difficult. Refund webhook events also lacked
refund_id, preventing full traceability of refund operations.This PR introduces the missing audit events and adds refund identifiers to webhook logs to close these gaps.
Use Cases
PaymentMethodsList,CustomerPaymentMethodsList)PaymentsSessionTokengeneration is now fully trackedrefund_idwhen applicableHow did you test it?
IncomingWebhookReceiveImpact
GlobalRefundIdin v2Checklist
cargo +nightly fmt --all)cargo clippy