Skip to content

Redirect after payment #6

Open
Open
@rvdsteege

Description

From customer:

We have a form with a Pronamic Pay - Form action. We also have an action: Confirmation → Redirect to url. However, the action: "Confirmation" is not used and the user is redirected after payment to the url: /betalingsstatus/betaling-voltooid/. As a result, we cannot submit additional form fields as a parameter.

It appears there are some issues with redirects after payments:

/**
* Redirect URL.
*
* @param string $url Redirect URL.
* @param Payment $payment Payment.
* @return string
* @since 2.2.0
*/
public function redirect_url( $url, Payment $payment ) {
// Check payment status.
if ( PaymentStatus::SUCCESS !== $payment->get_status() ) {
return $url;
}
// Get entry and form.
$entry_id = $payment->get_source_id();
$entry = FrmEntry::getOne( $entry_id );
$form = FrmForm::getOne( $entry->form_id );
// Check if redirect success URL should be used.
if ( 'redirect' === $form->options['success_action'] ) {
$success_url = \trim( $form->options['success_url'] );
$success_url = \apply_filters( 'frm_content', $success_url, $form, $entry_id );
$success_url = \do_shortcode( $success_url );
$success_url = \filter_var( $success_url, \FILTER_SANITIZE_URL );
// Return success URL from settings.
if ( ! empty( $success_url ) ) {
return $success_url;
}
}
// Return default URL.
return $url;
}

Before Formidable Forms 6.0, forms had a 'success action' setting:

Scherm­afbeelding 2024-04-30 om 11 09 45

Internal Help Scout ticket: https://secure.helpscout.net/conversation/2581191408/27163

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions