Delay user registration feed for 20min and start him if payment status is paid

Hi,

We are using Gravity Forms with Gravity Forms User Registration and Gravity Forms SystemPay (a plugin to collect our donations through SystemPay).

Gravity Forms SystemPay is a very light plugin but we can get through IPN the payment confirmation after the donation. On the other hand, we do not have any pre-made “events” on Gravity Form User Registration in order to only Create/Update the account if the donation is paid.

So we are looking for a way to do it in PHP.

Can we use this filter : gform_is_delayed_pre_process_feed to delay the User Registration feed for like 20 minutes. After 20 minutes the system would look if the payment status is “Paid” then the feed would start. If the payment status is still “Pending” or “Cancelled” then the feed would not start.

Is it possible ? I am looking for every idea.

I know that we can “manually” validate Users in the “Create user” feed, but in the “Update feed” we do not have this option, all parameters are instantly send to the user profile.

I am sorry for my english. I hope I was clear.

Thanks by advance,
Jonathan


EDIT : Gravity Forms SystemPay add-on offer a solution to delay Notifications based on payment status with the following code :

if(isset($config["meta"]["delay_notifications"])){
            //sending delayed notifications
            GFCommon::send_notifications($config["meta"]["selected_notifications"], $form, $entry, true, "form_submission");
        }

If I could add a line to also process my User Registration Feeds in the same function it would solve my issue.

Payment add-ons can delay feeds for other add-ons, including User Registration, by overrding the get_post_payment_actions_config function in their add-on class which extends the GFPaymentAddOn class. Here is what that looks like in the Stripe add-on: Screenshot 2022-06-06 at 08.58.29.png - Droplr

When that function returns an array and the feed add-on supports the delayed payments feature then the payment add-on will automatically delay the feeds when enabled in the feed configuration.

To trigger processing of the delayed feed post payment the add-on should include the following code in their method which handles processing the IPN or webhook from the payment gateway:

if ( method_exists( $this, 'trigger_payment_delayed_feeds' ) ) {
    $this->trigger_payment_delayed_feeds( $transaction_id, $feed, $entry, $form );
}
1 Like

Thank you for you response. I am not able to use your proposition (I maybe do not have the PHP requirements skills). But I will keep trying.

If you have any example of how to use this in my case (with User Registration) it would be very nice of you.

Thanks again.