fix(core-flows): emit payment.captured after order payment authorization - #16748
fix(core-flows): emit payment.captured after order payment authorization#16748Sudaisib wants to merge 1 commit into
Conversation
|
|
Thanks for the contribution! A few items need to be addressed before this can move forward: The author adds event emission for PaymentEvents.CAPTURED inside authorizePaymentSessionForOrderWorkflow when the authorized payment contains captures. The approach is sound and the payload { id: payment.id } is consistent with how capturePaymentWorkflow emits the same event. The conditional when guard (emit only when captures.length > 0) is appropriate. No security, performance, or correctness issues were found in the added code itself. However, three required items are missing before this can move forward: 1. Changeset: The changeset-bot confirms no changeset was added. Any code change under packages/ must include a changeset file. 2. Tests: The testing description only mentions manual code review and local whitespace checks. A behavior-changing fix of this kind — adding event emission on an authorization path — should have at least a unit test verifying the event is emitted when the payment has captures and is not emitted when it has none. 3. Linked issue: There is no linked issue via a closing keyword. Non-trivial behavior changes should reference a verified issue per the contribution guidelines.
Triggered by: new PR opened |
Summary
The
authorizePaymentSessionForOrderWorkflowcan successfully authorize a payment session and create order transactions, but it did not emit the workflow-levelpayment.capturedevent when the provider returned captures. This PR emitsPaymentEvents.CAPTUREDwhen captures are present.Why
Consumers that depend on the payment-captured workflow event were not notified for captures performed through this authorization path.
Changes
PaymentEventsandemitEventStep.PaymentEvents.CAPTUREDwith the payment ID when the authorized payment contains captures.Testing
The change was reviewed against the existing workflow implementation and validated locally with whitespace and structural checks. The PR is intentionally limited to the missing event emission.