Redirection checking code in MultiPaymentProcess checkout pane does not work with latest Commerce

Created on 21 July 2023, over 1 year ago

Problem/Motivation

This code in the payment process step no longer works:

<?php
    catch (NeedsRedirectException $e){
      // We could be redirecting from success or failure.
      // Need to check if we're redirecting to the error step
      $error_step_id = $this->getErrorStepId();

      if($e->getTrace()[0]['args'][0] == $error_step_id) {
        $this->reverseStagedPayments($staged_payments);
        $this->redirectToPreviousStep(TRUE);
      }
    }
?>

There are no args in the trace step to check against. We need a new way to check to see if we're succeeding or at the charge.

Proposed resolution

We can check to see if we're redirecting to a URL that ends in "/complete".

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States zengenuity

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024