Webhooks

Certification cases for webhook handler behavior and event coverage.

Part of the Certification guide. Mark your scope on that page before you run these cases. Base payloads and test cards are on the Reference page.


13. Webhooks

Applies to: WEBHOOKS. Register one HTTPS endpoint in the sandbox portal and subscribe it to all events. Each delivery carries a unique IdempotencyKey; redeliveries carry IsResent: true. order.completed, order.cancelled, and order.expired are sent only when the order status changes and the endpoint subscribes to the event. Match each delivery to the merchant order by OrderId, with ExternalOrderId as the fallback. Every sandbox delivery carries IsTestMode: true; never update production order state from it.

Reference: Webhooks, Testing webhooks, Appendix C.3.

13.1 Handler behavior

IDScenarioSetup / actionExpected resultEvidence
WEBHOOK-01Immediate 2xxTrigger any order eventThe endpoint returns a 2xx within 2 seconds, before any processing logic runsHTTP status and response time
WEBHOOK-02Non-JSON content type acceptedInspect a received deliveryThe handler parses the text body as JSON regardless of the Content-Type headerParsed payload
WEBHOOK-03Redelivery processed one timeReturn HTTP 500 for one deliveryFlexFactor redelivers the event with IsResent: true. The merchant order is updated one time, keyed on IdempotencyKeyBoth payloads
WEBHOOK-04Signature verification (recommended)Verify x-fc-authorization on a received delivery with the sandbox subscriber keyThe recomputed HMAC-SHA512 matches; a tampered body fails verificationVerification result

13.2 Event coverage

The order events are produced by the flow cases. Record the IdempotencyKey of each event against the source case on the result sheet; no separate case is needed.

EventProduced byExpected handling
order.completedCIT-PURCHASE-01, CIT-AUTHORIZE-02, MIT-ASYNC-PURCHASE-02, MIT-ASYNC-AUTHORIZE-03, SYNC-MIT-03Received after the API response; the merchant order is marked paid one time
order.cancelledMIT-ASYNC-PURCHASE-03, CANCEL-01, CANCEL-03The merchant order is marked cancelled or returned to dunning
order.expiredMIT-ASYNC-PURCHASE-04, SYNC-MIT-05, CIT-AUTHORIZE-04The merchant order is marked failed
order.capturerequiredMIT-ASYNC-AUTHORIZE-02, SYNC-MIT-04A capture is issued within the capture window
order.refundedREFUND-01EventData.Amount is in cents and matches the refund
challenge.presentedCIT-PURCHASE-03The merchant order remains declined

The dispute events are not produced by any flow case. FlexFactor triggers them on request.

IDScenarioSetup / actionExpected resultEvidence
WEBHOOK-05payment.chargeback.received and payment.chargeback.reversedSupport: request a test chargeback on a completed sandbox order, then a test reversalBoth events received. EventData on the chargeback carries DisputeDateTime, Reason, Amount, and Currency. The merchant order is flagged disputed, then the flag is clearedBoth IdempotencyKey values
WEBHOOK-06payment.early_warning.receivedSupport: request a simulated alertReceived; the alert is recorded against the orderIdempotencyKey
📘

Two events that are easy to misread

A Visa RDR resolution is surfaced through payment.chargeback.received, not order.refunded. order.refunded echoes a refund you initiated, and no reversal action is required on receipt.



Did this page help you?