Description:
In Popup (Inline) mode, when a customer abandons a payment and retries on the same Magento order, the plugin correctly initialises a new Paystack transaction reference for each attempt against the same quoteId. This is expected behaviour.
However, when Paystack delivers a charge.success webhook for the successful transaction, the webhook handler in Controller/Payment/Webhook.php looks up the Magento order using the quoteId from the webhook metadata. The handler only advances the order if exactly one order is found for that quoteId:
if($items->getTotalCount() == 1)
When a customer has made more than one payment attempt on the same quote, multiple orders exist for the same quoteId. This condition evaluates to false and the handler exits silently without advancing the order, leaving it permanently in PENDING status despite a confirmed successful payment on Paystack's side.
Impact:
Any merchant using Popup mode where customers abandon and retry payment on the same order will experience this issue. The order requires manual intervention to advance to PROCESSING. This is particularly prevalent in markets with high 3DS authentication friction where customers frequently retry.
Steps to reproduce:
- Customer proceeds to checkout and opens the Paystack popup
- Customer abandons without completing payment
- Customer retries payment on the same order
- Customer successfully completes payment on the retry
- Paystack delivers charge.success webhook
- Order remains in PENDING in Magento Admin
Expected behaviour:
The webhook handler should correctly identify and advance the most recent PENDING order for the quoteId when multiple orders exist.
Affected file:
Controller/Payment/Webhook.php
Description:
In Popup (Inline) mode, when a customer abandons a payment and retries on the same Magento order, the plugin correctly initialises a new Paystack transaction reference for each attempt against the same quoteId. This is expected behaviour.
However, when Paystack delivers a charge.success webhook for the successful transaction, the webhook handler in Controller/Payment/Webhook.php looks up the Magento order using the quoteId from the webhook metadata. The handler only advances the order if exactly one order is found for that quoteId:
if($items->getTotalCount() == 1)
When a customer has made more than one payment attempt on the same quote, multiple orders exist for the same quoteId. This condition evaluates to false and the handler exits silently without advancing the order, leaving it permanently in PENDING status despite a confirmed successful payment on Paystack's side.
Impact:
Any merchant using Popup mode where customers abandon and retry payment on the same order will experience this issue. The order requires manual intervention to advance to PROCESSING. This is particularly prevalent in markets with high 3DS authentication friction where customers frequently retry.
Steps to reproduce:
Expected behaviour:
The webhook handler should correctly identify and advance the most recent PENDING order for the quoteId when multiple orders exist.
Affected file:
Controller/Payment/Webhook.php