The session metadata a Worldline webhook's payment echoes, read by the rules
PaymentInfo.metadata follows (see WorldlineServerAdapter.retrievePayment):
payment.paymentOutput.references.merchantParameters, else the deprecated
payment.paymentOutput.merchantParameters, as the JSON object of strings
the adapter sent. UnifiedWebhookEvent has no metadata field, so this reads
the event's raw delivery. Undefined for another PSP's event, a delivery
without a payment resource (a refund resource alone, a payment link), or an
echo that is not metadata the adapter wrote. A refund resource's own
merchantParameters is never read: it is the refund's, which RefundPayment
takes in its own request and the adapter never sends, not the payment's.
The session metadata a Worldline webhook's payment echoes, read by the rules
PaymentInfo.metadatafollows (see WorldlineServerAdapter.retrievePayment):payment.paymentOutput.references.merchantParameters, else the deprecatedpayment.paymentOutput.merchantParameters, as the JSON object of strings the adapter sent.UnifiedWebhookEventhas no metadata field, so this reads the event'srawdelivery. Undefined for another PSP's event, a delivery without a payment resource (a refund resource alone, a payment link), or an echo that is not metadata the adapter wrote. A refund resource's own merchantParameters is never read: it is the refund's, which RefundPayment takes in its own request and the adapter never sends, not the payment's.