Allow contrib modules to alter data in PaymentOffsiteForm before API call

Created on 21 April 2025, 4 days ago

Problem/Motivation

I'm running Drupal in a sub-folder.
This means the redirect_path and exit_path path set in PaymentOffsiteForm are wrong.

Proposed resolution

Allow contrib modules to alter data before it's passed to the API via an OffsitePaymentEvent.

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom dahousecat

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

Comments & Activities

  • Issue created by @dahousecat
  • 🇬🇧United Kingdom dahousecat

    This patch is against the 2.1.x branch as I had issues running the dev branch.

  • 🇬🇧United Kingdom roblog Cymru

    Hi, thanks for raising this. I was considering adding an event there as it happens, so it is timely. However there may be a simpler way to fix this particular issue. Please can you tell me what the output of the following is if you add it to the PaymentOffsiteForm:

    dpm($this->currentRequest->getBasePath())
    dpm($this->currentRequest->getPathInfo());
    dpm($this->currentRequest->getRequestUri());
    return $form;

    (I would check myself except it involves going through the whole process of setting up a new site, so it is probably quicker if you tell me.)

    Thanks

Production build 0.71.5 2024