Giter Club home page Giter Club logo

wp-pronamic-pay-formidable-forms's Introduction

wp-pronamic-pay-formidable-forms's People

Contributors

remcotolsma avatar rvdsteege avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

knit-pay

wp-pronamic-pay-formidable-forms's Issues

Redirect after payment

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

Add support for order ID setting

In Dutch:

Met Gravity Forms hebben gebruikers ook de mogelijkheid om de bestelling ID aan te passen met behulp van Gravity Forms merge tags. Gisteren kwam er een pre-sale vraag binnen of dit ook mogelijk is in combinatie met Ingenico/Ogone en Formidable Forms. Op dit moment is dit echter niet mogelijk, de feed/actie instellingen zijn bij Formidable Forms een stuk beperkter:

pay local_wp-admin_admin php_page=formidable frm_action=settings id=2

Source: https://github.com/pronamic/pronamic-pay/issues/48#issuecomment-1655349154

In Gravity Forms we have already a settings for this:

https://github.com/pronamic/wp-pronamic-pay-gravityforms/blob/0be7f4a377f77bdb7af2b1c2f8c94c5efb0e3a9e/views/html-admin-feed-settings.php#L158-L217

We could also make the settings a bit more DRY:

<table class="form-table">
<tr>
<th scope="col">
<?php esc_html_e( 'Amount', 'pronamic_ideal' ); ?>
</th>
<td>
<?php
printf(
'<select name="%s">',
esc_attr( $this->get_field_name( 'pronamic_pay_amount_field' ) )
);
$options = [
'' => __( '— Select Field —', 'pronamic_ideal' ),
];
foreach ( $form_fields as $field ) {
$options[ $field->id ] = FrmAppHelper::truncate( $field->name, 50, 1 );
}
foreach ( $options as $value => $label ) {
printf(
'<option value="%s" %s>%s</option>',
esc_attr( $value ),
selected( $field_amount, $value, false ),
esc_html( $label )
);
}
echo '</select>';
?>
</td>
</tr>
<tr>
<th scope="col">
<?php esc_html_e( 'Payment method', 'pronamic_ideal' ); ?>
</th>
<td>
<?php
printf(
'<select name="%s">',
esc_attr( $this->get_field_name( 'pronamic_pay_payment_method_field' ) )
);
$options = [
'' => __( '— Select Field —', 'pronamic_ideal' ),
];
foreach ( $form_fields as $field ) {
if ( PaymentMethodSelectFieldType::ID !== $field->type ) {
continue;
}
$options[ $field->id ] = FrmAppHelper::truncate( $field->name, 50, 1 );
}
foreach ( $options as $value => $label ) {
printf(
'<option value="%s" %s>%s</option>',
esc_attr( $value ),
selected( $field_method, $value, false ),
esc_html( $label )
);
}
echo '</select>';
?>
</td>
</tr>
<tr>
<th scope="col">
<?php \esc_html_e( 'Payment Gateway Configuration', 'pronamic_ideal' ); ?>
</th>
<td>
<?php
\printf(
'<select name="%s">',
esc_attr( $this->get_field_name( 'pronamic_pay_config_id' ) )
);
$options = Plugin::get_config_select_options();
$options[0] = __( '– Default Gateway –', 'pronamic_ideal' );
foreach ( $options as $value => $label ) {
\printf(
'<option value="%s" %s>%s</option>',
\esc_attr( $value ),
\selected( $config_id, $value, false ),
\esc_html( $label )
);
}
echo '</select>';
?>
</td>
</tr>
<tr>
<th scope="col">
<?php esc_html_e( 'Transaction Description', 'pronamic_ideal' ); ?>
</th>
<td>
<?php
printf(
'<input type="text" name="%s" value="%s" class="large-text frm_help" title="" data-original-title="%s" />',
esc_attr( $this->get_field_name( 'pronamic_pay_transaction_description' ) ),
esc_attr( $transaction_description ),
esc_attr__( 'Enter a transaction description, you can use Formidable Forms shortcodes.', 'pronamic_ideal' )
);
?>
</td>
</tr>
<tr>
<th scope="col">
<?php esc_html_e( 'Notifications', 'pronamic_ideal' ); ?>
</th>
<td>
<?php
printf(
'<input type="checkbox" name="%s" title="" %s /> %s',
esc_attr( $this->get_field_name( 'pronamic_pay_delay_notifications' ) ),
checked( $delay_notifications, 'on', false ),
esc_attr__( 'Delay email notifications until payment has been received.', 'pronamic_ideal' )
);
?>
</td>
</tr>
</table>

Extend Formidable Forms entries list with Pronamic Pay payment info/status

Requested today in the following two HelpScout tickets:

In het overzicht bij Formidable kan ik niet zien wie er al heeft betaald

Internal HelpScout ticket: https://secure.helpscout.net/conversation/1604299059/22548/

I have connected Pronamic pay to Formidable Form and use Mollie as my payment gateway. I want to retrieve the payment status of each form to display it in a column at the entry list of Formidable Form. This will allow our agents to know at a glance which paid requests need to be processed without having to check the payment status in Pronamic Pay or Mollie.

Internal HelpScout ticket: https://secure.helpscout.net/conversation/1604764244/22552?folderId=1425720

In the following Gist a quick solution:
https://gist.github.com/remcotolsma/9738e8830764b4e517565e920dffd893

Schermafbeelding 2021-08-18 om 16 37 49

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.