Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect after payment #6

Open
rvdsteege opened this issue Apr 30, 2024 · 0 comments
Open

Redirect after payment #6

rvdsteege opened this issue Apr 30, 2024 · 0 comments

Comments

@rvdsteege
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant