Title: Callback error after payment
Last modified: April 4, 2026

---

# Callback error after payment

 *  Resolved [danidek](https://wordpress.org/support/users/danidek/)
 * (@danidek)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/callback-error-after-payment/)
 * Hi,
 * I found an issue in the `pay-via-barion-for-woocommerce` plugin that can leave
   WooCommerce orders unpaid even when the Barion payment itself succeeds.
 * Observed behavior:
   The customer completes the payment successfully on the Barion
   side and is redirected back to the webshop, but the WooCommerce order remains
   in `pending` / “Payment pending” status. On the order received page, the “Pay”
   button is still visible as if the order had not been paid.
 * Cause:
   In `includes/class-wc-gateway-barion-return-from-payment.php`, the return
   flow checks the Barion payment state, but when the payment is successful it does
   not call WooCommerce `payment_complete()`. Because of that, if the Barion callback/
   IPN does not arrive, or arrives too late, the order is never finalized in WooCommerce
   even though the payment was successful.
 * There is also an incorrect early exit in `includes/class-wc-gateway-barion-ipn-
   handler.php` for orders in `on-hold` status, which can also prevent successful
   order completion.
 * What I changed locally:
    1. In the return handler, when Barion reports a successful payment and the order
       is still `pending` or `on-hold`, I call WooCommerce `payment_complete()`.
    2. I also save the closing meta flag and transaction ID during the successful return
       flow.
    3. In the IPN handler, I removed the incorrect `on-hold` ignore branch.
 * Result:
   After this change, when the customer returns from a successful Barion
   payment, the WooCommerce order is correctly moved to a paid state, the transaction
   ID is saved, and the normal WooCommerce post-payment flow continues as expected.

Viewing 1 replies (of 1 total)

 *  Plugin Author [oaron](https://wordpress.org/support/users/oaron/)
 * (@oaron)
 * [1 week, 2 days ago](https://wordpress.org/support/topic/callback-error-after-payment/#post-18928770)
 * Hi,
 * Apologies for the late reply, and thank you for the detailed, well-investigated
   report — you’re right on both counts.
   Please update to 3.9 and let me know if
   anything else comes up. Thanks again for the report!

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcallback-error-after-payment%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/pay-via-barion-for-woocommerce/assets/icon-256x256.png?rev
   =1416679)
 * [Barion Payment Gateway for WooCommerce](https://wordpress.org/plugins/pay-via-barion-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pay-via-barion-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pay-via-barion-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/pay-via-barion-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pay-via-barion-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pay-via-barion-for-woocommerce/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [oaron](https://wordpress.org/support/users/oaron/)
 * Last activity: [1 week, 2 days ago](https://wordpress.org/support/topic/callback-error-after-payment/#post-18928770)
 * Status: resolved