You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!$this->quoteRecreate->recreate($this->quote, $this->response)) {
517
533
$this->logger->addError('Could not recreate the quote.');
@@ -530,7 +546,7 @@ protected function handleFailed($statusCode)
530
546
$this->helper->getStatusCode('BUCKAROO_MAGENTO2_ORDER_FAILED') => 'Unfortunately an error occurred while processing your payment. Please try again. If this error persists, please choose a different payment method.',
531
547
$this->helper->getStatusCode('BUCKAROO_MAGENTO2_STATUSCODE_FAILED') => 'Unfortunately an error occurred while processing your payment. Please try again. If this error persists, please choose a different payment method.',
532
548
$this->helper->getStatusCode('BUCKAROO_MAGENTO2_STATUSCODE_REJECTED') => 'Unfortunately an error occurred while processing your payment. Please try again. If this error persists, please choose a different payment method.',
533
-
$this->helper->getStatusCode('BUCKAROO_MAGENTO2_STATUSCODE_CANCELLED_BY_USER') => 'According to our system, you have canceled the payment. If this is not the case, please contact us.',
549
+
$this->helper->getStatusCode('BUCKAROO_MAGENTO2_STATUSCODE_CANCELLED_BY_USER') => 'Payment cancelled. You can try again using the same or a different payment method.',
534
550
];
535
551
536
552
$this->addErrorMessage(__($statusCodeAddErrorMessage[$statusCode] ?? 'An error occurred while processing your payment.'));
@@ -540,12 +556,45 @@ protected function handleFailed($statusCode)
540
556
return$this->redirectFailure();
541
557
}
542
558
543
-
// Cancel the order and log an error if it fails
544
-
if (!$this->cancelOrder($statusCode, $statusCodeAddErrorMessage[$statusCode])) {
545
-
$this->logger->addError('Could not cancel the order.');
559
+
// For browser back button, check configuration
560
+
if ($isBrowserBack && !$shouldCancelOnBrowserBack) {
561
+
$this->logger->addDebug(sprintf(
562
+
'%s - Browser Back Button Detected - Order left in pending state (config: cancel_on_browser_back = disabled). Quote recreated for retry. Order: %s',
563
+
__METHOD__,
564
+
$this->order->getIncrementId()
565
+
));
566
+
567
+
// Add a status history comment to track this
568
+
$this->order->addCommentToStatusHistory(
569
+
__('Customer returned using browser back button. Order left pending for push notification.'),
570
+
false,
571
+
false
572
+
);
573
+
$this->order->save();
574
+
575
+
} else {
576
+
// For actual failures OR if config says to cancel on browser back, cancel the order as before
577
+
if ($isBrowserBack) {
578
+
$this->logger->addDebug(sprintf(
579
+
'%s - Browser Back Button Detected - Order will be canceled (config: cancel_on_browser_back = enabled). Order: %s',
580
+
__METHOD__,
581
+
$this->order->getIncrementId()
582
+
));
583
+
}
584
+
585
+
if (!$this->cancelOrder($statusCode, $statusCodeAddErrorMessage[$statusCode])) {
586
+
$this->logger->addError('Could not cancel the order.');
<label>Cancel Order on Browser Back Button</label>
214
+
<comment><![CDATA[Determines behavior when customer clicks browser back button after reaching payment page:<br/><strong>No (Recommended)</strong>: Order remains pending. If payment completes, order is reactivated automatically.<br/><strong>Yes</strong>: Order is canceled immediately (old behavior). Customer must start over.]]></comment>
Copy file name to clipboardExpand all lines: i18n/de_AT.csv
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -507,3 +507,7 @@
507
507
"An error occurred, please try another payment method or try again later."."Ein Fehler ist aufgetreten. Bitte versuchen Sie eine andere Zahlungsmethode oder versuchen Sie es später erneut."
508
508
"Payment processing failed. Please try again.","Zahlungsverarbeitung fehlgeschlagen. Bitte versuchen Sie es erneut."
509
509
"Payment token is missing. Please try again.","Zahlungstoken fehlt. Bitte versuchen Sie es erneut."
510
+
"Cancel Order on Browser Back Button","Cancel Order on Browser Back Button"
511
+
"Payment cancelled. You can try again using the same or a different payment method.","Payment cancelled. You can try again using the same or a different payment method."
512
+
"Customer returned using browser back button. Order left pending for push notification.","Customer returned using browser back button. Order left pending for push notification."
Copy file name to clipboardExpand all lines: i18n/de_CH.csv
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -507,3 +507,7 @@
507
507
"An error occurred, please try another payment method or try again later."."Ein Fehler ist aufgetreten. Bitte versuchen Sie eine andere Zahlungsmethode oder versuchen Sie es später erneut."
508
508
"Payment processing failed. Please try again.","Zahlungsverarbeitung fehlgeschlagen. Bitte versuchen Sie es erneut."
509
509
"Payment token is missing. Please try again.","Zahlungstoken fehlt. Bitte versuchen Sie es erneut."
510
+
"Cancel Order on Browser Back Button","Cancel Order on Browser Back Button"
511
+
"Payment cancelled. You can try again using the same or a different payment method.","Payment cancelled. You can try again using the same or a different payment method."
512
+
"Customer returned using browser back button. Order left pending for push notification.","Customer returned using browser back button. Order left pending for push notification."
Copy file name to clipboardExpand all lines: i18n/de_DE.csv
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -507,3 +507,7 @@
507
507
"An error occurred, please try another payment method or try again later."."Ein Fehler ist aufgetreten. Bitte versuchen Sie eine andere Zahlungsmethode oder versuchen Sie es später erneut."
508
508
"Payment processing failed. Please try again.","Zahlungsverarbeitung fehlgeschlagen. Bitte versuchen Sie es erneut."
509
509
"Payment token is missing. Please try again.","Zahlungstoken fehlt. Bitte versuchen Sie es erneut."
510
+
"Cancel Order on Browser Back Button","Cancel Order on Browser Back Button"
511
+
"Payment cancelled. You can try again using the same or a different payment method.","Payment cancelled. You can try again using the same or a different payment method."
512
+
"Customer returned using browser back button. Order left pending for push notification.","Customer returned using browser back button. Order left pending for push notification."
0 commit comments