Skip to content

Allow retry of payment for orders with status CREATED#27

Open
ahacart-adexos wants to merge 1 commit into
BitBagCommerce:masterfrom
ahacart-adexos:master
Open

Allow retry of payment for orders with status CREATED#27
ahacart-adexos wants to merge 1 commit into
BitBagCommerce:masterfrom
ahacart-adexos:master

Conversation

@ahacart-adexos

@ahacart-adexos ahacart-adexos commented May 19, 2025

Copy link
Copy Markdown

What is the problem?

When a payment attempt is initiated but not completed (user leaves PSP page), the plugin sets p24_status and then blocks any further retries from the storefront or customer account because the code returns whenever p24_status is defined, regardless of its value.


How to reproduce

  1. Place an order using the Przelewy24 payment option.
  2. At the redirect to the PSP, quit the page without completing the payment.
  3. Go to Your account, then Order History, and then Retry Payment.
  4. No redirect to the PSP occurs (the code returns early) and then you are redirected to payment success confirmation page instead of PSP.

Proposed solution

Only block access to the PSP when the payment status is set and not equal to created.

--- src/Action/CaptureAction.php
+++ src/Action/CaptureAction.php
@@ public function execute($request): void
-    if (isset($details['p24_status'])) {
-        return;
-    }
+    if (isset($details['p24_status']) && $details['p24_status'] !== Przelewy24BridgeInterface::CREATED_STATUS) {
+        return;
+    }

This change ensures that when p24_status === created (for example if the first attempt is incomplete), the flow continues and redirects back to the PSP for retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant